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
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wordpres.../inc
File: wpseo-non-ajax-functions.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WPSEO plugin file.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WPSEO\Internals
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
if ( ! defined( 'WPSEO_VERSION' ) ) {
[7] Fix | Delete
header( 'Status: 403 Forbidden' );
[8] Fix | Delete
header( 'HTTP/1.1 403 Forbidden' );
[9] Fix | Delete
exit();
[10] Fix | Delete
}
[11] Fix | Delete
[12] Fix | Delete
/**
[13] Fix | Delete
* Initializes the admin bar.
[14] Fix | Delete
*
[15] Fix | Delete
* @return void
[16] Fix | Delete
*/
[17] Fix | Delete
function wpseo_initialize_admin_bar() {
[18] Fix | Delete
$admin_bar_menu = new WPSEO_Admin_Bar_Menu();
[19] Fix | Delete
$admin_bar_menu->register_hooks();
[20] Fix | Delete
}
[21] Fix | Delete
add_action( 'wp_loaded', 'wpseo_initialize_admin_bar' );
[22] Fix | Delete
[23] Fix | Delete
/**
[24] Fix | Delete
* Allows editing of the meta fields through weblog editors like Marsedit.
[25] Fix | Delete
*
[26] Fix | Delete
* @param array $required_capabilities Capabilities that must all be true to allow action.
[27] Fix | Delete
* @param array $capabilities Array of capabilities to be checked, unused here.
[28] Fix | Delete
* @param array $args List of arguments for the specific capabilities to be checked.
[29] Fix | Delete
*
[30] Fix | Delete
* @return array Filtered capabilities.
[31] Fix | Delete
*/
[32] Fix | Delete
function allow_custom_field_edits( $required_capabilities, $capabilities, $args ) {
[33] Fix | Delete
if ( ! in_array( $args[0], [ 'edit_post_meta', 'add_post_meta' ], true ) ) {
[34] Fix | Delete
return $required_capabilities;
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
// If this is provided, it is the post ID.
[38] Fix | Delete
if ( empty( $args[2] ) ) {
[39] Fix | Delete
return $required_capabilities;
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
// If this is provided, it is the custom field.
[43] Fix | Delete
if ( empty( $args[3] ) ) {
[44] Fix | Delete
return $required_capabilities;
[45] Fix | Delete
}
[46] Fix | Delete
[47] Fix | Delete
// If the meta key is part of the plugin, grant capabilities accordingly.
[48] Fix | Delete
if ( strpos( $args[3], WPSEO_Meta::$meta_prefix ) === 0 && current_user_can( 'edit_post', $args[2] ) ) {
[49] Fix | Delete
$required_capabilities[ $args[0] ] = true;
[50] Fix | Delete
}
[51] Fix | Delete
[52] Fix | Delete
return $required_capabilities;
[53] Fix | Delete
}
[54] Fix | Delete
[55] Fix | Delete
add_filter( 'user_has_cap', 'allow_custom_field_edits', 0, 3 );
[56] Fix | Delete
[57] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function