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/wp-conte.../plugins/sitepres.../compatib.../jetpack
File: class-wpml-compatibility-jetpack.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* Class WPML_Compatibility_Jetpack
[3] Fix | Delete
*/
[4] Fix | Delete
class WPML_Compatibility_Jetpack implements IWPML_Action {
[5] Fix | Delete
[6] Fix | Delete
/**
[7] Fix | Delete
* Add hooks.
[8] Fix | Delete
*/
[9] Fix | Delete
public function add_hooks() {
[10] Fix | Delete
add_filter(
[11] Fix | Delete
'publicize_should_publicize_published_post',
[12] Fix | Delete
array( $this, 'publicize_should_publicize_published_post_filter' ), 10, 2
[13] Fix | Delete
);
[14] Fix | Delete
}
[15] Fix | Delete
[16] Fix | Delete
/**
[17] Fix | Delete
* Filter to prevent duplicate post from being publicized.
[18] Fix | Delete
*
[19] Fix | Delete
* @param bool $should_publicize Should publicize post.
[20] Fix | Delete
* @param WP_Post $post Post.
[21] Fix | Delete
*
[22] Fix | Delete
* @return bool
[23] Fix | Delete
*/
[24] Fix | Delete
public function publicize_should_publicize_published_post_filter( $should_publicize, $post ) {
[25] Fix | Delete
return ! $this->is_post_duplicated( $post );
[26] Fix | Delete
}
[27] Fix | Delete
[28] Fix | Delete
/**
[29] Fix | Delete
* Check if post is a duplicate being created at the moment.
[30] Fix | Delete
* We cannot use standard method to determine duplicate as post meta '_icl_lang_duplicate_of' is not set yet.
[31] Fix | Delete
*
[32] Fix | Delete
* @param $post
[33] Fix | Delete
*
[34] Fix | Delete
* @return bool
[35] Fix | Delete
*/
[36] Fix | Delete
private function is_post_duplicated( $post ) {
[37] Fix | Delete
if (
[38] Fix | Delete
apply_filters( 'wpml_is_translated_post_type', false, $post->post_type ) &&
[39] Fix | Delete
did_action( 'wpml_before_make_duplicate' )
[40] Fix | Delete
) {
[41] Fix | Delete
return true;
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
return false;
[45] Fix | Delete
}
[46] Fix | Delete
}
[47] Fix | Delete
[48] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function