Exemplo n.º 1
0
echo esc_html(wp_sb_get_field_value('title'));
?>
</h1>
        <p<?php 
wp_sb_editing_field('tagline');
?>
><?php 
echo esc_html(wp_sb_get_field_value('tagline'));
?>
</p>
        <div<?php 
wp_sb_editing_field('contents');
?>
>
            <?php 
$contents = wp_sb_get_field_value('contents');
$backup_values = $section_values;
$backup_section = $current_section;
$backup_settings = $section_settings;
// var_dump( $current_section );
global $wp_sb_elements;
// var_dump( $contents );
foreach ($contents as $_block) {
    if (!isset($_block['tag'])) {
        continue;
    }
    $GLOBALS['current_section'] = $wp_sb_elements[$_block['tag']];
    $GLOBALS['section_values'] = $_block['fields'];
    $GLOBALS['section_settings'] = $_block['settings'];
    if (isset($wp_sb_elements[$_block['tag']])) {
        wp_sb_setup_section_data(array('fields' => $wp_sb_elements[$_block['tag']]['fields'], 'settings' => $wp_sb_elements[$_block['tag']]['settings']));
Exemplo n.º 2
0
    <div class="container">
        <?php 
$title = wp_sb_get_field_value('title');
if (isset($title['_css'])) {
    wp_sb_template()->add_css('.' . $section_id . ' .post-heading', $title['_css']);
}
?>
        <h1<?php 
wp_sb_editing_field('title');
?>
 class="post-heading"><?php 
echo $title['label'];
?>
</h1>
        <?php 
$btn = wp_sb_get_field_value('button');
$classes = array($btn['button_style'], $btn['size']);
?>
        <p><a<?php 
wp_sb_editing_field('button');
?>
 href="#" class="btn <?php 
echo esc_attr(join(' ', $classes));
?>
"><?php 
echo $btn['label'];
?>
</a></p>
    </div>
</div>