Making WordPress.org


Ignore:
Timestamp:
07/07/2016 05:03:29 AM (9 years ago)
Author:
pento
Message:

Breathe: Make the Welcome message dismissable.

It will re-appear if the content is changed, so folks will see updates.

Fixes #1804.

File:
1 edited

Legend:

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

    r3621 r3630  
    77
    88    // Cacheing hack
    9     wp_enqueue_style( 'wporg-breathe', get_stylesheet_uri(), array( 'p2-breathe' ), '20160704a' );
     9    wp_enqueue_style( 'wporg-breathe', get_stylesheet_uri(), array( 'p2-breathe' ), '20160707' );
    1010}
    1111add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\styles', 11 );
     12
     13function inline_scripts() {
     14    ?>
     15    <script type="text/javascript">
     16        var el = document.getElementById( 'make-welcome-hide' );
     17        if ( el ) {
     18            el.addEventListener( 'click', function( e ) {
     19                document.cookie = el.dataset.cookie + '=' + el.dataset.hash + '; expires=Fri, 31 Dec 9999 23:59:59 GMT';
     20                var wrapper = document.getElementsByClassName( 'make-welcome-wrapper' ).item( 0 );
     21                if ( wrapper ) {
     22                    jQuery( wrapper ).slideUp();
     23                }
     24            } );
     25        }
     26    </script>
     27    <?php
     28}
     29add_action( 'wp_footer', __NAMESPACE__ . '\inline_scripts' );
Note: See TracChangeset for help on using the changeset viewer.