本文整理汇总了PHP中FLBuilderModel::is_builder_enabled方法的典型用法代码示例。如果您正苦于以下问题:PHP FLBuilderModel::is_builder_enabled方法的具体用法?PHP FLBuilderModel::is_builder_enabled怎么用?PHP FLBuilderModel::is_builder_enabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FLBuilderModel
的用法示例。
在下文中一共展示了FLBuilderModel::is_builder_enabled方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_content
/**
* Renders the content for a builder layout while in the loop.
* This method should only be called by the_content filter as
* defined in fl-builder.php. To output builder content, use
* the_content function while in a WordPress loop.
*
* @since 1.0
* @param string $content The existing content.
* @return string
*/
public static function render_content($content)
{
$post_id = FLBuilderModel::get_post_id();
$enabled = FLBuilderModel::is_builder_enabled();
$rendering = $post_id === self::$post_rendering;
$ajax = defined('DOING_AJAX');
$in_loop = in_the_loop();
$is_global = in_array($post_id, FLBuilderModel::get_global_posts());
if ($enabled && !$rendering && !$ajax && ($in_loop || $is_global)) {
// Set the post rendering ID.
self::$post_rendering = $post_id;
// Remove the builder's render_content filter so it's not called again.
remove_filter('the_content', 'FLBuilder::render_content');
// Render the content.
ob_start();
echo '<div class="' . self::render_content_classes() . '" data-post-id="' . $post_id . '">';
self::render_nodes();
echo '</div>';
$content = ob_get_clean();
// Reapply the builder's render_content filter.
add_filter('the_content', 'FLBuilder::render_content');
// Do shortcodes here since letting the WP filter run can cause an infinite loop.
$pattern = get_shortcode_regex();
$content = preg_replace_callback("/{$pattern}/s", 'FLBuilder::double_escape_shortcodes', $content);
$content = do_shortcode($content);
// Add srcset attrs to images with the class wp-image-<ID>.
if (function_exists('wp_make_content_images_responsive')) {
$content = wp_make_content_images_responsive($content);
}
// Clear the post rendering ID.
self::$post_rendering = null;
}
return $content;
}
示例2: render
/**
* Renders the HTML for the post edit screen.
*
* @since 1.0
* @return void
*/
public static function render()
{
global $post;
$post_type_obj = get_post_type_object($post->post_type);
$post_type_name = strtolower($post_type_obj->labels->singular_name);
$enabled = FLBuilderModel::is_builder_enabled();
include FL_BUILDER_DIR . 'includes/admin-posts.php';
}
示例3: my_theme_show_page_header
function my_theme_show_page_header()
{
if (class_exists('FLBuilderModel') && FLBuilderModel::is_builder_enabled()) {
$global_settings = FLBuilderModel::get_global_settings();
if (!$global_settings->show_default_heading) {
return false;
}
}
return true;
}
示例4: wma_is_active_page_builder
function wma_is_active_page_builder()
{
//Output
return apply_filters('wmhook_wmamp_' . 'wma_is_active_page_builder_output', wma_is_active_vc() || class_exists('FLBuilderModel') && FLBuilderModel::is_builder_enabled());
}
示例5: tesseract_is_beaver_builder_page
function tesseract_is_beaver_builder_page()
{
return class_exists('FLBuilderModel') && FLBuilderModel::is_builder_enabled();
}
示例6: render_content
/**
* Renders the content for a builder layout while in the loop.
* This method should only be called by the_content filter as
* defined in fl-builder.php. To output builder content, use
* the_content function while in a WordPress loop.
*
* @since 1.0
* @param string $content The existing content.
* @return string
*/
public static function render_content($content)
{
global $wp_filter;
$post_id = FLBuilderModel::get_post_id();
$enabled = FLBuilderModel::is_builder_enabled();
$rendering = $post_id === self::$post_rendering;
$ajax = defined('DOING_AJAX');
$in_loop = in_the_loop();
$is_global = in_array($post_id, FLBuilderModel::get_global_posts());
if ($enabled && !$rendering && !$ajax && ($in_loop || $is_global)) {
// Store this post ID so we know it is currently being rendered
// in case another method or function calls apply filters on the
// content after this method has run which creates an infinite loop.
self::$post_rendering = $post_id;
// Store a reference to the current the_content filters array since
// any modules or widgets that call apply_filters on the_content cause
// the array pointer to move to the end. That makes it so the builder
// content doesn't receive filters after this method runs as it should.
$filters = $wp_filter['the_content'];
// Remove the builder's render_content filter so it's not called again
// by modules or widgets that call apply_filters on the content.
remove_filter('the_content', 'FLBuilder::render_content');
// Render the content.
ob_start();
echo '<div class="fl-builder-content fl-builder-content-' . $post_id . '" data-post-id="' . $post_id . '">';
self::render_rows();
echo '</div>';
$content = ob_get_clean();
// Restore the original the_content filters array.
$wp_filter['the_content'] = $filters;
}
return $content;
}