Skip to content

Commit

Permalink
Merge pull request #19 from kprajapatii/master
Browse files Browse the repository at this point in the history
Category settings loads only 10 categories on CPT change - FIXED
  • Loading branch information
Stiofan authored Aug 18, 2021
2 parents 9f0c4fc + 07093ab commit 9e1b973
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
4 changes: 4 additions & 0 deletions change-log.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
= 1.0.27 =
* Category settings loads only 10 categories on CPT change - FIXED
* Hook added to filter class & attributes for Elementor widget output - ADDED

= 1.0.26 =
* Error on setting array option value in block editor - FIXED

Expand Down
33 changes: 18 additions & 15 deletions wp-super-duper.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public static function get_picker( $editor_id = '' ) {
echo $html;
$should_die = true;

// some builder get the editor via ajax so we should not die on those ocasions
// some builder get the editor via ajax so we should not die on those occasions
$dont_die = array(
'parent_tag',// WP Bakery
'avia_request' // enfold
Expand Down Expand Up @@ -354,7 +354,7 @@ public static function get_widget_settings() {
* @since 1.0.0
*
* @param string $editor_id Optional. Shortcode editor id. Default null.
* @param string $insert_shortcode_function Optional. Insert shotcode function. Default null.
* @param string $insert_shortcode_function Optional. Insert shortcode function. Default null.
*/
public static function shortcode_insert_button( $editor_id = '', $insert_shortcode_function = '' ) {
global $sd_widgets, $shortcode_insert_button_once;
Expand Down Expand Up @@ -431,7 +431,7 @@ public static function siteorigin_js() {
?>
<script>
/**
* Check a form to see what items shoudl be shown or hidden.
* Check a form to see what items should be shown or hidden.
*/
function sd_so_show_hide(form) {
jQuery(form).find(".sd-argument").each(function () {
Expand Down Expand Up @@ -713,7 +713,7 @@ function sd_insert_shortcode($editor_id) {
}

/*
Set the value of elements controled via react.
Set the value of elements controlled via react.
*/
function sd_setNativeValue(element, value) {
let lastValue = element.value;
Expand Down Expand Up @@ -898,7 +898,7 @@ function sd_init_textareas() {
}
});

// The below tries to add the shorcode builder button to the builders own raw/shortcode sections.
// The below tries to add the shortcode builder button to the builders own raw/shortcode sections.

// DIVI
jQuery(document).on('focusin', '.et-fb-codemirror', function () {
Expand Down Expand Up @@ -1088,7 +1088,7 @@ function sd_toggle_advanced($this) {
}

/**
* Check a form to see what items shoudl be shown or hidden.
* Check a form to see what items should be shown or hidden.
*/
function sd_show_hide(form) {
console.log('show/hide');
Expand Down Expand Up @@ -1197,7 +1197,7 @@ function sd_init_customizer_widget(section) {
}
});

// inint on widget updated
// init on widget updated
jQuery(document).on('widget-updated', function (e, widget) {
console.log('widget updated');

Expand Down Expand Up @@ -1346,7 +1346,7 @@ public function shortcode_output( $args = array(), $content = '' ) {
$class = apply_filters( 'wp_super_duper_div_classname_' . $this->base_id, $class, $args, $this );

$attrs = apply_filters( 'wp_super_duper_div_attrs', '', $args, $this );
$attrs = apply_filters( 'wp_super_duper_div_attrs_' . $this->base_id, '', $args, $this ); //@todo this does not seem right @kiran?
$attrs = apply_filters( 'wp_super_duper_div_attrs_' . $this->base_id, '', $args, $this );

$shortcode_args = array();
$output = '';
Expand Down Expand Up @@ -1790,7 +1790,7 @@ public function block() {

// taxonomies
if( $value && 'post_type' in prev_attributes[props.id] && 'category' in prev_attributes[props.id] && run ){
wp.apiFetch({path: "<?php if(isset($this->arguments['post_type']['onchange_rest']['path'])){echo $this->arguments['post_type']['onchange_rest']['path'];}else{'/wp/v2/"+$value+"/categories';} ?>"}).then(terms => {
wp.apiFetch({path: "<?php if(isset($this->arguments['post_type']['onchange_rest']['path'])){echo $this->arguments['post_type']['onchange_rest']['path'];}else{'/wp/v2/"+$value+"/categories/?per_page=100';} ?>"}).then(terms => {
while (taxonomies_<?php echo str_replace("-","_", $this->id);?>.length) {
taxonomies_<?php echo str_replace("-","_", $this->id);?>.pop();
}
Expand Down Expand Up @@ -2518,12 +2518,19 @@ public function widget( $args, $instance ) {
echo $before_widget;
// elementor strips the widget wrapping div so we check for and add it back if needed
if ( $this->is_elementor_widget_output() ) {
echo ! empty( $this->options['widget_ops']['classname'] ) ? "<span class='" . esc_attr( $class ) . "'>" : '';
// Filter class & attrs for elementor widget output.
$class = apply_filters( 'wp_super_duper_div_classname', $class, $args, $this );
$class = apply_filters( 'wp_super_duper_div_classname_' . $this->base_id, $class, $args, $this );

$attrs = apply_filters( 'wp_super_duper_div_attrs', '', $args, $this );
$attrs = apply_filters( 'wp_super_duper_div_attrs_' . $this->base_id, '', $args, $this );

echo "<span class='" . esc_attr( $class ) . "' " . $attrs . ">";
}
echo $this->output_title( $args, $instance );
echo $output;
if ( $this->is_elementor_widget_output() ) {
echo ! empty( $this->options['widget_ops']['classname'] ) ? "</span>" : '';
echo "</span>";
}
echo $after_widget;
} elseif ( $this->is_preview() && $output == '' ) {// if preview show a placeholder if empty
Expand Down Expand Up @@ -3202,11 +3209,7 @@ public function get_instance_style($rules = array()){
$css .= "</style>";
}


return $css;

}

}

}

0 comments on commit 9e1b973

Please sign in to comment.