[wp-trac] [WordPress Trac] #20872: Customizer: Accessing /wp-admin/customize.php doesn't redirect to wp-login.php when not logged in
WordPress Trac
wp-trac at lists.automattic.com
Thu Jun 7 16:31:31 UTC 2012
#20872: Customizer: Accessing /wp-admin/customize.php doesn't redirect to wp-
login.php when not logged in
--------------------------+-----------------------
Reporter: ocean90 | Owner: nacin
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 3.4
Component: Appearance | Version: 3.4
Severity: normal | Resolution:
Keywords: has-patch |
--------------------------+-----------------------
Comment (by ryan):
Handling a redirect in the preview could be tricky, especially with the
wp_redirect_status override. How about something like:
{{{
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) {
auth_redirect();
} elseif ( defined( 'DOING_AJAX' ) && ! is_user_logged_in() ) {
wp_die( -1 );
} elseif ( ! is_user_logged_in() ) {
echo 'WP_CUSTOMIZER_NOT_LOGGED_IN'';
die;
}
}}}
Check for WP_CUSTOMIZER_NOT_LOGGED_IN in api.PreviewFrame. If found output
a please log in message and a link to wp-login.php with redirect_to set to
the customizer.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20872#comment:15>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list