Browse Source

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
pull/133/head
Dac Chartrand 7 years ago committed by Ned Zimmerman
parent
commit
1fc37da302
  1. 6
      inc/helpers/namespace.php

6
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(
'<li><a href="%1$s">%2$s</a></li>',
network_home_url( '/wp-signup.php' ),
__( 'Create a New Book', 'pressbooks-aldine' )
);
}
$items .= sprintf(
'<li><a href="%1$s">%2$s</a></li>',

Loading…
Cancel
Save