Making WordPress.org

Changeset 10524


Ignore:
Timestamp:
12/16/2020 09:03:41 AM (4 years ago)
Author:
dd32
Message:

Theme Preview: Starter Content: Some themes require the 'fresh_site' option to be truthful before loading starter content.

Location:
sites/trunk/wp-themes.com/public_html/wp-content/mu-plugins/pub
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wp-themes.com/public_html/wp-content/mu-plugins/pub/open-links-in-new-window.php

    r10521 r10524  
    2525            if ( hostname = link.href.match( /^\s*(?:(?:https?:)?\/\/)([^/]+)(\/|$)/ ) ) {
    2626                hostname = hostname[1];
    27             } else if ( "mailto" === link.href.substr( 0, 6 ) {
     27            } else if ( "mailto" === link.href.substr( 0, 6 ) ) {
    2828                hostname = "mailto"; // not whitelisted hostname to fall through.
    2929            }
  • sites/trunk/wp-themes.com/public_html/wp-content/mu-plugins/pub/starter-content.php

    r10523 r10524  
    3030        // Some themes require is_customize_preview() before loading starter content.
    3131        add_action( 'setup_theme', array( $this, 'pre_setup_theme' ), 0 );
     32
     33        // Some themes check to see if the site is fresh through `get_option( 'fresh_site' )` before loading starter content.
     34        add_filter( 'pre_option_fresh_site', '__return_true' );
    3235
    3336        add_action( 'init', array( $this, 'init' ) );
     
    497500
    498501    private function find_data_by_id( $id, $type = 'posts' ) {
     502        if ( empty( $this->starter_content[ $type ] ) ) {
     503            return array();
     504        }
     505
    499506        foreach ( $this->starter_content[ $type ] as $name => $data ) {
    500507            if ( $id === $data['ID'] ) {
Note: See TracChangeset for help on using the changeset viewer.