true, ); $post_types = get_post_types( $args ); /** * Filter post types on which the meta box is displayed * * @since 2.2.0 * * @param array $post_types Array of post types */ $post_types = apply_filters( 'tptn_meta_box_post_types', $post_types ); if ( in_array( $post_type, $post_types, true ) ) { add_meta_box( 'tptn_metabox', 'Top 10', array( __CLASS__, 'call_meta_box' ), $post_type, 'advanced', 'default' ); } } /** * Function to call the meta box. * * @since 1.9.10 */ public static function call_meta_box() { global $post; // Add an nonce field so we can check for it later. wp_nonce_field( 'tptn_meta_box', 'tptn_meta_box_nonce' ); // Get the number of visits for the post being editted. $total_count = get_tptn_total_count( $post->ID, get_current_blog_id() ); // Get the post meta. $post_meta = get_post_meta( $post->ID, 'tptn_post_meta', true ); $disable_here = isset( $post_meta['disable_here'] ) ? $post_meta['disable_here'] : 0; $exclude_this_post = isset( $post_meta['exclude_this_post'] ) ? $post_meta['exclude_this_post'] : 0; $thumb_meta = get_post_meta( $post->ID, \tptn_get_option( 'thumb_meta' ), true ); $thumb_meta = ( $thumb_meta ) ? $thumb_meta : ''; ?>
/>
/>
'; } ?> base || 'page' === $screen->base ) { $file_prefix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; if ( ! wp_style_is( 'wz-tptn-tom-select', 'registered' ) ) { wp_register_style( 'wz-tptn-tom-select', TOP_TEN_PLUGIN_URL . 'includes/admin/settings/css/tom-select.min.css', array(), \WebberZone\Top_Ten\Admin\Settings\Settings_API::VERSION ); } if ( ! wp_script_is( 'wz-tptn-tom-select', 'registered' ) ) { wp_register_script( 'wz-tptn-tom-select', TOP_TEN_PLUGIN_URL . 'includes/admin/settings/js/tom-select.complete.min.js', array( 'jquery' ), \WebberZone\Top_Ten\Admin\Settings\Settings_API::VERSION, true ); } if ( ! wp_script_is( 'wz-tptn-tom-select-init', 'registered' ) ) { wp_register_script( 'wz-tptn-tom-select-init', TOP_TEN_PLUGIN_URL . "includes/admin/settings/js/tom-select-init{$file_prefix}.js", array( 'jquery', 'wz-tptn-tom-select' ), \WebberZone\Top_Ten\Admin\Settings\Settings_API::VERSION, true ); } wp_localize_script( 'wz-tptn-tom-select-init', 'WZTomSelectSettings', array( 'endpoint' => 'category', 'strings' => array( /* translators: %s: search term */ 'no_results' => esc_html__( 'No results found for "%s"', 'top-10' ), ), ) ); wp_enqueue_style( 'wz-tptn-tom-select' ); wp_enqueue_script( 'wz-tptn-tom-select' ); wp_enqueue_script( 'wz-tptn-tom-select-init' ); } } }