Making WordPress.org

Changeset 4689


Ignore:
Timestamp:
01/15/2017 05:21:46 PM (8 years ago)
Author:
ocean90
Message:

Breathe: Use path of the current site for the path value of the welcome box cookie.

When hiding the welcome box on a sub page like the handbook, the path has been set to /core/handbook/ which means you had to hide it again on /core/.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/functions.php

    r4662 r4689  
    5757
    5858function inline_scripts() {
     59    $current_site = get_site();
    5960    ?>
    6061    <script type="text/javascript">
     
    6263        if ( el ) {
    6364            el.addEventListener( 'click', function( e ) {
    64                 document.cookie = el.dataset.cookie + '=' + el.dataset.hash + '; expires=Fri, 31 Dec 9999 23:59:59 GMT';
     65                document.cookie = el.dataset.cookie + '=' + el.dataset.hash +
     66                    '; expires=Fri, 31 Dec 9999 23:59:59 GMT' +
     67                    '; domain=<?php echo esc_js( $current_site->domain ); ?>' +
     68                    '; path=<?php echo esc_js( $current_site->path ); ?>';
    6569                jQuery( '.make-welcome' ).slideUp();
    6670            } );
Note: See TracChangeset for help on using the changeset viewer.