| @@ -14,16 +14,8 @@ | ||
| 14 | 14 | */ |
| 15 | 15 | class Menu { |
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | - * Initialize the Menu class. | |
| 19 | - */ | |
| 20 | - public static function init() { | |
| 21 | - \add_action( 'admin_menu', array( self::class, 'admin_menu' ) ); | |
| 22 | - \add_action( 'admin_bar_menu', array( self::class, 'admin_bar_menu' ), 100 ); | |
| 23 | - } | |
| 24 | - | |
| 25 | - /** | |
| 26 | 18 | * Add admin menu entry. |
| 27 | 19 | */ |
| 28 | 20 | public static function admin_menu() { |
| 29 | 21 | $settings_page = \add_options_page( |
| @@ -38,9 +30,9 @@ | ||
| 38 | 30 | \add_action( 'load-users.php', array( Settings::class, 'add_users_help_tab' ) ); |
| 39 | 31 | \add_action( 'load-' . $settings_page, array( Admin::class, 'add_settings_list_tables' ) ); |
| 40 | 32 | \add_action( 'load-' . $settings_page, array( Screen_Options::class, 'add_settings_list_options' ) ); |
| 41 | 33 | |
| 42 | - if ( \get_option( 'activitypub_reader_ui', '0' ) && App::is_supported() ) { | |
| 34 | + if ( \get_option( 'activitypub_reader_ui', '0' ) && \version_compare( \get_bloginfo( 'version' ), '6.9-alpha', '>=' ) ) { | |
| 43 | 35 | $app_hook = \add_dashboard_page( |
| 44 | 36 | \__( 'Social Web', 'activitypub' ), |
| 45 | 37 | \__( 'Social Web', 'activitypub' ), |
| 46 | 38 | ACTIVITYPUB_BLOG_MODE === \get_option( 'activitypub_actor_mode' ) ? 'manage_options' : 'activitypub', |
| @@ -97,44 +89,6 @@ | ||
| 97 | 89 | 'activitypub', |
| 98 | 90 | \esc_url( \admin_url( '/edit.php?post_type=ap_extrafield' ) ) |
| 99 | 91 | ); |
| 100 | 92 | } |
| 101 | - } | |
| 102 | - | |
| 103 | - /** | |
| 104 | - * Add Social Web item to the admin bar. | |
| 105 | - * | |
| 106 | - * @param \WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. | |
| 107 | - */ | |
| 108 | - public static function admin_bar_menu( $wp_admin_bar ) { | |
| 109 | - // Only show if reader UI is enabled and the WordPress app boot stack is available. | |
| 110 | - if ( ! \get_option( 'activitypub_reader_ui', '0' ) || ! App::is_supported() ) { | |
| 111 | - return; | |
| 112 | - } | |
| 113 | - | |
| 114 | - // Check user capability based on actor mode. | |
| 115 | - $capability = ACTIVITYPUB_BLOG_MODE === \get_option( 'activitypub_actor_mode' ) ? 'manage_options' : 'activitypub'; | |
| 116 | - if ( ! \current_user_can( $capability ) ) { | |
| 117 | - return; | |
| 118 | - } | |
| 119 | - | |
| 120 | - $wp_admin_bar->add_node( | |
| 121 | - array( | |
| 122 | - 'id' => 'activitypub-social-web', | |
| 123 | - 'title' => \__( 'Social Web', 'activitypub' ), | |
| 124 | - 'href' => \admin_url( 'admin.php?page=activitypub-social-web' ), | |
| 125 | - 'meta' => array( | |
| 126 | - 'class' => 'activitypub-admin-bar-social-web', | |
| 127 | - 'title' => \__( 'View your Social Web feed', 'activitypub' ), | |
| 128 | - ), | |
| 129 | - ) | |
| 130 | - ); | |
| 131 | - | |
| 132 | - // Enqueue styles for the admin bar icon. | |
| 133 | - \wp_enqueue_style( | |
| 134 | - 'activitypub-admin-bar-styles', | |
| 135 | - \plugins_url( 'assets/css/activitypub-admin-bar.css', ACTIVITYPUB_PLUGIN_FILE ), | |
| 136 | - array(), | |
| 137 | - ACTIVITYPUB_PLUGIN_VERSION | |
| 138 | - ); | |
| 139 | 93 | } |
| 140 | 94 | } |