Skip to content

Commit

Permalink
0.1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
stiofan committed Mar 18, 2024
1 parent 90b203f commit 7dc4a46
Show file tree
Hide file tree
Showing 23 changed files with 687 additions and 104 deletions.
1 change: 1 addition & 0 deletions blocks/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ registerBlockType( 'blockstrap/blockstrap-widget-tabs', { title: 'BS > Tabs' } )
registerBlockType( 'blockstrap/blockstrap-widget-accordion', { title: 'BS > Accordion' } );
registerBlockType( 'blockstrap/blockstrap-widget-accordion-item', { title: 'BS > Accordion Item' } );
registerBlockType( 'blockstrap/blockstrap-widget-contact', { title: 'BS > Contact Form' } );
registerBlockType( 'blockstrap/blockstrap-widget-rating', { title: 'BS > Rating' } );
*/


Expand Down
12 changes: 7 additions & 5 deletions blocks/class-blockstrap-widget-archive-title.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,13 @@ public function output( $args = array(), $widget_args = array(), $content = '' )
}

if ( $title ) {
$tag = ! empty( $args['html_tag'] ) ? esc_attr( $args['html_tag'] ) : 'h1';
$classes = sd_build_aui_class( $args );
$class = $classes ? 'class="' . $classes . '"' : '';
$styles = sd_build_aui_styles( $args );
$style = $styles ? ' style="' . $styles . '"' : '';
$tag = ! empty( $args['html_tag'] ) ? esc_attr( $args['html_tag'] ) : 'h1';
$allowed_tags = array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'span', 'div', 'p' );
$tag = in_array( $tag, $allowed_tags, true ) ? esc_attr( $tag ) : 'h2';
$classes = sd_build_aui_class( $args );
$class = $classes ? 'class="' . $classes . '"' : '';
$styles = sd_build_aui_styles( $args );
$style = $styles ? ' style="' . $styles . '"' : '';

$wrapper_attributes = $class . $style;

