[wp-trac] [WordPress Trac] #30905: Theme Preview - Not working preview when front page setting

WordPress Trac noreply at wordpress.org
Mon Jan 5 09:24:16 UTC 2015


#30905: Theme Preview - Not working preview when front page setting
--------------------------+-----------------------------
 Reporter:  gqevu6bsiz    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Canonical     |    Version:  4.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 I'm sorry if there are already ticket for same problem.
 Preview is not working well (not live preview/customizer).
 Is this a bug? or specification?

 Steps to reproduce:

 1. Settings to '''Front page'''(anyting page) and select the '''A static
 page''' of Front page displays of Reading of Settings.
 2. Access the Themes screen of Appearance with Editor(Editor already have
 capability to switch_themes).
 3. Click to the '''preview button''' of per not activated themes.

 Tested in: Google Chrome 39.0.2171.95 m

 And I think this happen is affect to following.


 {{{
 wp-includes/canonical.php line 48 - 54
 }}}

 Theme preview is not have post ID. But that it become to have post ID
 after the Front page settings.

 And I have tentatively avoiding the problem in this way.


 {{{
 function test_redirect_canonical( $redirect_url , $requested_url ) {
     if( get_query_var( 'preview' ) && !empty( $_GET['template'] ) &&
 !empty( $_GET['stylesheet'] ) && !empty( $_GET['preview_iframe'] ) ) {
         if( current_user_can( 'switch_themes' ) ) {
             $redirect_url = false;
         }
     }
     return $redirect_url;
 }
 add_filter( 'redirect_canonical' , 'test_redirect_canonical' , 10 , 2 );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30905>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list