/** * Renders the markup for the template selector. * * @since 1.0 * @return array */ public static function render_template_selector() { if (file_exists(FL_BUILDER_DIR . 'includes/template-selector.php')) { $enabled_templates = FLBuilderModel::get_enabled_templates(); $user_templates = FLBuilderModel::get_user_templates(); $templates = FLBuilderModel::get_template_selector_data(); ob_start(); include FL_BUILDER_DIR . 'includes/template-selector.php'; $html = ob_get_clean(); return array('html' => $html); } }
/** * Renders the markup for the template selector. * * @since 1.0 * @return void */ public static function render_template_selector() { if (file_exists(FL_BUILDER_DIR . 'includes/template-selector.php')) { $enabled_templates = FLBuilderModel::get_enabled_templates(); $user_templates = FLBuilderModel::get_user_templates(); $templates = FLBuilderModel::get_template_selector_data(); include FL_BUILDER_DIR . 'includes/template-selector.php'; if (defined('DOING_AJAX')) { die; } } }
/** * Returns data for overriding core templates in * the template selector. * * @since 1.5.7 * @param string $type The type of user template to return. * @return array|bool */ public static function get_selector_data($type = 'layout') { $site_id = self::get_source_site_id(); if ($site_id && $type) { if (is_multisite()) { switch_to_blog($site_id); } $data = FLBuilderModel::get_user_templates($type); if (is_multisite()) { restore_current_blog(); } return count($data['templates']) > 0 ? $data : false; } return false; }