PluginProbe ʕ •ᴥ•ʔ
Secure Custom Fields / 6.4.0-beta2
Secure Custom Fields v6.4.0-beta2
6.9.5 6.9.4 6.9.3 6.9.2 6.9.1 6.9.0 6.8.9 6.8.7 6.8.8 6.8.6 6.8.4 6.8.5 trunk 6.4.0-beta1 6.4.0-beta2 6.4.1 6.4.1-beta3 6.4.1-beta4 6.4.1-beta5 6.4.1-beta6 6.4.1-beta7 6.4.2 6.5.0 6.5.1 6.5.2 6.5.3 6.5.4 6.5.5 6.5.6 6.5.7 6.6.0 6.7.0 6.7.1 6.8.0 6.8.1 6.8.2 6.8.3
secure-custom-fields / includes / acf-post-functions.php
secure-custom-fields / includes Last commit date
Blocks 1 year ago admin 1 year ago ajax 1 year ago api 1 year ago fields 1 year ago forms 1 year ago legacy 1 year ago locations 1 year ago post-types 1 year ago rest-api 1 year ago walkers 1 year ago acf-bidirectional-functions.php 1 year ago acf-field-functions.php 1 year ago acf-field-group-functions.php 1 year ago acf-form-functions.php 1 year ago acf-helper-functions.php 1 year ago acf-hook-functions.php 1 year ago acf-input-functions.php 1 year ago acf-internal-post-type-functions.php 1 year ago acf-meta-functions.php 1 year ago acf-post-functions.php 1 year ago acf-post-type-functions.php 1 year ago acf-taxonomy-functions.php 1 year ago acf-user-functions.php 1 year ago acf-utility-functions.php 1 year ago acf-value-functions.php 1 year ago acf-wp-functions.php 1 year ago assets.php 1 year ago class-acf-data.php 1 year ago class-acf-internal-post-type.php 1 year ago class-acf-site-health.php 1 year ago compatibility.php 1 year ago deprecated.php 1 year ago fields.php 1 year ago index.php 1 year ago l10n.php 1 year ago local-fields.php 1 year ago local-json.php 1 year ago local-meta.php 1 year ago locations.php 1 year ago loop.php 1 year ago media.php 1 year ago rest-api.php 1 year ago revisions.php 1 year ago third-party.php 1 year ago upgrades.php 1 year ago validation.php 1 year ago wpml.php 1 year ago
acf-post-functions.php
41 lines
1 <?php
2
3 /**
4 * Returns available templates for each post type.
5 *
6 * @date 29/8/17
7 * @since 5.6.2
8 *
9 * @param void
10 * @return array
11 */
12 function acf_get_post_templates() {
13
14 // Check store.
15 $cache = acf_get_data( 'post_templates' );
16 if ( $cache !== null ) {
17 return $cache;
18 }
19
20 // Initialize templates with default placeholder for pages.
21 $post_templates = array();
22 $post_templates['page'] = array();
23
24 // Loop over post types and append their templates.
25 if ( method_exists( 'WP_Theme', 'get_page_templates' ) ) {
26 $post_types = get_post_types();
27 foreach ( $post_types as $post_type ) {
28 $templates = wp_get_theme()->get_page_templates( null, $post_type );
29 if ( $templates ) {
30 $post_templates[ $post_type ] = $templates;
31 }
32 }
33 }
34
35 // Update store.
36 acf_set_data( 'post_templates', $post_templates );
37
38 // Return templates.
39 return $post_templates;
40 }
41