Skip to content

Commit 40688e0

Browse files
committed
Show Exit mobile version button when mobile redirection is disabled and in reader mode
1 parent 353561f commit 40688e0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/MobileRedirection.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ public function register() {
7878
add_filter( 'get_comments_link', [ $this, 'add_noamp_mobile_query_var' ] ); // For get_comments_link().
7979
add_filter( 'respond_link', [ $this, 'add_noamp_mobile_query_var' ] ); // For comments_popup_link().
8080
}
81+
82+
return;
83+
}
84+
85+
// Show `Exit mobile version` link even mobile redirection is disabled and in Reader mode.
86+
if ( AMP_Theme_Support::READER_MODE_SLUG === AMP_Options_Manager::get_option( Option::THEME_SUPPORT ) && $this->is_mobile_request() ) {
87+
add_action( 'wp_head', [ $this, 'add_mobile_version_switcher_styles' ] );
88+
add_action( 'wp_footer', [ $this, 'add_mobile_version_switcher_link' ] );
8189
}
8290
}
8391

0 commit comments

Comments
 (0)