is_conflicting_pro_version() ) { add_action( 'all_admin_notices', [ $this, 'pro_version_warning' ] ); add_filter( 'advanced-sidebar-menu/scripts/js-config/error', [ $this, 'get_pro_version_warning_message' ] ); } } /** * Is PRO active but an unsupported version? * * @return bool */ public function is_conflicting_pro_version() { return \defined( 'ADVANCED_SIDEBAR_MENU_PRO_VERSION' ) && version_compare( ADVANCED_SIDEBAR_MENU_REQUIRED_PRO_VERSION, ADVANCED_SIDEBAR_MENU_PRO_VERSION, '>' ); } /** * Display a warning if we don't have the required PRO version installed. * * @param bool $no_banner - Display as "message" banner. */ public function pro_version_warning( $no_banner = false ) { ?>
]{%2$s}[] */ return sprintf( esc_html_x( 'Advanced Sidebar Menu requires %1$sAdvanced Sidebar Menu PRO%2$s version %3$s+. Please update or deactivate the PRO version.', '{}{}', 'advanced-sidebar-menu' ), '', '', esc_attr( ADVANCED_SIDEBAR_MENU_REQUIRED_PRO_VERSION ) ); } /** * Notify widget users about the PRO options * * @param array $instance - widget instance. * @param \WP_Widget $widget - widget class. * * @return void */ public function info_panel( array $instance, \WP_Widget $widget ) { if ( $this->is_conflicting_pro_version() ) { ?> element add an "open" class to the parent * div element. */ ?> id_base ) { $src = 'category-widget-min.webp?version=' . ADVANCED_SIDEBAR_MENU_BASIC_VERSION; } ?> %2$s', 'https://onpointplugins.com/product/advanced-sidebar-menu-pro/?utm_source=wp-plugins&utm_campaign=gopro&utm_medium=wp-dash', __( 'Go PRO', 'advanced-sidebar-menu' ) ); } return $actions; } /** * Get a list of PRO plugin features for display in * the info panel for widgets and blocks. * * @return array */ public function get_features() { return [ __( 'Styling options including borders, bullets, colors, backgrounds, font size and weight.', 'advanced-sidebar-menu' ), __( 'Accordion menus.', 'advanced-sidebar-menu' ), __( 'Support for custom navigation menus from Appearance -> Menus.', 'advanced-sidebar-menu' ), __( 'Select and display custom post types and taxonomies.', 'advanced-sidebar-menu' ), __( 'Priority support with access to members only support area.', 'advanced-sidebar-menu' ), ]; } }