| @@ -722,11 +722,8 @@ | ||
| 722 | 722 | } |
| 723 | 723 | #toplevel_page_visualizer ul.wp-submenu li.wp-first-item + li + li + li > a:hover { |
| 724 | 724 | box-shadow: inherit; |
| 725 | 725 | } |
| 726 | - #toplevel_page_visualizer ul.wp-submenu li.wp-first-item + li + li + li + li { | |
| 727 | - display: none; | |
| 728 | - } | |
| 729 | 726 | </style> |
| 730 | 727 | <script type="text/javascript"> |
| 731 | 728 | jQuery( document ).ready( function() { |
| 732 | 729 | jQuery( '#toplevel_page_visualizer' ).on( 'click', 'li:not(.wp-submenu-head, .wp-first-item):eq(2)', function( e ) { |
| @@ -770,10 +767,10 @@ | ||
| 770 | 767 | * Adds the display filters to be used in the meta_query while displaying the charts. |
| 771 | 768 | */ |
| 772 | 769 | private function getDisplayFilters( &$query_args ) { |
| 773 | 770 | $query = array(); |
| 774 | - global $sitepress; | |
| 775 | - if ( Visualizer_Module::is_pro() && ( function_exists( 'icl_get_languages' ) && $sitepress instanceof \SitePress ) ) { | |
| 771 | + | |
| 772 | + if ( Visualizer_Module::is_pro() && function_exists( 'icl_get_languages' ) ) { | |
| 776 | 773 | $current_lang = icl_get_current_language(); |
| 777 | 774 | if ( in_array( $current_lang, array( 'all', icl_get_default_language() ), true ) ) { |
| 778 | 775 | $query[] = array( |
| 779 | 776 | 'key' => 'chart_lang', |
| @@ -885,9 +882,9 @@ | ||
| 885 | 882 | |
| 886 | 883 | $this->getDisplayFilters( $query_args ); |
| 887 | 884 | |
| 888 | 885 | // Added by Ash/Upwork |
| 889 | - $filterByMeta = ! empty( $_GET['s'] ) ? sanitize_text_field( wp_unslash( $_GET['s'] ) ) : null; // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 886 | + $filterByMeta = filter_input( INPUT_GET, 's', FILTER_SANITIZE_STRING ); | |
| 890 | 887 | if ( $filterByMeta ) { |
| 891 | 888 | $query = array( |
| 892 | 889 | 'key' => Visualizer_Plugin::CF_SETTINGS, |
| 893 | 890 | 'value' => $filterByMeta, |
| @@ -1140,17 +1137,18 @@ | ||
| 1140 | 1137 | * @param int $chart_id Chart ID. |
| 1141 | 1138 | * @return bool Default false |
| 1142 | 1139 | */ |
| 1143 | 1140 | public function addMultilingualSupport( $chart_id ) { |
| 1144 | - global $sitepress; | |
| 1145 | 1141 | if ( Visualizer_Module::is_pro() ) { |
| 1146 | 1142 | return; |
| 1147 | 1143 | } |
| 1148 | - if ( function_exists( 'icl_get_languages' ) && $sitepress instanceof \SitePress ) { | |
| 1144 | + if ( function_exists( 'icl_get_languages' ) ) { | |
| 1149 | 1145 | $language = icl_get_languages(); |
| 1150 | 1146 | $current_lang = icl_get_current_language(); |
| 1151 | 1147 | $default_lang = icl_get_default_language(); |
| 1152 | 1148 | $post_info = wpml_get_language_information( null, $chart_id ); |
| 1149 | + | |
| 1150 | + global $sitepress; | |
| 1153 | 1151 | $translations = array(); |
| 1154 | 1152 | if ( ! empty( $post_info ) && ( $default_lang === $post_info['language_code'] ) ) { |
| 1155 | 1153 | $trid = $sitepress->get_element_trid( $chart_id, 'post_' . Visualizer_Plugin::CPT_VISUALIZER ); |
| 1156 | 1154 | $translations = $sitepress->get_element_translations( $trid ); |
| @@ -1175,21 +1173,6 @@ | ||
| 1175 | 1173 | <a href="<?php echo tsdk_utmify( Visualizer_Plugin::PRO_TEASER_URL, 'wpml-support', 'visualizer_render_char' ); ?>"target="_blank"><?php esc_html_e( 'Upgrade to PRO to active this translation for charts', 'visualizer' ); ?></a> |
| 1176 | 1174 | </div> |
| 1177 | 1175 | <?php |
| 1178 | 1176 | } |
| 1179 | - } | |
| 1180 | - | |
| 1181 | - /** | |
| 1182 | - * Check chart is enabled or not. | |
| 1183 | - * | |
| 1184 | - * @param string $type Chart ID. | |
| 1185 | - * | |
| 1186 | - * @return bool Default false | |
| 1187 | - */ | |
| 1188 | - public static function checkChartStatus( $type ) { | |
| 1189 | - $types = self::_getChartTypesLocalized( false, false, false, true ); | |
| 1190 | - if ( isset( $types[ $type ] ) ) { | |
| 1191 | - return ! empty( $types[ $type ]['enabled'] ); | |
| 1192 | - } | |
| 1193 | - return false; | |
| 1194 | 1177 | } |
| 1195 | 1178 | } |