wp_taxonomies = &$wp_taxonomies; } function render() { $icl_post_types = $this->sitepress->get_translatable_documents( true ); $cposts = array(); $notice = ''; foreach ( $icl_post_types as $k => $v ) { if ( ! in_array( $k, array( 'post', 'page' ) ) ) { $cposts[ $k ] = $v; } } $cpt_sync_settings = $this->sitepress->get_setting( 'custom_posts_sync_option' ); foreach ( $cposts as $k => $cpost ) { if ( ! isset( $cpt_sync_settings[ $k ] ) ) { $cposts_sync_not_set[] = $cpost->labels->name; } } if ( ! empty( $cposts_sync_not_set ) ) { $notice = '
'; $notice .= sprintf( __( "You haven't set your synchronization preferences for these custom posts: %s. Default value was selected.", 'sitepress' ), 'href="admin.php?page=' . WPML_TM_FOLDER . '/menu/main.php&sm=mcsetup"', '' . join( ', ', $cposts_sync_not_set ) . '' ); $notice .= '
'; } if ( $icl_post_types ) { $custom_posts = array(); foreach ( $icl_post_types as $k => $v ) { if ( ! in_array( $k, array( 'post', 'page' ) ) ) { $custom_posts[ $k ] = $v; } } $notice = apply_filters( 'wpml_tm_dashboard_cpt_notice', $notice, $custom_posts ); } $ctaxonomies = array_diff( array_keys( (array) $this->wp_taxonomies ), array( 'post_tag', 'category', 'nav_menu', 'link_category', 'post_format' ) ); $tax_sync_settings = $this->sitepress->get_setting( 'taxonomies_sync_option' ); foreach ( $ctaxonomies as $ctax ) { if ( ! isset( $tax_sync_settings[ $ctax ] ) ) { $tax_sync_not_set[] = $this->wp_taxonomies[ $ctax ]->label; } } if ( ! empty( $tax_sync_not_set ) ) { $notice .= ''; $notice .= sprintf( __( "You haven't set your synchronization preferences for these taxonomies: %s. Default value was selected.", 'sitepress' ), 'href="admin.php?page=' . WPML_TM_FOLDER . '/menu/main.php&sm=mcsetup"', '' . join( ', ', $tax_sync_not_set ) . '' ); $notice .= '
'; } return $notice; } }