Browse Source

Create a new book menu item

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/132/head
Dac Chartrand 7 years ago
parent
commit
33fe1b5333
  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