для бейджа wp_kses( __( '➡ Content Plan PRO', 'ai-content-wizard' ), array( 'span' => array( 'class' => true, 'style' => true ) ) ), 'manage_options', $content_plan_menu_slug, '__return_false' ); add_submenu_page( 'ai_content_wizard', esc_html__( '➡ Create Post', 'ai-content-wizard' ), wp_kses( __( '➡ Create Post AI', 'ai-content-wizard' ), array( 'span' => array( 'class' => true, 'style' => true ) ) ), 'manage_options', empty( $api_key ) ? 'ai_content_wizard_create_post_disabled' : 'ai_content_wizard_create_post', empty( $api_key ) ? '__return_false' : 'ai_content_wizard_create_post_page' ); add_submenu_page( 'ai_content_wizard', esc_html__( '➡ Content Stream', 'ai-content-wizard' ), wp_kses( __( '➡ Content Stream PRO', 'ai-content-wizard' ), array( 'span' => array( 'class' => true, 'style' => true ) ) ), 'manage_options', $content_stream_menu_slug, '__return_false' ); add_submenu_page( 'ai_content_wizard', esc_html__( '➡ API Settings', 'ai-content-wizard' ), esc_html__( '➡ API Settings', 'ai-content-wizard' ), 'manage_options', 'ai_content_wizard_api_settings', 'ai_content_wizard_api_settings_page' ); add_submenu_page( 'ai_content_wizard', esc_html__( '➡ AI Training (Beta)', 'ai-content-wizard' ), wp_kses( __( '➡ AI Training PRO', 'ai-content-wizard' ), array( 'span' => array( 'class' => true, 'style' => true ) ) ), 'manage_options', $ai_training_menu_slug, '__return_false' ); add_submenu_page( 'ai_content_wizard', esc_html__( '➡ Statistics', 'ai-content-wizard' ), esc_html__( '➡ Statistics', 'ai-content-wizard' ), 'manage_options', 'ai_content_wizard_statistics', 'ai_content_wizard_statistics_page' ); add_submenu_page( 'ai_content_wizard', esc_html__( '➡ Logs', 'ai-content-wizard' ), esc_html__( '➡ Logs', 'ai-content-wizard' ), 'manage_options', 'ai_content_wizard_logs', 'ai_content_wizard_logs_page' ); add_submenu_page( 'ai_content_wizard', esc_html__( '➡ System Check', 'ai-content-wizard' ), esc_html__( '➡ System Check', 'ai-content-wizard' ), 'manage_options', 'ai_content_wizard_system_check', 'ai_content_wizard_system_check_page' ); } add_action( 'admin_menu', 'ai_content_wizard_add_admin_menu' ); function ai_content_wizard_admin_styles() { ?> $item ) { if ( in_array( $item[2], array( 'ai_content_wizard_content_plan_disabled', 'ai_content_wizard_create_post_disabled', 'ai_content_wizard_content_stream_disabled', 'ai_content_wizard_ai_training_disabled' ) ) ) { $submenu['ai_content_wizard'][ $key ][4] = 'ai-content-wizard-disabled'; } } } return $parent_file; } add_filter( 'parent_file', 'ai_content_wizard_disable_menu_items' ); function ai_content_wizard_admin_notice() { // Не выводим уведомление, если мы на странице мастера установки if ( isset( $_GET['page'] ) && $_GET['page'] === 'ai_content_wizard_wizard' ) { return; } // Проверяем наличие API ключа if ( empty( ai_content_wizard_get_setting( 'ai_content_wizard_api_key' ) ) ) { $image_url = plugins_url( '/css/img/notice.jpg', dirname( __FILE__, 1 ) ); ?>
<?php esc_attr_e( 'AI Content Wizard', 'ai-content-wizard' ); ?>

' : ''; $count_badge = $is_running ? '' . intval( $remaining_posts ) . '' : ''; return $is_running ? $status_icon . ' ' . $count_badge : $status_icon; } function get_content_plan_status() { return wp_next_scheduled( 'ai_content_wizard_generate_post_event' ) !== false; } function get_remaining_posts_count() { global $wpdb; $table_name = $wpdb->prefix . 'ai_content_wizard_content_plan'; $remaining_posts = $wpdb->get_var( "SELECT COUNT(*) FROM $table_name WHERE status = 'Waiting'" ); return $remaining_posts ? intval( $remaining_posts ) : 0; } function ai_content_wizard_add_create_post_submenu_correctly() { global $submenu; $api_key = ai_content_wizard_get_setting( 'ai_content_wizard_api_key' ); $create_post_menu_slug = empty( $api_key ) ? 'ai_content_wizard_create_post_disabled' : 'ai_content_wizard_create_post'; $menu_title = esc_html__( 'Create Post', 'ai-content-wizard' ) . ' AI'; if ( isset( $submenu['edit.php'] ) ) { $submenu_item = array( $menu_title, 'edit_posts', empty( $api_key ) ? '' : esc_url( admin_url( 'admin.php?page=' . $create_post_menu_slug ) ) ); if ( empty( $api_key ) ) { $submenu_item[4] = 'ai-content-wizard-disabled'; } array_splice( $submenu['edit.php'], 2, 0, array( $submenu_item ) ); } } add_action( 'admin_menu', 'ai_content_wizard_add_create_post_submenu_correctly' ); function ai_content_wizard_add_custom_button_with_translation_and_access_check() { $current_screen = get_current_screen(); $api_key = ai_content_wizard_get_setting( 'ai_content_wizard_api_key' ); if ( 'edit-post' === $current_screen->id && current_user_can( 'manage_options' ) && ! empty( $api_key ) ) { $create_post_url = esc_url( admin_url( 'admin.php?page=ai_content_wizard_create_post' ) ); ?> id && current_user_can( 'manage_options' ) && ! empty( $api_key ) ) { $content_plan_status = ai_content_wizard_get_content_plan_status(); // Получаем статус (иконка + счетчик) // Здесь можно оставить URL пустым или сделать его неактивным $content_plan_url = '#'; ?>

в этом сообщении echo wp_kses( __( 'SEO Plugin is required for optimal performance. We highly recommend installing Rank Math for the best experience.', 'ai-content-wizard' ), array( 'strong' => array() ) ); ?>