WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #31641, comment 1


Ignore:
Timestamp:
03/14/2015 07:45:39 AM (6 years ago)
Author:
selnomeria
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31641, comment 1

    initial v1  
    1 I am forced to use this trick in my theme's functions.php, to avoid that problem:
     1
     2As i see, that the first time, the customize.php is loaded, and after that, the website php is loaded separately, then I am forced to use this trick in my theme's functions.php, to avoid that problem(because cookies are read on the next execution of the page):
    23
    34
    45{{{
    5 if (strpos($_SERVER['REQUEST_URI'], '/wp-admin/customize.php?return=') !== false)       {setcookie('my_redirct_indx', 'hii', time()+100000000, '/');}
    6 else                                                                                    {setcookie('my_redirct_indx', 'hii', time()-100000000, '/');}
     6if (strpos($_SERVER['REQUEST_URI'], '/wp-admin/customize.php?return=') !== false)       {setcookie('my_Redirect', 'disable', time()+100000000, '/');}
     7else                                                                                    {setcookie('my_Redirect', 'enable', time()+100000000, '/');}
    78
    89....
    910
    1011//then here is my redirection code
    11 if (empty($_COOKIE['my_redirct_indx'])) {..REDIRECT..}
     12if ('disable' != $_COOKIE['my_Redirect']) {..REDIRECT..}
    1213}}}
    1314