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.../inc
File: wpml-private-actions.php
<?php
[0] Fix | Delete
[1] Fix | Delete
function new_duplicated_terms_filter( $post_ids, $duplicates_only = true ) {
[2] Fix | Delete
global $wpdb, $sitepress, $wpml_admin_notices;
[3] Fix | Delete
[4] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/taxonomy-term-translation/wpml-term-hierarchy-duplication.class.php';
[5] Fix | Delete
$hier_dupl = new WPML_Term_Hierarchy_Duplication( $wpdb, $sitepress );
[6] Fix | Delete
$taxonomies = $hier_dupl->duplicates_require_sync( $post_ids, $duplicates_only );
[7] Fix | Delete
if ( (bool) $taxonomies ) {
[8] Fix | Delete
$text = __(
[9] Fix | Delete
'<p>Some taxonomy terms are out of sync between languages. This means that content in some languages will not have the correct tags or categories.</p>
[10] Fix | Delete
<p>In order to synchronize the taxonomies, you need to go over each of them from the following list and click the "Update taxonomy hierarchy" button.</p>',
[11] Fix | Delete
'sitepress'
[12] Fix | Delete
);
[13] Fix | Delete
$collapsed = 'Taxonomy sync problem';
[14] Fix | Delete
[15] Fix | Delete
foreach ( $taxonomies as $taxonomy ) {
[16] Fix | Delete
$text .= '<p><a href="admin.php?page='
[17] Fix | Delete
. WPML_PLUGIN_FOLDER . '/menu/taxonomy-translation.php&taxonomy='
[18] Fix | Delete
. $taxonomy . '&sync=1">' . get_taxonomy_labels(
[19] Fix | Delete
get_taxonomy( $taxonomy )
[20] Fix | Delete
)->name . '</a></p>';
[21] Fix | Delete
}
[22] Fix | Delete
[23] Fix | Delete
$text .= '<p align="right"><a target="_blank" href="https://wpml.org/documentation/getting-started-guide/translating-post-categories-and-custom-taxonomies/#synchronizing-hierarchical-taxonomies">Help about translating taxonomy >></a></p>';
[24] Fix | Delete
[25] Fix | Delete
$notice = new WPML_Notice( 'wpml-taxonomy-hierarchy-sync', $text, 'wpml-core' );
[26] Fix | Delete
$notice->set_css_class_types( 'info' );
[27] Fix | Delete
$notice->set_collapsed_text( $collapsed );
[28] Fix | Delete
$notice->set_hideable( false );
[29] Fix | Delete
$notice->set_dismissible( false );
[30] Fix | Delete
$notice->set_collapsable( true );
[31] Fix | Delete
$wpml_admin_notices = wpml_get_admin_notices();
[32] Fix | Delete
$wpml_admin_notices->add_notice( $notice );
[33] Fix | Delete
} else {
[34] Fix | Delete
remove_taxonomy_hierarchy_message();
[35] Fix | Delete
}
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
add_action( 'wpml_new_duplicated_terms', 'new_duplicated_terms_filter', 10, 2 );
[39] Fix | Delete
[40] Fix | Delete
function display_tax_sync_message( $post_id ) {
[41] Fix | Delete
do_action( 'wpml_new_duplicated_terms', array( 0 => $post_id ), false );
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
add_action( 'save_post', 'display_tax_sync_message', 10 );
[45] Fix | Delete
[46] Fix | Delete
function remove_taxonomy_hierarchy_message() {
[47] Fix | Delete
$wpml_admin_notices = wpml_get_admin_notices();
[48] Fix | Delete
$wpml_admin_notices->remove_notice( 'wpml-core', 'wpml-taxonomy-hierarchy-sync' );
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
add_action( 'wpml_sync_term_hierarchy_done', 'remove_taxonomy_hierarchy_message' );
[52] Fix | Delete
[53] Fix | Delete
/**
[54] Fix | Delete
* @return WPML_Notices
[55] Fix | Delete
*/
[56] Fix | Delete
function wpml_get_admin_notices() {
[57] Fix | Delete
global $wpml_admin_notices;
[58] Fix | Delete
[59] Fix | Delete
if ( ! $wpml_admin_notices ) {
[60] Fix | Delete
$wpml_admin_notices = new WPML_Notices( new WPML_Notice_Render() );
[61] Fix | Delete
$wpml_admin_notices->init_hooks();
[62] Fix | Delete
}
[63] Fix | Delete
[64] Fix | Delete
return $wpml_admin_notices;
[65] Fix | Delete
}
[66] Fix | Delete
[67] Fix | Delete
function wpml_validate_language_domain_action() {
[68] Fix | Delete
[69] Fix | Delete
if ( wp_verify_nonce( filter_input( INPUT_POST, 'nonce' ),
[70] Fix | Delete
filter_input( INPUT_POST,
[71] Fix | Delete
'action' ) ) ) {
[72] Fix | Delete
global $sitepress;
[73] Fix | Delete
$http = new WP_Http();
[74] Fix | Delete
$wp_api = $sitepress->get_wp_api();
[75] Fix | Delete
$language_domains_helper = new WPML_Language_Domain_Validation( $wp_api, $http, filter_input( INPUT_POST, 'url' ) );
[76] Fix | Delete
$res = $language_domains_helper->is_valid();
[77] Fix | Delete
}
[78] Fix | Delete
if ( ! empty( $res ) ) {
[79] Fix | Delete
wp_send_json_success( __( 'Valid', 'sitepress' ) );
[80] Fix | Delete
}
[81] Fix | Delete
wp_send_json_error( __( 'Not valid', 'sitepress' ) );
[82] Fix | Delete
}
[83] Fix | Delete
[84] Fix | Delete
add_action( 'wp_ajax_validate_language_domain', 'wpml_validate_language_domain_action' );
[85] Fix | Delete
[86] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function