| @@ -9,9 +9,8 @@ | ||
| 9 | 9 | |
| 10 | 10 | class Admin |
| 11 | 11 | { |
| 12 | 12 | public $tabRenderer; |
| 13 | - public $parentSlug; | |
| 14 | 13 | |
| 15 | 14 | public function __construct() |
| 16 | 15 | { |
| 17 | 16 | add_action( 'admin_menu', array($this, 'adminMenu'), 9); |
| @@ -26,9 +25,8 @@ | ||
| 26 | 25 | add_action( 'admin_init', array( $this, 'init' ) ); |
| 27 | 26 | |
| 28 | 27 | add_filter( 'wpc_general_filters_settings', [$this, 'generalFilterSettings'] ); |
| 29 | 28 | |
| 30 | - add_action( 'admin_head', array( $this, 'menuHighlight' ) ); | |
| 31 | 29 | add_action('admin_head', array($this, 'addAdminStyles')); |
| 32 | 30 | |
| 33 | 31 | } |
| 34 | 32 | |
| @@ -56,8 +54,13 @@ | ||
| 56 | 54 | |
| 57 | 55 | if (!defined('FLRT_FILTERS_PRO')) { |
| 58 | 56 | $settings = flrt_vailable_in_pro_attr_link(); |
| 59 | 57 | |
| 58 | + // Two PRO-only destinations in the menu, each with the PRO badge. They | |
| 59 | + // were dropped in 1.9.6 to keep the menu short and are back since 1.9.7: | |
| 60 | + // the owner saw fewer free → PRO visits without them — two PRO-badged | |
| 61 | + // entries in the menu and the toolbar are a visible reminder of what | |
| 62 | + // PRO adds. | |
| 60 | 63 | add_submenu_page($page, esc_html__('SEO Rules', 'filter-everything'), esc_html__('SEO Rules', 'filter-everything'), 'manage_options', $settings); |
| 61 | 64 | add_submenu_page($page, esc_html__('Import/Export', 'filter-everything'), esc_html__('Import/Export', 'filter-everything'), 'manage_options', $settings); |
| 62 | 65 | |
| 63 | 66 | if (isset($submenu[$page])) { |
| @@ -72,8 +75,9 @@ | ||
| 72 | 75 | do_action('wpc_add_submenu_pages'); |
| 73 | 76 | |
| 74 | 77 | add_submenu_page( $page, esc_html__('Settings', 'filter-everything'), esc_html__('Settings', 'filter-everything'), 'manage_options', 'filters-settings', array($this, 'filterSettingsPage')); |
| 75 | 78 | |
| 79 | + // «What's new» is a Settings tab since 1.9.7 (WhatsNew), not a menu entry | |
| 76 | 80 | do_action('wpc_after_add_submenu_pages'); |
| 77 | 81 | |
| 78 | 82 | } |
| 79 | 83 | |
| @@ -91,8 +95,11 @@ | ||
| 91 | 95 | |
| 92 | 96 | $this->tabRenderer->register(new ExperimentalTab()); |
| 93 | 97 | |
| 94 | 98 | if( ! defined('FLRT_FILTERS_PRO') ) { |
| 99 | + // Free: What's new goes BEFORE «PRO benefits», so the tab that sells | |
| 100 | + // stays last and most visible (owner, 2026-09-22) | |
| 101 | + do_action( 'wpc_settings_tabs_registered', $this->tabRenderer ); | |
| 95 | 102 | $this->tabRenderer->register( new AboutProTab() ); |
| 96 | 103 | |
| 97 | 104 | }else{ |
| 98 | 105 | $show_license_tab = false; |
| @@ -109,26 +116,14 @@ | ||
| 109 | 116 | $this->tabRenderer->register(new LicenseTab( FLRT_LICENSE_KEY )); |
| 110 | 117 | } |
| 111 | 118 | } |
| 112 | 119 | |
| 113 | - $this->tabRenderer->init(); | |
| 114 | - } | |
| 115 | - | |
| 116 | - public function menuHighlight() | |
| 117 | - { | |
| 118 | - if ( ! is_admin() ) { | |
| 119 | - return; | |
| 120 | + // PRO: What's new is the last tab, after License | |
| 121 | + if ( defined('FLRT_FILTERS_PRO') ) { | |
| 122 | + do_action( 'wpc_settings_tabs_registered', $this->tabRenderer ); | |
| 120 | 123 | } |
| 121 | 124 | |
| 122 | - $is_filters_settings = isset($_GET['page']) && $_GET['page'] === 'filters-settings'; | |
| 123 | - $is_import_export_tab = isset($_GET['tab']) && $_GET['tab'] === 'import_export'; | |
| 124 | - | |
| 125 | - if ( $is_filters_settings && $is_import_export_tab ) { | |
| 126 | - global $parent_file, $submenu_file; | |
| 127 | - | |
| 128 | - $parent_file = $this->parentSlug ? $this->parentSlug : ('edit.php?post_type=' . FLRT_FILTERS_SET_POST_TYPE); | |
| 129 | - $submenu_file = $parent_file . '&page=filters-settings&tab=import_export'; | |
| 130 | - } | |
| 125 | + $this->tabRenderer->init(); | |
| 131 | 126 | } |
| 132 | 127 | |
| 133 | 128 | public function addAdminStyles() |
| 134 | 129 | { |
| @@ -152,14 +147,8 @@ | ||
| 152 | 147 | position: absolute; |
| 153 | 148 | } |
| 154 | 149 | </style> |
| 155 | 150 | <?php |
| 156 | - } | |
| 157 | - | |
| 158 | - | |
| 159 | - public function get_icon_svg() | |
| 160 | - { | |
| 161 | - return flrt_get_icon_svg(); | |
| 162 | 151 | } |
| 163 | 152 | |
| 164 | 153 | public function checkPermissions() |
| 165 | 154 | { |