BRICKS_DB_TEMPLATE_SLUG, 'posts_per_page' => -1, 'meta_query' => array( array( 'key' => BRICKS_DB_TEMPLATE_TYPE, 'value' => array( 'section', 'content' ), ), ), 'post_status' => 'publish', ) ); $list = array(); foreach ( $templates as $template ) { if ( $exclude_template_id === $template->ID ) { continue; } $list[ $template->ID ] = $template->post_title; } return $list; } }