File "acf-post-functions.php"

Full path: /home/kosmetik/public_html/wp-content/plugins/advanced-custom-fields/includes/acf-post-functions.php
File size: 638 B
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

<?php

function acf_get_post_templates()
{
    $cache = acf_get_data('post_templates');
    if ($cache !== null) {
        return $cache;
    }
    $post_templates = array();
    $post_templates['page'] = array();
    if (method_exists('WP_Theme', 'get_page_templates')) {
        $post_types = get_post_types();
        foreach ($post_types as $post_type) {
            $templates = wp_get_theme()->get_page_templates(null, $post_type);
            if ($templates) {
                $post_templates[$post_type] = $templates;
            }
        }
    }
    acf_set_data('post_templates', $post_templates);
    return $post_templates;
}