当前位置: 首页>>代码示例>>PHP>>正文


PHP siteorigin_panels_render函数代码示例

本文整理汇总了PHP中siteorigin_panels_render函数的典型用法代码示例。如果您正苦于以下问题:PHP siteorigin_panels_render函数的具体用法?PHP siteorigin_panels_render怎么用?PHP siteorigin_panels_render使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了siteorigin_panels_render函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: siteorigin_panels_content_save_pre_get

/**
 * Ajax handler to get the HTML representation of the request.
 */
function siteorigin_panels_content_save_pre_get()
{
    if (empty($_POST['grids']) || empty($_POST['grid_cells']) || empty($_POST['widgets']) || empty($_POST['panel_order'])) {
        exit;
    }
    if (empty($_POST['_signature'])) {
        exit;
    }
    $sig = $_POST['_signature'];
    $data = array('grids' => $_POST['grids'], 'grid_cells' => $_POST['grid_cells'], 'widgets' => array_map('stripslashes_deep', $_POST['widgets']), 'panel_order' => $_POST['panel_order'], 'action' => $_POST['action'], 'post_id' => $_POST['post_id']);
    // Use the signature to secure the request.
    if ($sig != sha1(NONCE_SALT . serialize($data))) {
        exit;
    }
    // This can cause a fatal error, so handle in a separate request.
    $panels_data = siteorigin_panels_get_panels_data_from_post($_POST);
    $content = '';
    if (!empty($panels_data['widgets'])) {
        // Save the panels data into post_content for SEO and search plugins
        $content = siteorigin_panels_render($_POST['post_id'], false, $panels_data);
        $content = preg_replace(array('@<head[^>]*?>.*?</head>@siu', '@<style[^>]*?>.*?</style>@siu', '@<script[^>]*?.*?</script>@siu', '@<object[^>]*?.*?</object>@siu', '@<embed[^>]*?.*?</embed>@siu', '@<applet[^>]*?.*?</applet>@siu', '@<noframes[^>]*?.*?</noframes>@siu', '@<noscript[^>]*?.*?</noscript>@siu', '@<noembed[^>]*?.*?</noembed>@siu'), array(' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '), $content);
        $content = strip_tags($content, '<img><h1><h2><h3><h4><h5><h6><a><p><em><strong>');
        $content = explode("\n", $content);
        $content = array_map('trim', $content);
        $content = implode("\n", $content);
        $content = preg_replace("/[\n]{2,}/", "\n\n", $content);
        $content = trim($content);
    }
    echo $content;
    exit;
}
开发者ID:alextkd,项目名称:fdsmc,代码行数:34,代码来源:copy.php

示例2: process_content

 /**
  * Process the content.
  *
  * @param $content
  * @param $frame
  *
  * @return string
  */
 function process_content($content, $frame)
 {
     if (function_exists('siteorigin_panels_render')) {
         $content_builder_id = substr(md5(json_encode($content)), 0, 8);
         echo siteorigin_panels_render('w' . $content_builder_id, true, $content);
     } else {
         echo __('This widget requires Page Builder.', 'so-widgets-bundle');
     }
 }
开发者ID:spielhoelle,项目名称:amnesty,代码行数:17,代码来源:layout-slider.php

示例3: siteorigin_panels_revisions_field

/**
 * Display the Page Builder content for the revision.
 *
 * @param $value
 * @param $field
 * @param $revision
 * @return string
 */
function siteorigin_panels_revisions_field($value, $field, $revision)
{
    $parent_id = wp_is_post_revision($revision->ID);
    $panels_data = get_metadata('post', $revision->ID, 'panels_data', true);
    if (empty($panels_data)) {
        return '';
    }
    return siteorigin_panels_render($parent_id, false, $panels_data);
}
开发者ID:Nirajjcu,项目名称:minime3d,代码行数:17,代码来源:revisions.php

示例4: put_page_builder_stuff_in_content

 /**
  * Puts page builder stuff in post content for unsupported post types
  *
  * @since 3.0.0
  */
 private function put_page_builder_stuff_in_content()
 {
     return;
     global $ppb_panels_inline_css;
     foreach ($this->unsupported_page_builder_posts as $id) {
         $panel_content = siteorigin_panels_render($id);
         $panel_style = '<style>' . $ppb_panels_inline_css . '</style>';
         $updated_post = array('ID' => $id, 'post_content' => $panel_style . $panel_content);
         wp_update_post($updated_post);
         $notices = array();
         $notices['settings-updated'] = array('type' => 'update-nag', 'message' => __("Now we only support page post types, however for your convenience we have put all your existing page builder using posts layout in the content.", 'woothemes'));
         update_option('pootle_page_admin_notices', $notices);
     }
 }
开发者ID:shramee,项目名称:ppb-base,代码行数:19,代码来源:class-pootle-page-compatibility.php

示例5: siteorigin_panels_ajax_builder_content

/**
 * Get builder content based on the submitted panels_data.
 */
