-
Notifications
You must be signed in to change notification settings - Fork 802
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
AMP: Jetpack now always hides the admin bar #15353
Comments
A quick workaround to restore the admin bar in AMP pages is via this plugin code: add_filter( 'show_admin_bar', 'is_user_logged_in', 11 ); In plugin form: https://gist.github.com/westonruter/d168c290d6c01c107da960d48fa3dad3 But I'm not clear specifically why the admin bar was removed in the first place, other than it being an easy way to prevent AMP-invalid scripts/styles from being added to the page. |
Probably the same bug: https://wordpress.org/support/topic/amp-1-5-2-completely-breaks-site/ Jetpack and Amp have this weird interaction, but a third plugin is calling See the traceback in the support topic above: https://wordpress.org/support/topic/amp-1-5-2-completely-breaks-site/page/2/#post-12643000 |
Fixes #15353 The admin bar can be used in AMP views since AMP 1.3.1, thanks to AMP Dev mode.
FYI we've already had a publisher reach out to both Happiness and Newspack team about this as they were confused where the post edit link had gone when viewing articles. |
Another report on the AMP plugin forum: https://wordpress.org/support/topic/amp-endpoint-error/ |
Here's a better workaround that also prevents the // Unhook the show_admin_bar filter added in Jetpack_AMP_Support::init().
add_action(
'init',
function () {
remove_filter( 'show_admin_bar', [ 'Jetpack_AMP_Support', 'show_admin_bar' ] );
},
2 // Because Jetpack_AMP_Support::init() happens at priority 1.
); |
* AMP: allow the display of the admin bar in AMP views. Fixes #15353 The admin bar can be used in AMP views since AMP 1.3.1, thanks to AMP Dev mode. * Likes: do not load Likes in admin bar on AMP views
This was introduced in #14840.
-- #14840 (comment)
The text was updated successfully, but these errors were encountered: