-
Notifications
You must be signed in to change notification settings - Fork 815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync Custom admin menus #5757
Sync Custom admin menus #5757
Conversation
wp_set_current_user( Jetpack_Options::get_option( 'master_user' ) ); | ||
/** add_menu_page and add_submenu_page hook into admin_menu. Documented in wp-admin/includes/menu.php */ | ||
do_action( 'admin_menu', '' ); | ||
/** Lets clean up user switch */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aren't these docblock comments with the double leading *
s? also, I thought we preferred //
line comments in code to prevent nesting errors with block comments
We need to add some test to this. Since the menus only appear on the admin side. I think it should only ever sync this option when we are on the admin side and not though things like cron. Since plugins could be adding the actions and filters only on the admin side and so when we sync this value though cron of the front end the value would not be the same as expected. I also think it is reasonable to assume that we should try to update the menus value when a new plugin is installed. |
@@ -176,6 +176,26 @@ public static function get_plugins() { | |||
return apply_filters( 'all_plugins', get_plugins() ); | |||
} | |||
|
|||
/** | |||
* Returns items inserted to wp-admin admin page menu by custom plugins and themes. | |||
* They usually do that bu hooking in admin_menu and calling add_menu_page and add_submenu_page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bu -> by
@samhotchkiss : No, it is not worked on at all since I have not coerced anyone to agree on business decision on this. That is my private expectation that once we enable AT we will get a flood of "I installed a plugin and now cant get to it" questions.
Someone has to say "We want this in Jetpack" and I don't want to force stuff in Jetpack that should not be there |
Alright, @artpi -- I'm going to go ahead and close for now, let's reopen as we get closer on AT and want/need to flesh out this sort of solution |
Why?
One of the problems with Calypso for Jetpack users is that users not only don't have custom functionality from plugins / themes, but they also don't have any link nor indication about this custom functionality.
This can be especially annoying for AT customers.
Solution
API
WPCOM part of this: D3506-code
Calypso side
Calypso side of this needs some thinking. In the above example submenus for
edit.php?post_type=event
need to hook into Menu items created by Custom Post Type event, hence pinging @aduth.CC @enej