PluginProbe
ActivityPub / 7.0.0
ActivityPub v7.0.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 7.0.0, at includes/wp-admin/class-menu.php

70 lines 1.7 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 \add_action( 'load-users.php', array( Settings::class, 'add_users_help_tab' ) );
31
32 // User has to be able to publish posts.
33 if ( user_can_activitypub( \get_current_user_id() ) ) {
34 $followers_list_page = \add_users_page(
35 \__( 'Followers ⁂', 'activitypub' ),
36 \__( 'Followers ⁂', 'activitypub' ),
37 'activitypub',
38 'activitypub-followers-list',
39 array( Admin::class, 'followers_list_page' )
40 );
41
42 \add_action( 'load-' . $followers_list_page, array( Admin::class, 'add_followers_list_help_tab' ) );
43
44 /**
45 * Filter to show the following UI.
46 *
47 * @param bool $show Show following UI.
48 */
49 if ( \apply_filters( 'activitypub_show_following_ui', false ) ) {
50 $following_list_page = \add_users_page(
51 \__( 'Following ⁂', 'activitypub' ),
52 \__( 'Following ⁂', 'activitypub' ),
53 'activitypub',
54 'activitypub-following-list',
55 array( Admin::class, 'following_list_page' )
56 );
57
58 \add_action( 'load-' . $following_list_page, array( Admin::class, 'add_following_list_help_tab' ) );
59 }
60
61 \add_users_page(
62 \__( 'Extra Fields ⁂', 'activitypub' ),
63 \__( 'Extra Fields ⁂', 'activitypub' ),
64 'activitypub',
65 \esc_url( \admin_url( '/edit.php?post_type=ap_extrafield' ) )
66 );
67 }
68 }
69 }
70