Making WordPress.org

Changeset 10522


Ignore:
Timestamp:
12/16/2020 08:00:55 AM (4 years ago)
Author:
dd32
Message:

Theme Previewer: Starter Content: Some themes don't provide the 'posts' content key, don't assume it exists.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wp-themes.com/public_html/wp-content/mu-plugins/pub/starter-content.php

    r10496 r10522  
    1313    private $starter_content = array();
    1414
    15     private $mapping = array();
     15    private $mapping = array(
     16        'nav_menus' => array(),
     17        'posts'     => array(),
     18    );
    1619
    1720    public function __construct() {
     
    110113
    111114    public function cache_posts() {
     115        if ( empty( $this->starter_content['posts'] ) ) {
     116            return;
     117        }
     118
    112119        foreach ( $this->starter_content['posts'] as $post ) {
    113120
Note: See TracChangeset for help on using the changeset viewer.