Skip to content

Commit

Permalink
Prevent adding paired browsing scripts when in dev mode but user is n…
Browse files Browse the repository at this point in the history
…ot logged-in
  • Loading branch information
westonruter committed Aug 9, 2021
1 parent 706a39a commit 9e634f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Admin/PairedBrowsing.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function filter_validated_url_status_actions( $actions, WP_Post $post ) {
* Initialize frontend.
*/
public function init_frontend() {
if ( ! amp_is_available() || ! amp_is_dev_mode() ) {
if ( ! amp_is_available() || ! amp_is_dev_mode() || ! is_user_logged_in() ) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/MobileRedirection.php
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ public function add_mobile_version_switcher_link() {
</a>
</div>

<?php if ( amp_is_dev_mode() && ( ! is_customize_preview() || AMP_Theme_Support::READER_MODE_SLUG === AMP_Options_Manager::get_option( Option::THEME_SUPPORT ) ) ) : ?>
<?php if ( amp_is_dev_mode() && is_user_logged_in() && ( ! is_customize_preview() || AMP_Theme_Support::READER_MODE_SLUG === AMP_Options_Manager::get_option( Option::THEME_SUPPORT ) ) ) : ?>
<?php
// Note that the switcher link is disabled in Reader mode because there is a separate toggle to switch versions.
$exports = [
Expand Down

0 comments on commit 9e634f3

Please sign in to comment.