function siteorigin_panels_ajax_builder_content()
{
    header('content-type: text/html');
    if (!current_user_can('edit_post', $_POST['post_id'])) {
        wp_die();
    }
    if (empty($_POST['post_id']) || empty($_POST['panels_data'])) {
        echo '';
        wp_die();
    }
    // echo the content
    echo siteorigin_panels_render(intval($_POST['post_id']), false, json_decode(wp_unslash($_POST['panels_data']), true));
    wp_die();
}
开发者ID:ninefinecode,项目名称:ninefinecode,代码行数:17,代码来源:admin-actions.php

示例6: siteorigin_panels_ajax_builder_content

/**
 * Get builder content based on the submitted panels_data.
 */
function siteorigin_panels_ajax_builder_content()
{
    header('content-type: text/html');
    $request = filter_input_array(INPUT_POST, array('post_id' => FILTER_VALIDATE_INT, 'panels_data' => FILTER_DEFAULT));
    if (!current_user_can('edit_post', $request['post_id'])) {
        wp_die();
    }
    if (empty($request['post_id']) || empty($request['panels_data'])) {
        echo '';
        wp_die();
    }
    // echo the content
    echo siteorigin_panels_render($request['post_id'], false, json_decode($request['panels_data'], true));
    wp_die();
}
开发者ID:brittbec13,项目名称:citizenmodern,代码行数:18,代码来源:admin-actions.php

示例7: siteorigin_panels_ajax_builder_content

/**
 * Get builder content based on the submitted panels_data.
 */
function siteorigin_panels_ajax_builder_content()
{
    header('content-type: text/html');
    if (!current_user_can('edit_post', $_POST['post_id'])) {
        wp_die();
    }
    if (empty($_POST['post_id']) || empty($_POST['panels_data'])) {
        echo '';
        wp_die();
    }
    // echo the content
    $panels_data = json_decode(wp_unslash($_POST['panels_data']), true);
    $panels_data['widgets'] = siteorigin_panels_process_raw_widgets($panels_data['widgets']);
    $panels_data = siteorigin_panels_styles_sanitize_all($panels_data);
    echo siteorigin_panels_render(intval($_POST['post_id']), false, $panels_data);
    wp_die();
}
开发者ID:noc107,项目名称:Web-Capreso,代码行数:20,代码来源:admin-actions.php

示例8: widget

 function widget($args, $instance)
 {
     if (empty($instance['panels_data'])) {
         return;
     }
     if (is_string($instance['panels_data'])) {
         $instance['panels_data'] = json_decode($instance['panels_data'], true);
     }
     if (empty($instance['panels_data']['widgets'])) {
         return;
     }
     if (empty($instance['builder_id'])) {
         $instance['builder_id'] = uniqid();
     }
     echo $args['before_widget'];
     echo siteorigin_panels_render('w' . $instance['builder_id'], true, $instance['panels_data']);
     echo $args['after_widget'];
 }
开发者ID:MiquelAdell,项目名称:miqueladell,代码行数:18,代码来源:basic.php

示例9: siteorigin_panels_filter_content

/**
 * Filter the content of the panel, adding all the widgets.
 *
 * @param $content
 * @return string
 *
 * @filter the_content
 */
function siteorigin_panels_filter_content($content)
{
    global $post;
    if (empty($post)) {
        return $content;
    }
    if (!apply_filters('siteorigin_panels_filter_content_enabled', true)) {
        return $content;
    }
    // Check if this post has panels_data
    $panels_data = get_post_meta($post->ID, 'panels_data', true);
    if (!empty($panels_data)) {
        $panel_content = siteorigin_panels_render($post->ID);
        if (!empty($panel_content)) {
            $content = $panel_content;
        }
    }
    return $content;
}
开发者ID:popshuvitdude,项目名称:orchard,代码行数:27,代码来源:siteorigin-panels.php

示例10: siteorigin_panels_filter_content

/**
 * Filter the content of the panel, adding all the widgets.
 *
 * @param $content
 * @return string
 *
 * @filter the_content
 */
function siteorigin_panels_filter_content($content)
{
    global $post;
    if (empty($post)) {
        return $content;
    }
    if (!apply_filters('siteorigin_panels_filter_content_enabled', true)) {
        return $content;
    }
    if (in_array($post->post_type, siteorigin_panels_setting('post-types'))) {
        $panel_content = siteorigin_panels_render($post->ID);
        if (!empty($panel_content)) {
            $content = $panel_content;
        }
    }
    return $content;
}
开发者ID:brittbec13,项目名称:citizenmodern,代码行数:25,代码来源:siteorigin-panels.php

示例11: bloginfo

bloginfo('pingback_url');
?>
">
	<?php 
wp_head();
?>
</head>

<body <?php 
body_class();
?>
>
	<div id="content" class="site-content">
		<div class="entry-content">
			<?php 
if (!empty($_POST['live_editor_panels_data'])) {
    $data = json_decode(wp_unslash($_POST['live_editor_panels_data']), true);
    if (!empty($data['widgets']) && (!class_exists('SiteOrigin_Widget_Field_Class_Loader') || method_exists('SiteOrigin_Widget_Field_Class_Loader', 'extend'))) {
        $data['widgets'] = siteorigin_panels_process_raw_widgets($data['widgets']);
    }
    echo siteorigin_panels_render('l' . md5(serialize($data)), true, $data);
}
?>
		</div><!-- .entry-content -->
	</div>
	<?php 
