From 1fc37da3028c3076b155da8599b70b269c64799e Mon Sep 17 00:00:00 2001 From: Dac Chartrand Date: Wed, 25 Jul 2018 13:05:45 -0400 Subject: [PATCH] Create a new book menu item (#132) For users created with SSO that have no books. blog = Logged in users may register new sites all = Both sites and user accounts can be registered --- inc/helpers/namespace.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/inc/helpers/namespace.php b/inc/helpers/namespace.php index 547458e..040cf2f 100644 --- a/inc/helpers/namespace.php +++ b/inc/helpers/namespace.php @@ -205,6 +205,12 @@ function get_default_menu( $items = '' ) { get_blogaddress_by_id( $user_info->primary_blog ) . 'wp-admin/index.php?page=pb_catalog', __( 'My Books', 'pressbooks-aldine' ) ); + } elseif ( in_array( get_site_option( 'registration' ), [ 'blog', 'all' ], true ) ) { + $items .= sprintf( + '
  • %2$s
  • ', + network_home_url( '/wp-signup.php' ), + __( 'Create a New Book', 'pressbooks-aldine' ) + ); } $items .= sprintf( '
  • %2$s
  • ',