PluginProbe
ActivityPub / 5.7.0
ActivityPub v5.7.0
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
activitypub / includes / wp-admin / class-menu.php

class-menu.php in ActivityPub 5.7.0, at includes/wp-admin/class-menu.php

52 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Menu file.
4 *
5 * @package Activitypub
6 */
7
8 namespace Activitypub\WP_Admin;
9
10 use function Activitypub\user_can_activitypub;
11
12 /**
13 * ActivityPub Menu Class.
14 */
15 class Menu {
16
17 /**
18 * Add admin menu entry.
19 */
20 public static function admin_menu() {
21 $settings_page = \add_options_page(
22 'Welcome',
23 'ActivityPub',
24 'manage_options',
25 'activitypub',
26 array( Settings::class, 'settings_page' )
27 );
28
29 \add_action( 'load-' . $settings_page, array( Settings::class, 'add_settings_help_tab' ) );
30
31 // User has to be able to publish posts.
32 if ( user_can_activitypub( \get_current_user_id() ) ) {
33 $followers_list_page = \add_users_page(
34 \__( 'Followers ⁂', 'activitypub' ),
35 \__( 'Followers ⁂', 'activitypub' ),
36 'activitypub',
37 'activitypub-followers-list',
38 array( Admin::class, 'followers_list_page' )
39 );
40
41 \add_action( 'load-' . $followers_list_page, array( Admin::class, 'add_followers_list_help_tab' ) );
42
43 \add_users_page(
44 \__( 'Extra Fields ⁂', 'activitypub' ),
45 \__( 'Extra Fields ⁂', 'activitypub' ),
46 'activitypub',
47 \esc_url( \admin_url( '/edit.php?post_type=ap_extrafield' ) )
48 );
49 }
50 }
51 }
52