wp_footer();
?>
</body>
</html>
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:30,代码来源:live-editor-preview.php

示例12: render_home

 /**
  * Render home page
  *
  * @since    1.0.0
  */
 public function render_home()
 {
     if (function_exists('siteorigin_panels_render')) {
         echo siteorigin_panels_render('home');
     } else {
         genesis_do_loop();
     }
 }
开发者ID:black-studio,项目名称:black-studio-homepage-builder,代码行数:13,代码来源:class-black-studio-homepage-builder.php

示例13: siteorigin_panels_filter_content

/**
 * Filter the content of the panel, adding all the widgets.
 *
 * @param $content
 * @return string
 *
 * @filter the_content
 */
function siteorigin_panels_filter_content($content, $type = '')
{
    global $post;
    if ($type != 'bunyad_main_content') {
        return $content;
    }
    if (empty($post)) {
        return $content;
    }
    if (in_array($post->post_type, siteorigin_panels_setting('post-types'))) {
        $panel_content = siteorigin_panels_render($post->ID);
        if (!empty($panel_content)) {
            $content = $panel_content;
        }
    }
    return $content;
}
开发者ID:silverbux,项目名称:smartmag-magazine-wordpress,代码行数:25,代码来源:bunyad-siteorigin-panels.php

示例14: array

				</div>
				<div class="blur-header-lines"></div>
				<?php 
    $id = $page->ID;
} else {
    ?>
				<h3 class="alert-danger">Please create a post called "Foundation"</h3>
				<?php 
}
?>
	</section>

	<section class="wrapper wrapper-child">
		<div class="container">
			<?php 
$args = array('post_parent' => $id, 'post_type' => 'page', 'post_status' => 'publish');
$children = get_posts($args);
foreach ($children as $child) {
    if (siteorigin_panels_render($child->ID) != null) {
        echo siteorigin_panels_render($child->ID);
    } else {
        echo $child->post_content;
    }
}
?>
		</div>
	</section>

</div>
<?php 
get_footer();
开发者ID:sefrijn,项目名称:metabolic,代码行数:31,代码来源:page-template-about-us.php

示例15: widget

        /**
         * Front-end display of widget.
         *
         * @see WP_Widget::widget()
         *
         * @param array $args
         * @param array $instance
         */
        public function widget($args, $instance)
        {
            $instance['widget_title'] = empty($instance['widget_title']) ? '' : $args['before_title'] . apply_filters('widget_title', $instance['widget_title'], $instance) . $args['after_title'];
            $items = isset($instance['items']) ? array_values($instance['items']) : array();
            // Prepare items data.
            foreach ($items as $key => $item) {
                $items[$key]['builder_id'] = empty($item['builder_id']) ? uniqid() : $item['builder_id'];
                $items[$key]['tab_id'] = $this->format_id_from_name($item['title']);
            }
            // Should we use the older Twitter Bootstrap tabs layout?
            $older_bootstrap_layout = apply_filters('pt-tabs/use_older_bootstrap_layout', false);
            echo $args['before_widget'];
            ?>
			<div class="pt-tabs">
				<?php 
            if (!empty($instance['widget_title'])) {
                ?>
					<?php 
                echo wp_kses_post($instance['widget_title']);
                ?>
				<?php 
            }
            ?>

				<?php 
            if (!empty($items)) {
                $items[0]['active'] = true;
                // First tab should be active.
                ?>
					<ul class="pt-tabs__navigation  nav  nav-tabs" role="tablist">
						<?php 
                foreach ($items as $item) {
                    ?>
							<li class="nav-item<?php 
                    echo !empty($item['active']) && $older_bootstrap_layout ? '  active' : '';
                    ?>
">
								<a class="nav-link<?php 
                    echo !empty($item['active']) && !$older_bootstrap_layout ? '  active' : '';
                    ?>
" data-toggle="tab" href="#tab-<?php 
                    echo esc_attr($item['tab_id']);
                    ?>
" role="tab"><?php 
                    echo wp_kses_post($item['title']);
                    ?>
</a>
							</li>
						<?php 
                }
                ?>
					</ul>

					<div class="pt-tabs__content  tab-content">
					<?php 
                foreach ($items as $item) {
                    ?>
						<div class="tab-pane  fade<?php 
                    echo empty($item['active']) ? '' : '  in  active';
                    ?>
" id="tab-<?php 
                    echo esc_attr($item['tab_id']);
                    ?>
" role="tabpanel">
							<?php 
                    echo siteorigin_panels_render('w' . $item['builder_id'], true, $item['panels_data']);
                    ?>
						</div>
					<?php 
                }
                ?>
					</div>
				<?php 
            }
            ?>
			</div>

			<?php 
            echo $args['after_widget'];
        }
开发者ID:proteusthemes,项目名称:tabs-widget-for-page-builder,代码行数:88,代码来源:class-tabs-widget.php


注:本文中的siteorigin_panels_render函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。