Expand Down
14 changes: 7 additions & 7 deletions blocks/class-blockstrap-widget-contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ public function output( $args = array(), $widget_args = array(), $content = '' )
// recaptcha
$recaptcha_enabled = false;
if ( defined( 'BLOCKSTRAP_VERSION' ) && empty( $args['field_recaptcha'] ) ) {
$keys = get_option( 'blockstrap_recaptcha_keys' );
$keys = function_exists( 'blockstrap_get_option' ) ? blockstrap_get_option( 'blockstrap_recaptcha_keys' ) : get_option( 'blockstrap_recaptcha_keys' );
if ( ! empty( $keys['site_key'] ) && ! empty( $keys['site_secret'] ) ) {
$field_content .= '<div class="g-recaptcha mb-3" id="x" data-sitekey="' . esc_attr( $keys['site_key'] ) . '"></div>';
$recaptcha_enabled = true;
Expand Down Expand Up @@ -824,7 +824,7 @@ public function output( $args = array(), $widget_args = array(), $content = '' )
$form_html = '';
$lightbox_html = '';
$button_html = '';
$preview_click = $this->is_preview() ? ' onclick="alert(\'' . esc_html__( 'This is a preview, please test on the frontend.', 'blockstrap-page-builder-blocks' ) . '\');return false;" ' : '';
$preview_click = $this->is_preview() ? ' onclick="alert(\'' . esc_attr__( 'This is a preview, please test on the frontend.', 'blockstrap-page-builder-blocks' ) . '\');return false;" ' : '';

if ( $is_lightbox ) {
$button_text = ! empty( $args['lightbox_button_text'] ) ? esc_attr( $args['lightbox_button_text'] ) : __( 'Contact form', 'blockstrap-page-builder-blocks' );
Expand Down Expand Up @@ -889,7 +889,7 @@ class="' . esc_attr( $wrap_class ) . esc_attr( $recaptcha_class ) . esc_attr( $f
add_action(
'wp_footer',
function() use ( $lightbox_html ) {
echo $lightbox_html;
echo $lightbox_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
);
} else {
Expand All @@ -907,7 +907,7 @@ public function get_modal_footer_html() {
}

public function get_recaptcha_js() {
$keys = get_option( 'blockstrap_recaptcha_keys' );
$keys = function_exists( 'blockstrap_get_option' ) ? blockstrap_get_option( 'blockstrap_recaptcha_keys' ) : get_option( 'blockstrap_recaptcha_keys' );
$site_key = ! empty( $keys['site_key'] ) ? esc_attr( $keys['site_key'] ) : '';
ob_start();
//bsppb-contact-form
Expand Down Expand Up @@ -985,7 +985,7 @@ function bspbb_init_form_recaptcha(){
</script>
<?php

echo ob_get_clean();
echo ob_get_clean(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}

public function get_js() {
Expand All @@ -1008,7 +1008,7 @@ function bpbb_send_contact_form($form){

jQuery.ajax({
type: 'POST',
url: '<?php echo admin_url( 'admin-ajax.php' ); ?>',
url: '<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>',
data: data,
// dataType: 'html'
beforeSend: function() {
Expand Down Expand Up @@ -1039,7 +1039,7 @@ function bpbb_send_contact_form($form){
</script>
<?php

echo ob_get_clean();
echo ob_get_clean(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}


Expand Down
14 changes: 8 additions & 6 deletions blocks/class-blockstrap-widget-post-excerpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function set_arguments() {
'div' => 'div',
'p' => 'p',
),
'default' => 'h1',
'default' => 'div',
'desc_tip' => true,
'group' => __( 'Excerpt', 'blockstrap-page-builder-blocks' ),
);
Expand Down Expand Up @@ -277,11 +277,13 @@ public function output( $args = array(), $widget_args = array(), $content = '' )
}

if ( $content ) {
$tag = ! empty( $args['html_tag'] ) ? esc_attr( $args['html_tag'] ) : 'div';
$classes = sd_build_aui_class( $args );
$class = $classes ? 'class="' . $classes . '"' : '';
$styles = sd_build_aui_styles( $args );
$style = $styles ? ' style="' . $styles . '"' : '';
$tag = ! empty( $args['html_tag'] ) ? esc_attr( $args['html_tag'] ) : 'div';
$allowed_tags = array( 'span', 'div', 'p' );
$tag = in_array( $tag, $allowed_tags, true ) ? esc_attr( $tag ) : 'div';
$classes = sd_build_aui_class( $args );
$class = $classes ? 'class="' . $classes . '"' : '';
$styles = sd_build_aui_styles( $args );
$style = $styles ? ' style="' . $styles . '"' : '';

$wrapper_attributes = $class . $style;

Expand Down
12 changes: 7 additions & 5 deletions blocks/class-blockstrap-widget-post-title.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,13 @@ public function output( $args = array(), $widget_args = array(), $content = '' )
$title = get_the_title();

if ( $title ) {
$tag = ! empty( $args['html_tag'] ) ? esc_attr( $args['html_tag'] ) : 'h1';
$classes = sd_build_aui_class( $args );
$class = $classes ? 'class="' . $classes . '"' : '';
$styles = sd_build_aui_styles( $args );
$style = $styles ? ' style="' . $styles . '"' : '';
$tag = ! empty( $args['html_tag'] ) ? esc_attr( $args['html_tag'] ) : 'h2';
$allowed_tags = array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'span', 'div', 'p' );
$tag = in_array( $tag, $allowed_tags, true ) ? esc_attr( $tag ) : 'h2';
$classes = sd_build_aui_class( $args );
$class = $classes ? 'class="' . $classes . '"' : '';
$styles = sd_build_aui_styles( $args );
$style = $styles ? ' style="' . $styles . '"' : '';

$wrapper_attributes = $class . $style;

Expand Down
Loading

0 comments on commit 7dc4a46

Please sign in to comment.