PluginProbe ʕ •ᴥ•ʔ
Secure Custom Fields / 6.9.1
Secure Custom Fields v6.9.1
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 week ago Datastore 1 month ago Meta 1 year ago abilities 1 week ago admin 1 week ago ajax 1 month ago api 2 days ago fields 2 days ago forms 2 days ago legacy 1 year ago locations 1 year ago post-types 2 months ago rest-api 1 week ago walkers 1 year ago acf-bidirectional-functions.php 1 year ago acf-field-functions.php 2 months ago acf-field-group-functions.php 7 months 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 7 months ago acf-internal-post-type-functions.php 7 months ago acf-meta-functions.php 3 weeks 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 week ago acf-utility-functions.php 1 year ago acf-value-functions.php 1 year ago acf-wp-functions.php 2 days ago assets.php 1 week ago blocks-auto-inline-editing.php 2 months ago blocks.php 3 weeks ago class-acf-data.php 10 months ago class-acf-internal-post-type.php 1 week ago class-acf-options-page.php 1 year ago class-acf-site-health.php 3 months ago class-scf-json-schema-validator.php 6 months ago class-scf-schema-builder.php 2 months ago compatibility.php 1 year ago datastore.php 1 month ago deprecated.php 1 year ago fields.php 10 months ago index.php 1 year ago l10n.php 1 year ago local-fields.php 1 year ago local-json.php 1 month ago local-meta.php 1 year ago locations.php 1 year ago loop.php 10 months ago media.php 1 year ago rest-api.php 10 months ago revisions.php 1 month ago scf-ui-options-page-functions.php 1 year ago third-party.php 7 months ago upgrades.php 3 weeks ago validation.php 10 months ago wpml.php 1 year ago
acf-post-functions.php
40 lines
1 <?php
2
3 /**
4 * Returns available templates for each post type.
5 *
6 * @date 29/8/17
7 * @since ACF 5.6.2
8 *
9 * @return array
10 */
11 function acf_get_post_templates() {
12
13 // Check store.
14 $cache = acf_get_data( 'post_templates' );
15 if ( $cache !== null ) {
16 return $cache;
17 }
18
19 // Initialize templates with default placeholder for pages.
20 $post_templates = array();
21 $post_templates['page'] = array();
22
23 // Loop over post types and append their templates.
24 if ( method_exists( 'WP_Theme', 'get_page_templates' ) ) {
25 $post_types = get_post_types();
26 foreach ( $post_types as $post_type ) {
27 $templates = wp_get_theme()->get_page_templates( null, $post_type );
28 if ( $templates ) {
29 $post_templates[ $post_type ] = $templates;
30 }
31 }
32 }
33
34 // Update store.
35 acf_set_data( 'post_templates', $post_templates );
36
37 // Return templates.
38 return $post_templates;
39 }
40