From 7c47f9a07c3640d06af0559a0a07ed159e88ab9c Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Fri, 28 Apr 2023 15:12:30 +0200 Subject: [PATCH] clean up admin settings --- includes/class-admin.php | 38 +++++++++++++++++-------------------- includes/functions.php | 19 ------------------- templates/user-settings.php | 29 ++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 40 deletions(-) create mode 100644 templates/user-settings.php diff --git a/includes/class-admin.php b/includes/class-admin.php index 2b7ee2a..66966f9 100644 --- a/includes/class-admin.php +++ b/includes/class-admin.php @@ -1,6 +1,8 @@ ID, ACTIVITYPUB_USER_DESCRIPTION_KEY, true ); - ?> -

- ID ); - ?> - - - - - - - - ID, ACTIVITYPUB_USER_DESCRIPTION_KEY, true ); + + \load_template( + ACTIVITYPUB_PLUGIN_DIR . 'templates/user-settings.php', + true, + array( + 'description' => $description, + ) + ); } public static function save_user_description( $user_id ) { - if ( ! wp_verify_nonce( $_REQUEST['_apnonce'], 'activitypub-user-description' ) ) { + if ( isset( $_REQUEST['_apnonce'] ) && ! wp_verify_nonce( $_REQUEST['_apnonce'], 'activitypub-user-description' ) ) { return false; } if ( ! current_user_can( 'edit_user', $user_id ) ) { diff --git a/includes/functions.php b/includes/functions.php index a436496..4d44853 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -241,25 +241,6 @@ function get_follower_inboxes( $user_id, $cc = array() ) { return $inboxes; } -function get_identifier_settings( $user_id ) { - ?> - - - - - - - -
- - -

or

- -

-
- + + + + + + + + + + + + + +
+ + +

+ or + +

+ +

+
+ + + +

+