Example #1
0
function x_demo_content_portfolio_page()
{
    $page = x_get_page_by_title('Demo: Portfolio');
    if ($page != NULL) {
        return $page['ID'];
    } else {
        return false;
    }
}
Example #2
0
}
// Require Data Files
// =============================================================================
require_once 'data-pages.php';
require_once 'data-posts.php';
require_once 'data-portfolio-items.php';
// Process Data Files
// =============================================================================
if (x_demo_content_stage_not_completed('process-data-files')) {
    //
    // Form array of all entries to be added and process them if it isn't empty.
    //
    $entries = array_merge($pages, $posts, $portfolio_items);
    if (!empty($entries)) {
        foreach ($entries as $key => $entry) {
            if ($entry['post_type'] == 'page' && x_get_page_by_title($entry['post_title'])) {
                continue;
            } elseif ($entry['post_type'] == 'post' && x_get_post_by_title($entry['post_title'])) {
                continue;
            } elseif ($entry['post_type'] == 'x-portfolio' && x_get_portfolio_item_by_title($entry['post_title'])) {
                continue;
            }
            //
            // If 'x_meta' exists in array, store it in a variable for later use then
            // unset it before passing into wp_insert_post().
            //
            if (array_key_exists('x_info', $entry)) {
                $x = $entry['x_info'];
                unset($entry['x_info']);
            }
            //