array( 'woocommerce-currency-switcher/index.php', 'WooCommerce Currency Switcher' ), ); foreach ( $plugins as $key => $value ) { if ( class_exists( $key ) && ! kite_woocommerce_installed() ) { deactivate_plugins( $value[0] ); wp_die( 'To Active ' . $value[1] . ' plugin , Woocommerce plugin needed' ); } } } /* -------------------------------------------------------------------------- */ /* Add featured image column in admin panel */ /* -------------------------------------------------------------------------- */ if ( ! function_exists( 'kite_add_post_thumbnail_column' ) ) { function kite_add_post_thumbnail_column( $cols ) { $cols['kite_post_thumb'] = esc_html__( 'Featured', 'teta-lite' ); return $cols; } } add_filter( 'manage_posts_columns', 'kite_add_post_thumbnail_column', 5 ); // Add the posts columns filter. add_filter( 'manage_pages_columns', 'kite_add_post_thumbnail_column', 5 ); // Add the pages columns filter. /* -------------------------------------------------------------------------- */ /* Hook into the posts an pages column managing. */ /* -------------------------------------------------------------------------- */ if ( ! function_exists( 'kite_display_post_thumbnail_column' ) ) { function kite_display_post_thumbnail_column( $col, $id ) { switch ( $col ) { case 'kite_post_thumb': if ( function_exists( 'the_post_thumbnail' ) ) { echo the_post_thumbnail( 'admin-list-thumb' ); } else { echo esc_html__( 'Not supported in theme', 'teta-lite' ); } break; } } } add_action( 'manage_posts_custom_column', 'kite_display_post_thumbnail_column', 5, 2 ); add_action( 'manage_pages_custom_column', 'kite_display_post_thumbnail_column', 5, 2 ); /* -------------------------------------------------------------------------- */ /* Custom Excerpt for posts + no format box */ /* -------------------------------------------------------------------------- */ if ( ! function_exists( 'kite_default_hidden_meta_boxes' ) ) { function kite_default_hidden_meta_boxes( $hidden, $screen ) { // Grab the current post type $post_type = $screen->post_type; // If we're on a 'post'... if ( $post_type == 'post' ) { // Define which meta boxes we wish to hide $hidden = array( 'trackbacksdiv', 'slugdiv', 'revisionsdiv', 'postcustom', 'commentstatusdiv', 'authordiv', 'formatdiv', ); // Pass our new defaults onto WordPress return $hidden; } // If we are not on a 'post', pass the // original defaults, as defined by WordPress return $hidden; } } add_action( 'default_hidden_meta_boxes', 'kite_default_hidden_meta_boxes', 10, 2 ); // // ─── KITE FUNCTION TO Show Activate Core Plugins Notice ────────────────────────────────────── // add_action( 'admin_notices', 'kite_install_required_plugins'); function kite_install_required_plugins() { if ( get_transient( 'kite-install-plugins-dismiss' )) { return; } $tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); $check_plugins[] = 'kitestudio-core'; foreach( $check_plugins as $key => $slug ) { if ( ! $tgmpa->is_plugin_installed( $slug ) ) { $plugins[ $slug ] = 'install'; } if ( $tgmpa->can_plugin_activate( $slug ) ) { $plugins[ $slug ] = 'activate'; } } if ( empty( $plugins ) ) { return; } ?>

', '' );?>

' . esc_html__( 'Go Pro', 'teta-lite') . ''; } /** * Use old widgets style */ add_filter( 'use_widgets_block_editor', '__return_false', 99 );