PluginProbe
Bricksable for Bricks Builder / 1.3.0
Bricksable for Bricks Builder v1.3.0
1.2.9 1.3.0 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.31 1.4.32 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 All 132 releases
bricksable / includes / class-bricksable-helper.php

class-bricksable-helper.php in Bricksable for Bricks Builder 1.3.0, at includes/class-bricksable-helper.php

45 lines 859 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Bricksable\Classes;
3
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit; // Exit if accessed directly.
6 }
7
8 class Bricksable_Helpers {
9
10 /**
11 * Get Bricks Templates
12 *
13 * @param string $exclude_template_id Bricks Template ID.
14 * @return array
15 * @since 1.2.5
16 */
17 public static function get_templates_list( $exclude_template_id = '' ) {
18 $templates = get_posts(
19 array(
20 'post_type' => BRICKS_DB_TEMPLATE_SLUG,
21 'posts_per_page' => -1,
22 'meta_query' => array(
23 array(
24 'key' => BRICKS_DB_TEMPLATE_TYPE,
25 'value' => array( 'section', 'content' ),
26 ),
27 ),
28 'post_status' => 'publish',
29 )
30 );
31
32 $list = array();
33
34 foreach ( $templates as $template ) {
35 if ( $exclude_template_id === $template->ID ) {
36 continue;
37 }
38
39 $list[ $template->ID ] = $template->post_title;
40 }
41
42 return $list;
43 }
44 }
45