Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wordpres.../inc
File: class-wpseo-meta.php
*/
[1000] Fix | Delete
public static function keyword_usage( $keyword, $post_id ) {
[1001] Fix | Delete
[1002] Fix | Delete
if ( empty( $keyword ) ) {
[1003] Fix | Delete
return [];
[1004] Fix | Delete
}
[1005] Fix | Delete
[1006] Fix | Delete
/**
[1007] Fix | Delete
* The indexable repository.
[1008] Fix | Delete
*
[1009] Fix | Delete
* @var Indexable_Repository
[1010] Fix | Delete
*/
[1011] Fix | Delete
$repository = YoastSEO()->classes->get( Indexable_Repository::class );
[1012] Fix | Delete
[1013] Fix | Delete
$post_ids = $repository->query()
[1014] Fix | Delete
->select( 'object_id' )
[1015] Fix | Delete
->where( 'primary_focus_keyword', $keyword )
[1016] Fix | Delete
->where( 'object_type', 'post' )
[1017] Fix | Delete
->where_not_equal( 'object_id', $post_id )
[1018] Fix | Delete
->where_not_equal( 'post_status', 'trash' )
[1019] Fix | Delete
->limit( 2 ) // Limit to 2 results to save time and resources.
[1020] Fix | Delete
->find_array();
[1021] Fix | Delete
[1022] Fix | Delete
// Get object_id from each subarray in $post_ids.
[1023] Fix | Delete
$post_ids = ( is_array( $post_ids ) ) ? array_column( $post_ids, 'object_id' ) : [];
[1024] Fix | Delete
[1025] Fix | Delete
/*
[1026] Fix | Delete
* If Premium is installed, get the additional keywords as well.
[1027] Fix | Delete
* We only check for the additional keywords if we've not already found two.
[1028] Fix | Delete
* In that case there's no use for an additional query as we already know
[1029] Fix | Delete
* that the keyword has been used multiple times before.
[1030] Fix | Delete
*/
[1031] Fix | Delete
if ( count( $post_ids ) < 2 ) {
[1032] Fix | Delete
/**
[1033] Fix | Delete
* Allows enhancing the array of posts' that share their focus keywords with the post's focus keywords.
[1034] Fix | Delete
*
[1035] Fix | Delete
* @param array $post_ids The array of posts' ids that share their related keywords with the post.
[1036] Fix | Delete
* @param string $keyword The keyword to search for.
[1037] Fix | Delete
* @param int $post_id The id of the post the keyword is associated to.
[1038] Fix | Delete
*/
[1039] Fix | Delete
$post_ids = apply_filters( 'wpseo_posts_for_focus_keyword', $post_ids, $keyword, $post_id );
[1040] Fix | Delete
}
[1041] Fix | Delete
[1042] Fix | Delete
return $post_ids;
[1043] Fix | Delete
}
[1044] Fix | Delete
[1045] Fix | Delete
/**
[1046] Fix | Delete
* Returns the post types for the given post ids.
[1047] Fix | Delete
*
[1048] Fix | Delete
* @param array $post_ids The post ids to get the post types for.
[1049] Fix | Delete
*
[1050] Fix | Delete
* @return array The post types.
[1051] Fix | Delete
*/
[1052] Fix | Delete
public static function post_types_for_ids( $post_ids ) {
[1053] Fix | Delete
[1054] Fix | Delete
/**
[1055] Fix | Delete
* The indexable repository.
[1056] Fix | Delete
*
[1057] Fix | Delete
* @var Indexable_Repository
[1058] Fix | Delete
*/
[1059] Fix | Delete
$repository = YoastSEO()->classes->get( Indexable_Repository::class );
[1060] Fix | Delete
[1061] Fix | Delete
// Check if post ids is not empty.
[1062] Fix | Delete
if ( ! empty( $post_ids ) ) {
[1063] Fix | Delete
// Get the post subtypes for the posts that share the keyword.
[1064] Fix | Delete
$post_types = $repository->query()
[1065] Fix | Delete
->select( 'object_sub_type' )
[1066] Fix | Delete
->where_in( 'object_id', $post_ids )
[1067] Fix | Delete
->find_array();
[1068] Fix | Delete
[1069] Fix | Delete
// Get object_sub_type from each subarray in $post_ids.
[1070] Fix | Delete
$post_types = array_column( $post_types, 'object_sub_type' );
[1071] Fix | Delete
}
[1072] Fix | Delete
else {
[1073] Fix | Delete
$post_types = [];
[1074] Fix | Delete
}
[1075] Fix | Delete
[1076] Fix | Delete
return $post_types;
[1077] Fix | Delete
}
[1078] Fix | Delete
[1079] Fix | Delete
/**
[1080] Fix | Delete
* Filter the schema article types.
[1081] Fix | Delete
*
[1082] Fix | Delete
* @return void
[1083] Fix | Delete
*/
[1084] Fix | Delete
public static function filter_schema_article_types() {
[1085] Fix | Delete
/** This filter is documented in inc/options/class-wpseo-option-titles.php */
[1086] Fix | Delete
self::$meta_fields['schema']['schema_article_type']['options'] = apply_filters( 'wpseo_schema_article_types', self::$meta_fields['schema']['schema_article_type']['options'] );
[1087] Fix | Delete
}
[1088] Fix | Delete
}
[1089] Fix | Delete
[1090] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function