Skip to content

Commit

Permalink
Disable admin page on WP.com
Browse files Browse the repository at this point in the history
  • Loading branch information
mjangda committed Jul 20, 2017
1 parent c7772ab commit 2c059fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions includes/admin/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ function amp_add_options_menu() {
return;
}

$show_options_menu = apply_filters( 'amp_options_menu_is_enabled', true );
if ( true !== $show_options_menu ) {
return;
}

$amp_options = new AMP_Options_Menu();
$amp_options->init();
}
Expand Down
3 changes: 3 additions & 0 deletions wpcom-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// WPCOM-specific things
add_action( 'pre_amp_render_post', 'jetpack_amp_disable_the_content_filters' );

// Disable admin menu
remove_action( 'amp_options_menu_is_enabled', '__return_false' );

function jetpack_amp_disable_the_content_filters( $post_id ) {
// Shortcode overrides.
require_once( dirname( __FILE__ ) . '/wpcom/shortcodes.php' );
Expand Down

3 comments on commit 2c059fc

@GaryJones
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this disabled?

@westonruter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GaryJones Since this change was part of a PR for analytics (#714), I'm guessing the reason to hide was to prevent analytics from being supplied on WordPress.com. So it seems that this needs to be removed in favor of WordPress.com specifically removing the menu for analytics. /cc @mjangda

@westonruter
Copy link
Member

@westonruter westonruter commented on 2c059fc Dec 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.