Changeset 3672 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/header.php
- Timestamp:
- 07/12/2016 05:50:17 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/header.php
r3671 r3672 1 1 <?php 2 $welcome = get_page_by_path( 'welcome' ); 3 $cookie = 'welcome-' . get_current_blog_id(); 4 $hash = isset( $_COOKIE[ $cookie ] ) ? $_COOKIE[ $cookie ] : ''; 5 $content_hash = $welcome ? md5( $welcome->post_content ) : ''; 2 6 3 7 $GLOBALS['pagetitle'] = get_bloginfo( 'name', 'display' ); … … 21 25 22 26 <?php 23 $welcome = get_page_by_path( 'welcome' );24 27 25 $cookie = 'welcome-' . get_current_blog_id(); 26 27 $hash = isset( $_COOKIE[ $cookie ] ) ? $_COOKIE[ $cookie ] : ''; 28 29 $content_hash = $welcome ? md5( $welcome->post_content ) : ''; 30 31 if ( $welcome && ( empty( $hash ) || $content_hash !== $hash ) ) { 28 if ( $welcome && ( empty( $hash ) || $content_hash !== $hash ) ) : 32 29 $columns = preg_split( '|<hr\s*/?>|', $welcome->post_content ); 33 30 if ( count( $columns ) === 2 ) { 34 $welcome->post_content = "<div class=' first-column'>\n\n{$columns[0]}</div><div class='second-column'>\n\n{$columns[1]}</div>";31 $welcome->post_content = "<div class='content-area'>\n\n{$columns[0]}</div><div class='widget-area'>\n\n{$columns[1]}</div>"; 35 32 } 36 33 setup_postdata( $welcome ); 37 34 ?> 38 <div class="make-welcome-wrapper"> 39 <span id="make-welcome-hide" class="dashicons dashicons-no" data-hash="<?php echo $content_hash; ?>" data-cookie="<?php echo $cookie; ?>" title="<?php _e( 'Hide this message', 'p2-breathe' ); ?>"></span> 40 <?php 41 edit_post_link( __( 'Edit', 'o2' ), '<p class="make-welcome-edit">', '</p>', $welcome->ID ); 42 ?> 43 <div class="make-welcome"> 44 <?php 45 the_content(); 46 ?> 35 <div class="make-welcome"> 36 <div class="entry-meta"> 37 <?php edit_post_link( __( 'Edit', 'o2' ) ); ?> 38 <button type="button" id="make-welcome-hide" class="toggle dashicons dashicons-no" data-hash="<?php echo $content_hash; ?>" data-cookie="<?php echo $cookie; ?>" title="<?php esc_attr_e( 'Hide this message', 'p2-breathe' ); ?>"></button> 39 </div> 40 <div class="entry-content clear"> 41 <?php the_content(); ?> 47 42 </div> 48 43 </div> 49 44 <?php 50 45 wp_reset_postdata(); 51 } 46 endif; 52 47 ?> 53 48
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)