Skip to content

Commit

Permalink
Merge pull request #60 from kprajapatii/master
Browse files Browse the repository at this point in the history
1.1.30
  • Loading branch information
kprajapatii authored Dec 4, 2023
2 parents acb0a0d + 3838958 commit 703898a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 24 deletions.
3 changes: 3 additions & 0 deletions change-log.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
= 1.1.30 =
* element_require condition is not working with checkbox - FIXED

= 1.1.29 =
* Show device type name with title for multi-device option setting - CHANGED
* element_require condition is not working with checkbox - FIXED
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ayecode/wp-super-duper",
"version": "1.1.29",
"version": "1.1.30",
"type": "library",
"description": "Lets you create a widget, block and shortcode all from the one file .",
"keywords": ["WordPress","super duper","wp"],
Expand Down
50 changes: 27 additions & 23 deletions wp-super-duper.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

if ( ! class_exists( 'WP_Super_Duper' ) ) {

define( 'SUPER_DUPER_VER', '1.1.29' );
define( 'SUPER_DUPER_VER', '1.1.30' );

/**
* A Class to be able to create a Widget, Shortcode or Block to be able to output content for WordPress.
Expand Down Expand Up @@ -4070,11 +4070,10 @@ public function block_element( $args, $save = false ) {
* @return mixed
*/
public function block_props_replace( $string, $no_wrap = false ) {

if ( $no_wrap ) {
$string = str_replace( array( "[%", "%]" ), array( "props.attributes.", "" ), $string );
$string = str_replace( array( "[%", "%]", "%:checked]" ), array( "props.attributes.", "", "" ), $string );
} else {
$string = str_replace( array( "[%", "%]" ), array( "'+props.attributes.", "+'" ), $string );
$string = str_replace( array( "![%", "[%", "%]", "%:checked]" ), array( "'+!props.attributes.", "'+props.attributes.", "+'", "+'" ), $string );
}

return $string;
Expand Down Expand Up @@ -4424,36 +4423,41 @@ public function form( $instance ) {
}
}

public function widget_inputs_row_start($key, $args){
if(!empty($args['row'])){
// maybe open
if(!empty($args['row']['open'])){
public function widget_inputs_row_start( $key, $args ) {
if ( ! empty( $args['row'] ) ) {
// Maybe open
if ( ! empty( $args['row']['open'] ) ) {
?>
<div class='bsui sd-argument' data-argument='<?php echo esc_attr( $args['row']['key'] ); ?>' data-element_require='<?php echo ( ! empty( $args['row']['element_require'] ) ? $this->convert_element_require( $args['row']['element_require'] ) : '' ); ?>'>
<?php if ( ! empty( $args['row']['title'] ) ) { ?>
<?php
if ( isset( $args['row']['icon'] ) ) {
$args['row']['icon'] = '';
}

if ( ! isset( $args['row']['device_type'] ) && isset( $args['device_type'] ) ) {
$args['row']['device_type'] = $args['device_type'];
}
?>
<div class='bsui sd-argument ' data-argument='<?php echo esc_attr( $args['row']['key'] ); ?>' data-element_require='<?php if ( !empty($args['row']['element_require'])) {
echo $this->convert_element_require( $args['row']['element_require'] );
} ?>'>
<?php if(!empty($args['row']['title'])){ ?>
<label class="mb-0 "><?php echo esc_attr( $args['row']['title'] ); ?><?php echo $this->widget_field_desc( $args['row'] ); ?></label>
<?php }?>
<div class='row <?php if(!empty($args['row']['class'])){ echo esc_attr($args['row']['class']);} ?>'>
<label class="mb-0"><?php echo $this->widget_field_title( $args['row'] ); ?><?php echo $this->widget_field_desc( $args['row'] ); ?></label>
<?php } ?>
<div class='row<?php echo ( ! empty( $args['row']['class'] ) ? ' ' . esc_attr( $args['row']['class'] ) : '' ); ?>'>
<div class='col pr-2'>
<?php
}elseif(!empty($args['row']['close'])){
} else if ( ! empty( $args['row']['close'] ) ) {
echo "<div class='col pl-0 ps-0'>";
}else{
} else {
echo "<div class='col pl-0 ps-0 pr-2 pe-2'>";
}
}
}

public function widget_inputs_row_end($key, $args){

if(!empty($args['row'])){
// maybe close
if(!empty($args['row']['close'])){
public function widget_inputs_row_end( $key, $args ) {
if ( ! empty( $args['row'] ) ) {
// Maybe close
if ( ! empty( $args['row']['close'] ) ) {
echo "</div></div>";
}

echo "</div>";
}
}
Expand Down

0 comments on commit 703898a

Please sign in to comment.