function block_callback($instance) { $instance = is_array($instance) ? wp_parse_args($instance, $this->block_options) : $this->block_options; extract($instance); $col_order = $order; $col_size = absint(preg_replace("/[^0-9]/", '', $size)); //column block header if (isset($template_id)) { if ('1' == $thin_column) { $before_thin_column = '<div class="col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1">'; $after_thin_column = '</div>'; } else { $before_thin_column = $after_thin_column = false; } echo '<a href="#" id="' . ebor_sanitize_title($title) . '" class="in-page-link"></a>'; if ($type == 'image') { echo '<section class="aq-block image-divider overlay"> <div class="background-image-holder parallax-background"> <img class="background-image" alt="Background Image" src="' . $image . '"> </div> <div class="container"> <div class="row">'; } elseif ($type == 'image-left') { echo '<section class="side-image text-heavy clearfix dark-wrapper"> <div class="image-container col-md-5 col-sm-3 pull-left"> <div class="background-image-holder"> <img class="background-image" alt="Background Image" src="' . $image . '"> </div> </div> <div class="container"> <div class="row"> <div class="col-md-6 col-md-offset-6 col-sm-8 col-sm-offset-4 content clearfix"> <div class="row">'; } elseif ($type == 'image-right') { echo '<section class="side-image text-heavy clearfix dark-wrapper"> <div class="image-container col-md-5 col-sm-3 pull-right"> <div class="background-image-holder"> <img class="background-image" alt="Background Image" src="' . $image . '"> </div> </div> <div class="container"> <div class="row"> <div class="col-md-6 content col-sm-8 clearfix"> <div class="row">'; } else { echo '<section class="aq-block ' . $type . '"><div class="container"><div class="row">'; } echo $before_thin_column; //define vars $overgrid = 0; $span = 0; $first = false; $next_block_size = 0; $next_overgrid = 0; $blocks = aq_get_blocks($template_id); $block_count = count($blocks); // Add block counts to help detect last block //outputs the blocks if ($blocks) { foreach ($blocks as $key => $child) { global $aq_registered_blocks; extract($child); if (class_exists($id_base)) { //get the block object $block = $aq_registered_blocks[$id_base]; //insert template_id into $child $child['template_id'] = $template_id; //display the block if ($parent == $col_order) { $col_size = absint(preg_replace("/[^0-9]/", '', $size)); $overgrid = $span + $col_size; if ($overgrid > 12 || $span == 12 || $span == 0) { $span = 0; $first = true; } if ($first == true) { $child['first'] = true; } $span = $span + $col_size; // Move here if (isset($blocks['aq_block_' . ($number + 1)])) { $next_block_size = $blocks['aq_block_' . ($number + 1)]['size']; // Get next block size $next_block_size = absint(preg_replace("/[^0-9]/", '', $next_block_size)); //Convert to int $next_overgrid = $span + $next_block_size; // Workout over grid for next block if ($next_overgrid > 12 || $span == 12 || $number == $block_count) { $child['last'] = true; } } else { $child['last'] = true; } $block->block_callback($child); $next_block_size = 0; // Reset $next_block_size; $next_overgrid = 0; //$next_overgrid $overgrid = 0; //reset $overgrid $first = false; //reset $first } } } } echo $after_thin_column; if ('image-left' == $type || 'image-right' == $type) { echo '</div></div></div></div></section>'; } else { echo '</div></div></section>'; } } else { //show nothin_columng } }
$output .= '</div> </div> </div><!--end of row--> </div><!--end of container--> <div class="map-holder col-md-6 col-sm-4"> ' . htmlspecialchars_decode(rawurldecode(base64_decode($map))) . ' </div> </section>'; } elseif ('full' == $background_style) { $el_class = $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'vc_row wpb_row ' . ($this->settings('base') === 'vc_row_inner' ? 'vc_inner ' : '') . get_row_css_class() . $el_class . vc_shortcode_custom_css_class($css, ' '), $this->settings['base'], $atts); $style = $this->buildStyle($bg_image, $bg_color, $bg_image_repeat, $font_color, $padding, $margin_bottom); if ($scroll_id) { $output .= '<a id="' . ebor_sanitize_title($scroll_id) . '" class="in-page-link" href="#"></a>'; } $output .= '<section class="' . $background_style . ' ' . $css_class . '"' . $style . '>'; $output .= wpb_js_remove_wpautop($content); $output .= '</section>' . $this->endBlockComment('row'); } else { $el_class = $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'vc_row wpb_row ' . ($this->settings('base') === 'vc_row_inner' ? 'vc_inner ' : '') . get_row_css_class() . $el_class . vc_shortcode_custom_css_class($css, ' '), $this->settings['base'], $atts); $style = $this->buildStyle($bg_image, $bg_color, $bg_image_repeat, $font_color, $padding, $margin_bottom); if ($scroll_id) { $output .= '<a id="' . ebor_sanitize_title($scroll_id) . '" class="in-page-link" href="#"></a>'; } $output .= '<section class="' . esc_attr($color_style) . ' ' . $background_style . ' ' . $css_class . '"' . $style . '><div class="container"><div class="row">'; $output .= wpb_js_remove_wpautop($content); $output .= '</div></div></section>' . $this->endBlockComment('row'); } echo $output;
public function render_content() { ?> <label> <span class="customize-control-title"><?php echo esc_html($this->label); ?> </span> <input <?php $this->link(); ?> name="<?php echo esc_html(ebor_sanitize_title($this->label)); ?> " type="range" min="<?php echo $this->choices['min']; ?> " max="<?php echo $this->choices['max']; ?> " step="<?php echo $this->choices['step']; ?> " value="<?php echo intval($this->value()); ?> " class="ebor-range" onchange="printValue('<?php echo esc_html(ebor_sanitize_title($this->label)); ?> ')" /> <input type="text" name="<?php echo esc_html(ebor_sanitize_title($this->label)); ?> " class="ebor-range-output" value="<?php echo intval($this->value()); ?> " disabled/> </label> <?php }
function block_callback($instance) { $instance = is_array($instance) ? wp_parse_args($instance, $this->block_options) : $this->block_options; extract($instance); $col_order = $order; $col_size = absint(preg_replace("/[^0-9]/", '', $size)); //column block header if (isset($template_id)) { if ($type == 'image') { echo '<div id="' . ebor_sanitize_title($title) . '" class="parallax" style="background-image: url(' . $image . ');"><div class="container inner"><div class="row">'; } else { echo '<div id="' . ebor_sanitize_title($title) . '" class="' . $type . '"><div class="container inner"><div class="row">'; } //define vars $overgrid = 0; $span = 0; $first = false; //check if column has blocks inside it $blocks = aq_get_blocks($template_id); //outputs the blocks if ($blocks) { foreach ($blocks as $key => $child) { global $aq_registered_blocks; extract($child); if (class_exists($id_base)) { //get the block object $block = $aq_registered_blocks[$id_base]; //insert template_id into $child $child['template_id'] = $template_id; //display the block if ($parent == $col_order) { $child_col_size = absint(preg_replace("/[^0-9]/", '', $size)); $overgrid = $span + $child_col_size; if ($overgrid > $col_size || $span == $col_size || $span == 0) { $span = 0; $first = true; } if ($first == true) { $child['first'] = true; } $block->block_callback($child); $span = $span + $child_col_size; $overgrid = 0; //reset $overgrid $first = false; //reset $first } } } } echo '</div></div></div>'; } else { //show nothing } }
<div class="container"> <div class="row"> <div class="col-md-6 content col-sm-8 clearfix"> <div class="row">'; $el_class = $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'vc_row wpb_row ' . ($this->settings('base') === 'vc_row_inner' ? 'vc_inner ' : '') . get_row_css_class() . $el_class . ' ', $this->settings['base'], $atts); $output .= '<div class="' . $css_class . '">'; $output .= wpb_js_remove_wpautop($content); $output .= '</div>' . $this->endBlockComment('row'); $output .= '</div></div></div></section>'; } elseif ('image' == $background_style) { preg_match_all('#\\bhttps?://[^\\s()<>]+(?:\\([\\w\\d]+\\)|([^[:punct:]\\s]|/))#', $css, $image); if (!isset($image[0][0])) { $image[0][0] = false; } $output .= '<a href="#" id="' . ebor_sanitize_title($single_link) . '" class="in-page-link"></a><section class="aq-block image-divider overlay"> <div class="background-image-holder parallax-background"> <img class="background-image" alt="Background Image" src="' . $image[0][0] . '"> </div> <div class="container"> <div class="row">'; $el_class = $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'vc_row wpb_row ' . ($this->settings('base') === 'vc_row_inner' ? 'vc_inner ' : '') . get_row_css_class() . $el_class . ' ', $this->settings['base'], $atts); $output .= '<div class="' . $css_class . '">'; $output .= wpb_js_remove_wpautop($content); $output .= '</div>' . $this->endBlockComment('row'); $output .= '</div></div></section>'; } elseif ('full' == $background_style) { $el_class = $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, '' . ($this->settings('base') === 'vc_row_inner' ? 'vc_inner ' : '') . get_row_css_class() . $el_class . vc_shortcode_custom_css_class($css, ' '), $this->settings['base'], $atts);