From d27178e944f2710cab5b4e65cb76e1f106b06295 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Fri, 31 Jan 2020 16:12:24 -0700 Subject: [PATCH 1/3] remove the signups page --- inc/namespace.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/inc/namespace.php b/inc/namespace.php index e4ffb3c..d3883fe 100644 --- a/inc/namespace.php +++ b/inc/namespace.php @@ -87,6 +87,9 @@ function bootstrap() { // Force limit comments per page to 50 max. add_filter( 'pre_update_option_comments_per_page', __NAMESPACE__ . '\\set_comments_per_page' ); + + // Remove WP-Sign-Ups admin menu. + add_action( 'admin_menu', __NAMESPACE__ . '\\remove_wp_signups_admin_menu' ); } /** @@ -190,6 +193,12 @@ function remove_site_healthcheck_admin_menu() { remove_submenu_page( 'tools.php', 'site-health.php' ); } +/** + * Remove the signups menu. + */ +function remove_wp_signups_admin_menu() { + remove_menu_page( 'signups' ); +} /** * Disable access to the site health check admin page. * From 2f1e94ef94744e55a4a0f9100f230d8cb80d3f9f Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Fri, 31 Jan 2020 16:12:57 -0700 Subject: [PATCH 2/3] move the signups list menu into the Users submenu --- inc/namespace.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/inc/namespace.php b/inc/namespace.php index d3883fe..f85aee3 100644 --- a/inc/namespace.php +++ b/inc/namespace.php @@ -90,6 +90,10 @@ function bootstrap() { // Remove WP-Sign-Ups admin menu. add_action( 'admin_menu', __NAMESPACE__ . '\\remove_wp_signups_admin_menu' ); + + // Move the Sign Ups menu into the Users menu. + add_action( 'custom_menu_order', __NAMESPACE__ . '\\move_wp_signups_submenu' ); + } /** @@ -199,6 +203,22 @@ function remove_site_healthcheck_admin_menu() { function remove_wp_signups_admin_menu() { remove_menu_page( 'signups' ); } + +/** + * Move the Sign Ups list page into the Users menu and rename it to Invitations. + */ +function move_wp_signups_submenu() { + global $submenu; + + $submenu['signups'][0] = [ + __( 'Invitations', 'altis' ), + 'manage_signups', + 'signups', + __( 'Invitations', 'altis' ), + ]; + + $submenu['users.php'][] = $submenu['signups'][0]; +} /** * Disable access to the site health check admin page. * From 40b01920124346a60cd1b012c281369c466a0c33 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Fri, 31 Jan 2020 16:13:12 -0700 Subject: [PATCH 3/3] attempt to filter the sign ups title --- inc/namespace.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/inc/namespace.php b/inc/namespace.php index f85aee3..83d78e4 100644 --- a/inc/namespace.php +++ b/inc/namespace.php @@ -94,6 +94,8 @@ function bootstrap() { // Move the Sign Ups menu into the Users menu. add_action( 'custom_menu_order', __NAMESPACE__ . '\\move_wp_signups_submenu' ); + // Change the admin title to Invitations. + add_filter( 'admin_title', __NAMESPACE__ . '\\filter_wp_signups_title' ); } /** @@ -219,6 +221,16 @@ function move_wp_signups_submenu() { $submenu['users.php'][] = $submenu['signups'][0]; } + +/** + * Rename Sign ups to Invitations + * + * @param string $title The original admin title. + */ +function wp_signups_title( $title ) { + return str_replace( 'sign ups', __( 'Invitations', 'altis' ), strtolower( $title ) ); +} + /** * Disable access to the site health check admin page. *