diff --git a/includes/class-geodir-ajax.php b/includes/class-geodir-ajax.php
index 8d1970f3..d1cffb8e 100644
--- a/includes/class-geodir-ajax.php
+++ b/includes/class-geodir-ajax.php
@@ -171,7 +171,7 @@ private static function gd_ajax_headers() {
* @since 2.0.0
*/
public static function manual_map() {
- global $geodirectory, $mapzoom, $geodir_manual_map;
+ global $geodirectory, $mapzoom, $geodir_manual_map,$aui_bs5;
$prefix = isset( $_POST['trigger'] ) ? sanitize_title( geodir_clean( $_POST['trigger'] ) ) : 'geodir_manual_location_';
$prefix = esc_attr( $prefix );
@@ -233,7 +233,7 @@ public static function manual_map() {
if( $design_style ) {
?>
';
- if ( ! empty( $args['title'] ) ) {
- // if its a shortcode and there is a title try to grab the title wrappers
- $shortcode_args = array( 'before_title' => '', 'after_title' => '' );
- if ( empty( $instance ) ) {
- global $wp_registered_sidebars;
- if ( ! empty( $wp_registered_sidebars ) ) {
- foreach ( $wp_registered_sidebars as $sidebar ) {
- if ( ! empty( $sidebar['before_title'] ) ) {
- $shortcode_args['before_title'] = $sidebar['before_title'];
- $shortcode_args['after_title'] = $sidebar['after_title'];
- break;
- }
- }
- }
- }
- $output .= $this->output_title( $shortcode_args, $args );
- }
- $output .= $main_content;
- $output .= '
';
- } elseif ( $main_content && $no_wrap ) {
- $output .= $main_content;
- }
-
- // if preview show a placeholder if empty
- if ( $this->is_preview() && $output == '' ) {
- $output = $this->preview_placeholder_text( "{{" . $this->base_id . "}}" );
- }
-
- return apply_filters( 'wp_super_duper_widget_output', $output, $args, $shortcode_args, $this );
- }
-
- /**
- * Placeholder text to show if output is empty and we are on a preview/builder page.
- *
- * @param string $name
- *
- * @return string
- */
- public function preview_placeholder_text( $name = '' ) {
- return "" . wp_sprintf( __( 'Placeholder for: %s', 'ayecode-connect' ), $name ) . "
";
- }
-
- /**
- * Sometimes booleans values can be turned to strings, so we fix that.
- *
- * @param $options
- *
- * @return mixed
- */
- public function string_to_bool( $options ) {
- // convert bool strings to booleans
- foreach ( $options as $key => $val ) {
- if ( $val == 'false' ) {
- $options[ $key ] = false;
- } elseif ( $val == 'true' ) {
- $options[ $key ] = true;
- }
- }
-
- return $options;
- }
-
- /**
- * Get the argument values that are also filterable.
- *
- * @param $instance
- *
- * @return array
- *@since 1.0.12 Don't set checkbox default value if the value is empty.
- *
- */
- public function argument_values( $instance ) {
- $argument_values = array();
-
- // set widget instance
- $this->instance = $instance;
-
- if ( empty( $this->arguments ) ) {
- $this->arguments = $this->get_arguments();
- }
-
- if ( ! empty( $this->arguments ) ) {
- foreach ( $this->arguments as $key => $args ) {
- // set the input name from the key
- $args['name'] = $key;
- //
- $argument_values[ $key ] = isset( $instance[ $key ] ) ? $instance[ $key ] : '';
- if ( $args['type'] == 'checkbox' && $argument_values[ $key ] == '' ) {
- // don't set default for an empty checkbox
- } elseif ( $argument_values[ $key ] == '' && isset( $args['default'] ) ) {
- $argument_values[ $key ] = $args['default'];
- }
- }
- }
-
- return $argument_values;
- }
-
- /**
- * Set arguments in super duper.
- *
- * @return array Set arguments.
- *@since 1.0.0
- *
- */
- public function set_arguments() {
- return $this->arguments;
- }
-
- /**
- * Get arguments in super duper.
- *
- * @return array Get arguments.
- *@since 1.0.0
- *
- */
- public function get_arguments() {
- if ( empty( $this->arguments ) ) {
- $this->arguments = $this->set_arguments();
- }
-
- $this->arguments = apply_filters( 'wp_super_duper_arguments', $this->arguments, $this->options, $this->instance );
- $this->arguments = $this->add_name_from_key( $this->arguments, true );
-
- return $this->arguments;
- }
-
- /**
- * This is the main output class for all 3 items, widget, shortcode and block, it is extended in the calling class.
- *
- * @param array $args
- * @param array $widget_args
- * @param string $content
- */
- public function output( $args = array(), $widget_args = array(), $content = '' ) {
-
- }
-
- /**
- * Add the dynamic block code inline when the wp-block in enqueued.
- */
- public function register_block() {
- wp_add_inline_script( 'wp-blocks', $this->block() );
- if ( class_exists( 'SiteOrigin_Panels' ) ) {
- wp_add_inline_script( 'wp-blocks', $this->siteorigin_js() );
- }
- }
-
- /**
- * Check if we need to show advanced options.
- *
- * @return bool
- */
- public function block_show_advanced() {
-
- $show = false;
- $arguments = $this->get_arguments();
-
- if ( ! empty( $arguments ) ) {
- foreach ( $arguments as $argument ) {
- if ( isset( $argument['advanced'] ) && $argument['advanced'] ) {
- $show = true;
- break; // no need to continue if we know we have it
- }
- }
- }
-
- return $show;
- }
-
- /**
- * Get the url path to the current folder.
- *
- * @return string
- */
- public function get_url() {
- $url = $this->url;
-
- if ( ! $url ) {
- $content_dir = wp_normalize_path( untrailingslashit( WP_CONTENT_DIR ) );
- $content_url = untrailingslashit( WP_CONTENT_URL );
-
- // Replace http:// to https://.
- if ( strpos( $content_url, 'http://' ) === 0 && strpos( plugins_url(), 'https://' ) === 0 ) {
- $content_url = str_replace( 'http://', 'https://', $content_url );
- }
-
- // Check if we are inside a plugin
- $file_dir = str_replace( "/includes", "", wp_normalize_path( dirname( __FILE__ ) ) );
- $url = str_replace( $content_dir, $content_url, $file_dir );
- $url = trailingslashit( $url );
- $this->url = $url;
- }
-
- return $url;
- }
-
- /**
- * Get the url path to the current folder.
- *
- * @return string
- */
- public function get_url_old() {
-
- $url = $this->url;
-
- if ( ! $url ) {
- // check if we are inside a plugin
- $file_dir = str_replace( "/includes", "", dirname( __FILE__ ) );
-
- $dir_parts = explode( "/wp-content/", $file_dir );
- $url_parts = explode( "/wp-content/", plugins_url() );
-
- if ( ! empty( $url_parts[0] ) && ! empty( $dir_parts[1] ) ) {
- $url = trailingslashit( $url_parts[0] . "/wp-content/" . $dir_parts[1] );
- $this->url = $url;
- }
- }
-
-
- return $url;
- }
-
- /**
- * Generate the block icon.
- *
- * Enables the use of Font Awesome icons.
- *
- * @note xlink:href is actually deprecated but href is not supported by all so we use both.
- *
- * @param $icon
- *
- * @return string
- *@since 1.1.0
- */
- public function get_block_icon( $icon ) {
-
- // check if we have a Font Awesome icon
- $fa_type = '';
- if ( substr( $icon, 0, 7 ) === "fas fa-" ) {
- $fa_type = 'solid';
- } elseif ( substr( $icon, 0, 7 ) === "far fa-" ) {
- $fa_type = 'regular';
- } elseif ( substr( $icon, 0, 7 ) === "fab fa-" ) {
- $fa_type = 'brands';
- } else {
- $icon = "'" . $icon . "'";
- }
-
- // set the icon if we found one
- if ( $fa_type ) {
- $fa_icon = str_replace( array( "fas fa-", "far fa-", "fab fa-" ), "", $icon );
- $icon = "el('svg',{width: 20, height: 20, viewBox: '0 0 20 20'},el('use', {'xlink:href': '" . $this->get_url() . "icons/" . $fa_type . ".svg#" . $fa_icon . "','href': '" . $this->get_url() . "icons/" . $fa_type . ".svg#" . $fa_icon . "'}))";
- }
-
- return $icon;
- }
-
- public function group_arguments( $arguments ) {
- if ( ! empty( $arguments ) ) {
- $temp_arguments = array();
- $general = __( "General", 'ayecode-connect' );
- $add_sections = false;
- foreach ( $arguments as $key => $args ) {
- if ( isset( $args['group'] ) ) {
- $temp_arguments[ $args['group'] ][ $key ] = $args;
- $add_sections = true;
- } else {
- $temp_arguments[ $general ][ $key ] = $args;
- }
- }
-
- // only add sections if more than one
- if ( $add_sections ) {
- $arguments = $temp_arguments;
- }
- }
-
- return $arguments;
- }
-
- /**
- * Parse used group tabs.
- *
- * @since 1.1.17
- */
- public function group_block_tabs( $tabs, $arguments ) {
- if ( ! empty( $tabs ) && ! empty( $arguments ) ) {
- $has_sections = false;
-
- foreach ( $this->arguments as $key => $args ) {
- if ( isset( $args['group'] ) ) {
- $has_sections = true;
- break;
- }
- }
-
- if ( ! $has_sections ) {
- return $tabs;
- }
-
- $new_tabs = array();
-
- foreach ( $tabs as $tab_key => $tab ) {
- $new_groups = array();
-
- if ( ! empty( $tab['groups'] ) && is_array( $tab['groups'] ) ) {
- foreach ( $tab['groups'] as $group ) {
- if ( isset( $arguments[ $group ] ) ) {
- $new_groups[] = $group;
- }
- }
- }
-
- if ( ! empty( $new_groups ) ) {
- $tab['groups'] = $new_groups;
-
- $new_tabs[ $tab_key ] = $tab;
- }
- }
-
- $tabs = $new_tabs;
- }
-
- return $tabs;
- }
-
- /**
- * Output the JS for building the dynamic Guntenberg block.
- *
- * @return mixed
- *@since 1.0.9 Save numbers as numbers and not strings.
- * @since 1.1.0 Font Awesome classes can be used for icons.
- * @since 1.0.4 Added block_wrap property which will set the block wrapping output element ie: div, span, p or empty for no wrap.
- */
- public function block() {
- global $sd_is_js_functions_loaded, $aui_bs5;
-
- $show_advanced = $this->block_show_advanced();
-
- ob_start();
- ?>
- ";
+ ?>
+ ';
+ }
- // hover animations
- if ( $args['hover_animations'] !== undefined && $args['hover_animations'] ) { $classes.push($args['hover_animations'].toString().replace(',',' ')); }
+ echo self::shortcode_button( 'this', 'true' );
- // absolute_position
- if ( $args['absolute_position'] !== undefined ) {
- if ( 'top-left' === $args['absolute_position'] ) {
- $classes.push('start-0 top-0');
- } else if ( 'top-center' === $args['absolute_position'] ) {
- $classes.push('start-50 top-0 translate-middle');
- } else if ( 'top-right' === $args['absolute_position'] ) {
- $classes.push('end-0 top-0');
- } else if ( 'center-left' === $args['absolute_position'] ) {
- $classes.push('start-0 bottom-50');
- } else if ( 'center' === $args['absolute_position'] ) {
- $classes.push('start-50 top-50 translate-middle');
- } else if ( 'center-right' === $args['absolute_position'] ) {
- $classes.push('end-0 top-50');
- } else if ( 'bottom-left' === $args['absolute_position'] ) {
- $classes.push('start-0 bottom-0');
- } else if ( 'bottom-center' === $args['absolute_position'] ) {
- $classes.push('start-50 bottom-0 translate-middle');
- } else if ( 'bottom-right' === $args['absolute_position'] ) {
- $classes.push('end-0 bottom-0');
- }
- }
-
- // build classes from build keys
- $build_keys = sd_get_class_build_keys();
- if ( $build_keys.length ) {
- $build_keys.forEach($key => {
-
- if($key.endsWith("-MTD")){
-
- $k = $key.replace("-MTD","");
-
- // Mobile, Tablet, Desktop
- if ( $args[$k] !== undefined && $args[$k] !== '' ) { $classes.push( $args[$k] ); $v = $args[$k]; }else{$v = null;}
- if ( $args[$k + '_md'] !== undefined && $args[$k + '_md'] !== '' ) { $classes.push( $args[$k + '_md'] ); $v_md = $args[$k + '_md']; }else{$v_md = null;}
- if ( $args[$k + '_lg'] !== undefined && $args[$k + '_lg'] !== '' ) { if($v == null && $v_md == null){ $classes.push( $args[$k + '_lg'].replace('-lg','') ); }else{$classes.push( $args[$k + '_lg'] ); } }
-
- }else{
- if ( $key == 'font_size' && ( $args[ $key ] == 'custom' || $args[ $key ] === '0' ) ) {
- return;
- }
- if ( $args[$key] !== undefined && $args[$key] !== '' ) { $classes.push($args[$key]); }
- }
-
- });
- }
+ // see opening note
+ if ( function_exists( 'cornerstone_plugin_init' ) && ! is_admin() ) {
+ echo ''; // end #insert-media-button
+ }
- return $classes.join(" ");
+ // Add separate script for generatepress theme sections
+ if ( function_exists( 'generate_sections_sections_metabox' ) && did_action( 'generate_sections_metabox' ) ) {
+ } else {
+ self::shortcode_insert_button_script( $editor_id, $insert_shortcode_function );
}
- function sd_get_class_build_keys(){
- return ;
- }
+ $shortcode_insert_button_once = true;
+ }
+
+ /**
+ * Gets the shortcode insert button html.
+ *
+ * @param string $id
+ * @param string $search_for_id
+ *
+ * @return mixed
+ */
+ public static function shortcode_button( $id = '', $search_for_id = '' ) {
+ ob_start();
+ ?>
+ ';
+ if ( ! empty( $args['title'] ) ) {
+ // if its a shortcode and there is a title try to grab the title wrappers
+ $shortcode_args = array( 'before_title' => '', 'after_title' => '' );
+ if ( empty( $instance ) ) {
+ global $wp_registered_sidebars;
+ if ( ! empty( $wp_registered_sidebars ) ) {
+ foreach ( $wp_registered_sidebars as $sidebar ) {
+ if ( ! empty( $sidebar['before_title'] ) ) {
+ $shortcode_args['before_title'] = $sidebar['before_title'];
+ $shortcode_args['after_title'] = $sidebar['after_title'];
+ break;
+ }
+ }
+ }
+ }
+ $output .= $this->output_title( $shortcode_args, $args );
+ }
+ $output .= $main_content;
+ $output .= '
';
+ } elseif ( $main_content && $no_wrap ) {
+ $output .= $main_content;
+ }
+
+ // if preview show a placeholder if empty
+ if ( $this->is_preview() && $output == '' ) {
+ $output = $this->preview_placeholder_text( "{{" . $this->base_id . "}}" );
+ }
+
+ return apply_filters( 'wp_super_duper_widget_output', $output, $args, $shortcode_args, $this );
+ }
+
+ /**
+ * Placeholder text to show if output is empty and we are on a preview/builder page.
+ *
+ * @param string $name
+ *
+ * @return string
+ */
+ public function preview_placeholder_text( $name = '' ) {
+ return "" . wp_sprintf( __( 'Placeholder for: %s', 'ayecode-connect' ), $name ) . "
";
+ }
+
+ /**
+ * Sometimes booleans values can be turned to strings, so we fix that.
+ *
+ * @param $options
+ *
+ * @return mixed
+ */
+ public function string_to_bool( $options ) {
+ // convert bool strings to booleans
+ foreach ( $options as $key => $val ) {
+ if ( $val == 'false' ) {
+ $options[ $key ] = false;
+ } elseif ( $val == 'true' ) {
+ $options[ $key ] = true;
+ }
+ }
+
+ return $options;
+ }
+
+ /**
+ * Get the argument values that are also filterable.
+ *
+ * @param $instance
+ *
+ * @return array
+ *@since 1.0.12 Don't set checkbox default value if the value is empty.
+ *
+ */
+ public function argument_values( $instance ) {
+ $argument_values = array();
+
+ // set widget instance
+ $this->instance = $instance;
+
+ if ( empty( $this->arguments ) ) {
+ $this->arguments = $this->get_arguments();
+ }
+
+ if ( ! empty( $this->arguments ) ) {
+ foreach ( $this->arguments as $key => $args ) {
+ // set the input name from the key
+ $args['name'] = $key;
+ //
+ $argument_values[ $key ] = isset( $instance[ $key ] ) ? $instance[ $key ] : '';
+ if ( $args['type'] == 'checkbox' && $argument_values[ $key ] == '' ) {
+ // don't set default for an empty checkbox
+ } elseif ( $argument_values[ $key ] == '' && isset( $args['default'] ) ) {
+ $argument_values[ $key ] = $args['default'];
+ }
+ }
+ }
+
+ return $argument_values;
+ }
+
+ /**
+ * Set arguments in super duper.
+ *
+ * @return array Set arguments.
+ *@since 1.0.0
+ *
+ */
+ public function set_arguments() {
+ return $this->arguments;
+ }
+
+ /**
+ * Get arguments in super duper.
+ *
+ * @return array Get arguments.
+ *@since 1.0.0
+ *
+ */
+ public function get_arguments() {
+ if ( empty( $this->arguments ) ) {
+ $this->arguments = $this->set_arguments();
+ }
+
+ $this->arguments = apply_filters( 'wp_super_duper_arguments', $this->arguments, $this->options, $this->instance );
+ $this->arguments = $this->add_name_from_key( $this->arguments, true );
+
+ return $this->arguments;
+ }
+
+ /**
+ * This is the main output class for all 3 items, widget, shortcode and block, it is extended in the calling class.
+ *
+ * @param array $args
+ * @param array $widget_args
+ * @param string $content
+ */
+ public function output( $args = array(), $widget_args = array(), $content = '' ) {
+
+ }
+
+ /**
+ * Add the dynamic block code inline when the wp-block in enqueued.
+ */
+ public function register_block() {
+ wp_add_inline_script( 'wp-blocks', $this->block() );
+ if ( class_exists( 'SiteOrigin_Panels' ) ) {
+ wp_add_inline_script( 'wp-blocks', $this->siteorigin_js() );
+ }
+ }
+
+ /**
+ * Check if we need to show advanced options.
+ *
+ * @return bool
+ */
+ public function block_show_advanced() {
+
+ $show = false;
+ $arguments = $this->get_arguments();
+
+ if ( ! empty( $arguments ) ) {
+ foreach ( $arguments as $argument ) {
+ if ( isset( $argument['advanced'] ) && $argument['advanced'] ) {
+ $show = true;
+ break; // no need to continue if we know we have it
+ }
+ }
+ }
+
+ return $show;
+ }
+
+ /**
+ * Get the url path to the current folder.
+ *
+ * @return string
+ */
+ public function get_url() {
+ $url = $this->url;
+
+ if ( ! $url ) {
+ $content_dir = wp_normalize_path( untrailingslashit( WP_CONTENT_DIR ) );
+ $content_url = untrailingslashit( WP_CONTENT_URL );
+
+ // Replace http:// to https://.
+ if ( strpos( $content_url, 'http://' ) === 0 && strpos( plugins_url(), 'https://' ) === 0 ) {
+ $content_url = str_replace( 'http://', 'https://', $content_url );
+ }
+
+ // Check if we are inside a plugin
+ $file_dir = str_replace( "/includes", "", wp_normalize_path( dirname( __FILE__ ) ) );
+ $url = str_replace( $content_dir, $content_url, $file_dir );
+ $url = trailingslashit( $url );
+ $this->url = $url;
+ }
+
+ return $url;
+ }
+
+ /**
+ * Get the url path to the current folder.
+ *
+ * @return string
+ */
+ public function get_url_old() {
+
+ $url = $this->url;
+
+ if ( ! $url ) {
+ // check if we are inside a plugin
+ $file_dir = str_replace( "/includes", "", dirname( __FILE__ ) );
+
+ $dir_parts = explode( "/wp-content/", $file_dir );
+ $url_parts = explode( "/wp-content/", plugins_url() );
+
+ if ( ! empty( $url_parts[0] ) && ! empty( $dir_parts[1] ) ) {
+ $url = trailingslashit( $url_parts[0] . "/wp-content/" . $dir_parts[1] );
+ $this->url = $url;
+ }
+ }
+
+
+ return $url;
+ }
+
+ /**
+ * Generate the block icon.
+ *
+ * Enables the use of Font Awesome icons.
+ *
+ * @note xlink:href is actually deprecated but href is not supported by all so we use both.
+ *
+ * @param $icon
+ *
+ * @return string
+ *@since 1.1.0
+ */
+ public function get_block_icon( $icon ) {
+
+ // check if we have a Font Awesome icon
+ $fa_type = '';
+ if ( substr( $icon, 0, 7 ) === "fas fa-" ) {
+ $fa_type = 'solid';
+ } elseif ( substr( $icon, 0, 7 ) === "far fa-" ) {
+ $fa_type = 'regular';
+ } elseif ( substr( $icon, 0, 7 ) === "fab fa-" ) {
+ $fa_type = 'brands';
+ } else {
+ $icon = "'" . $icon . "'";
+ }
+
+ // set the icon if we found one
+ if ( $fa_type ) {
+ $fa_icon = str_replace( array( "fas fa-", "far fa-", "fab fa-" ), "", $icon );
+ $icon = "el('svg',{width: 20, height: 20, viewBox: '0 0 20 20'},el('use', {'xlink:href': '" . $this->get_url() . "icons/" . $fa_type . ".svg#" . $fa_icon . "','href': '" . $this->get_url() . "icons/" . $fa_type . ".svg#" . $fa_icon . "'}))";
+ }
+
+ return $icon;
+ }
+
+ public function group_arguments( $arguments ) {
+ if ( ! empty( $arguments ) ) {
+ $temp_arguments = array();
+ $general = __( "General", 'ayecode-connect' );
+ $add_sections = false;
+ foreach ( $arguments as $key => $args ) {
+ if ( isset( $args['group'] ) ) {
+ $temp_arguments[ $args['group'] ][ $key ] = $args;
+ $add_sections = true;
+ } else {
+ $temp_arguments[ $general ][ $key ] = $args;
+ }
+ }
+
+ // only add sections if more than one
+ if ( $add_sections ) {
+ $arguments = $temp_arguments;
+ }
+ }
+
+ return $arguments;
+ }
+
+ /**
+ * Parse used group tabs.
+ *
+ * @since 1.1.17
+ */
+ public function group_block_tabs( $tabs, $arguments ) {
+ if ( ! empty( $tabs ) && ! empty( $arguments ) ) {
+ $has_sections = false;
+
+ foreach ( $this->arguments as $key => $args ) {
+ if ( isset( $args['group'] ) ) {
+ $has_sections = true;
+ break;
+ }
+ }
+
+ if ( ! $has_sections ) {
+ return $tabs;
+ }
+
+ $new_tabs = array();
+
+ foreach ( $tabs as $tab_key => $tab ) {
+ $new_groups = array();
+
+ if ( ! empty( $tab['groups'] ) && is_array( $tab['groups'] ) ) {
+ foreach ( $tab['groups'] as $group ) {
+ if ( isset( $arguments[ $group ] ) ) {
+ $new_groups[] = $group;
+ }
+ }
+ }
+
+ if ( ! empty( $new_groups ) ) {
+ $tab['groups'] = $new_groups;
+
+ $new_tabs[ $tab_key ] = $tab;
+ }
+ }
+
+ $tabs = $new_tabs;
+ }
+
+ return $tabs;
+ }
+
+ /**
+ * Output the JS for building the dynamic Guntenberg block.
+ *
+ * @return mixed
+ *@since 1.0.9 Save numbers as numbers and not strings.
+ * @since 1.1.0 Font Awesome classes can be used for icons.
+ * @since 1.0.4 Added block_wrap property which will set the block wrapping output element ie: div, span, p or empty for no wrap.
+ */
+ public function block() {
+ global $sd_is_js_functions_loaded, $aui_bs5;
+
+ $show_advanced = $this->block_show_advanced();
+
+ ob_start();
+ ?>
+
+ tags for code highlighting, so we strip them from the output.
+ */
+
+ return str_replace( array(
+ ''
+ ), '', $output );
+ }
+
+
+
+ public function block_row_start($key, $args){
+
+ // check for row
+ if(!empty($args['row'])){
+
+ if(!empty($args['row']['open'])){
+
+ // element require
+ $element_require = ! empty( $args['element_require'] ) ? $this->block_props_replace( $args['element_require'], true ) . " && " : "";
+ $device_type = ! empty( $args['device_type'] ) ? esc_attr($args['device_type']) : '';
+ $device_type_require = ! empty( $args['device_type'] ) ? " deviceType == '" . esc_attr($device_type) . "' && " : '';
+ $device_type_icon = '';
+ if($device_type=='Desktop'){
+ $device_type_icon = '" . esc_attr( $this->options['widget_ops']['description'] ) . "
";
+ $arguments_raw = $this->get_arguments();
- }), ";
+ if ( is_array( $arguments_raw ) ) {
+ $arguments = $this->group_arguments( $arguments_raw );
- $value = '""';
- $type = 'MediaUpload';
- $extra .= "onSelect: function(media){
- return props.setAttributes({
- $key: media.url,
- {$key}_id: media.id
- });
- },";
- $extra .= "type: 'image',";
- $extra .= "render: function (obj) {
- return el( 'div',{},
- ( !props.attributes.$key && !props.attributes.{$key}_use_featured ) && el( wp.components.Button, {
- className: 'components-button components-circular-option-picker__clear is-primary is-smallx',
- onClick: obj.open
- },
- 'Upload Image'
- ),
- $img_preview
- props.attributes.$key && el( wp.components.Button, {
- className: 'components-button components-circular-option-picker__clear is-secondary is-small',
- style: {margin:'8px 0',display: 'block'},
- onClick: function(){
- return props.setAttributes({
- $key: '',
- {$key}_id: ''
- });
- }
- },
- props.attributes.$key? 'Clear' : ''
- )
- )
+ // Do we have sections?
+ $has_sections = $arguments == $arguments_raw ? false : true;
+ if ( $has_sections ) {
+ $panel_count = 0;
+ foreach ( $arguments as $key => $args ) {
- }";
- $onchange = "";
+ ?>
+
+ (
- images.push( el('div',{ className: 'col p-2', draggable: 'true', 'data-index': index },
- el('img', {
- src: (upload.sizes && upload.sizes.thumbnail ? upload.sizes.thumbnail.url : upload.url),
- style: { maxWidth:'100%', background: '#ccc', pointerEvents:'none' }
- }),
- el('i',{
- className: 'fas fa-times-circle text-danger position-absolute ml-n2 mt-n1 bg-white rounded-circle c-pointer',
- onClick: function() {
- aui_confirm('".esc_attr__('Are you sure?')."', '".esc_attr__('Delete')."', '".esc_attr__('Cancel')."', true).then(function(confirmed) {
- if (confirmed) {
- let new_uploads = JSON.parse('['+props.attributes.$key+']');
- new_uploads.splice(index, 1);
- return props.setAttributes({ {$key}: JSON.stringify( new_uploads ).replace('[','').replace(']','') });
- }
- });
- }},
- '')
- ))
- ));
- return images;
-})(),";
+ $hide = $panel_count ? ' style="display:none;" ' : '';
+ $icon_class = $panel_count ? 'fas fa-chevron-up' : 'fas fa-chevron-down';
+ echo "";
+ foreach ( $args as $k => $a ) {
- $value = '""';
- $type = 'MediaUpload';
- $extra .= "onSelect: function(media){
- let slim_images = props.attributes.$key ? JSON.parse('['+props.attributes.$key+']') : [];
- if(media.length){
- for (var i=0; i < media.length; i++) {
- slim_images.push({id: media[i].id, caption: media[i].caption, description: media[i].description,title: media[i].title,alt: media[i].alt,sizes: media[i].sizes, url: media[i].url});
- }
- }
- var slimImagesV = JSON.stringify(slim_images);
- if (slimImagesV) {
- slimImagesV = slimImagesV.replace('[','').replace(']','').replace(/'/g, ''');
- }
- return props.setAttributes({ $key: slimImagesV});
-},";
- $extra .= "type: 'image',";
- $extra .= "multiple: true,";
- $extra .= "render: function (obj) {
- /* Init the sort */
- enableDragSort('sd-sortable');
- return el( 'div',{},
- el( wp.components.Button, {
- className: 'components-button components-circular-option-picker__clear is-primary is-smallx',
- onClick: obj.open
- },
- 'Upload Images'
- ),
- el('div',{
- className: 'row row-cols-3 px-2 sd-sortable',
- 'data-field':'$key'
- },
- $img_preview
- ),
- props.attributes.$key && el( wp.components.Button, {
- className: 'components-button components-circular-option-picker__clear is-secondary is-small',
- style: {margin:'8px 0'},
- onClick: function(){
- return props.setAttributes({ $key: '' });
- }
- },
- props.attributes.$key ? 'Clear All' : ''
- )
- )
-}";
- $onchange = "";
+ $this->widget_inputs_row_start($k, $a);
+ $this->widget_inputs( $a, $instance );
+ $this->widget_inputs_row_end($k, $a);
- //$inside_elements = ",el('div',{},'file upload')";
- }
- elseif ( $args['type'] == 'checkbox' ) {
- $type = 'CheckboxControl';
- $extra .= "checked: props.attributes.$key,";
- $onchange = "props.setAttributes({ $key: ! props.attributes.$key } )";
- } elseif ( $args['type'] == 'textarea' ) {
- $type = 'TextareaControl';
-
- } elseif ( $args['type'] == 'select' || $args['type'] == 'multiselect' ) {
- $type = 'SelectControl';
-
- if($args['name'] == 'category' && !empty($args['post_type_linked'])){
- $options .= "options: taxonomies_".str_replace("-","_", $this->id).",";
- }elseif($args['name'] == 'sort_by' && !empty($args['post_type_linked'])){
- $options .= "options: sort_by_".str_replace("-","_", $this->id).",";
- }else {
-
- if ( ! empty( $args['options'] ) ) {
- $options .= "options: [";
- foreach ( $args['options'] as $option_val => $option_label ) {
- $options .= "{ value: '" . esc_attr( $option_val ) . "', label: '" . esc_js( addslashes( $option_label ) ) . "' },";
- }
- $options .= "],";
- }
- }
- if ( isset( $args['multiple'] ) && $args['multiple'] ) { //@todo multiselect does not work at the moment: https://github.com/WordPress/gutenberg/issues/5550
- $extra .= ' multiple:true,style:{height:"auto",paddingRight:"8px","overflow-y":"auto"}, ';
- }
-
- if($args['type'] == 'multiselect' || ( isset( $args['multiple'] ) && $args['multiple'] ) ){
- $after_elements .= "props.attributes.$key && el( wp.components.Button, {
- className: 'components-button components-circular-option-picker__clear is-secondary is-small',
- style: {margin:'-8px 0 8px 0',display: 'block'},
- onClick: function(){
- return props.setAttributes({
- $key: '',
- });
- }
- },
- 'Clear'
- ),";
- }
- } elseif ( $args['type'] == 'tagselect' ) {
-// $type = 'FormTokenField';
-//
-// if ( ! empty( $args['options'] ) ) {
-// $options .= "suggestions: [";
-// foreach ( $args['options'] as $option_val => $option_label ) {
-// $options .= "{ value: '" . esc_attr( $option_val ) . "', title: '" . addslashes( $option_label ) . "' },";
-//// $options .= "'" . esc_attr( $option_val ) . "':'" . addslashes( $option_label ) . "',";
-// }
-// $options .= "],";
-// }
-//
-// $onchangex = "{ ( selectedItems ) => {
-// // Build array of selected posts.
-// let selectedPostsArray = [];
-// selectedPosts.map(
-// ( postName ) => {
-// const matchingPost = posts.find( ( post ) => {
-// return post.title.raw === postName;
-//
-// } );
-// if ( matchingPost !== undefined ) {
-// selectedPostsArray.push( matchingPost.id );
-// }
-// }
-// )
-//
-// setAttributes( { selectedPosts: selectedPostsArray } );
-// } } ";
-// $onchange = '';// "props.setAttributes({ $key: [ props.attributes.$key ] } )";
-//
-//// $options = "";
-// $value = "[]";
-// $extra .= ' __experimentalExpandOnFocus: true,';
+ }
- } else if ( $args['type'] == 'alignment' ) {
- $type = 'AlignmentToolbar'; // @todo this does not seem to work but cant find a example
- } else if ( $args['type'] == 'margins' ) {
-
- } else if ( $args['type'] == 'visibility_conditions' && ( function_exists( 'wp_is_block_theme' ) && wp_is_block_theme() ) ) {
- $type = 'TextControl';
- $value = "(props.attributes.$key ? props.attributes.$key : '')";
- $args['type'] = 'text';
- $options .= 'disabled:true,';
- $bsvc_title = esc_attr( addslashes( $args['title'] ) );
- $bsvc_body = $this->block_visibility_fields( $args );
- // @TODO reset button
- $bsvc_footer = '';
- $after_elements .= "el('div', {className: 'components-base-control bs-vc-button-wrap'}, el(wp.components.Button, {
- className: 'components-button components-circular-option-picker__clear is-primary is-smallx',
- onClick: function() {
- var sValue = props.attributes." . $key . ";
- var oValue;
- try {oValue = JSON.parse(sValue);} catch(err) {}
- jQuery(document).off('show.bs.modal', '.bs-vc-modal').on('show.bs.modal', '.bs-vc-modal', function (e) {
- if (e.target && jQuery(e.target).hasClass('bs-vc-modal')) {
- sd_block_visibility_render_fields(oValue);
- if (!jQuery('.bs-vc-modal-form .bs-vc-rule-sets .bs-vc-rule').length) {
- jQuery('.bs-vc-modal-form .bs-vc-add-rule').trigger('click');
- }
- if(typeof aui_init_select2 == 'function') {
- aui_init_select2();
- }
- jQuery('.bs-vc-modal-form').trigger('change');
- }
- });
- aui_modal('" . $bsvc_title . "', '" . addslashes( $bsvc_body ) . "', '" . $bsvc_footer . "', true, 'bs-vc-modal', 'modal-lg', '');
- jQuery(document).off('change', '#bsvc_raw_value').on('change', '#bsvc_raw_value', function(e) {
- props.setAttributes({" . $key . ": e.target.value});
- });
- }
- },
- '" . addslashes( ! empty( $args['button_title'] ) ? $args['button_title'] : $args['title'] ) . "'
- ) ),";
- } else {
- return;// if we have not implemented the control then don't break the JS.
- }
-
- // color input does not show the labels so we add them
- if($args['type']=='color'){
- // add show only if advanced
- echo $require_advanced;
- // add setting require if defined
- echo $element_require;
- echo "el('div', {style: {'marginBottom': '8px'}}, '".addslashes( $args['title'] )."'),";
- }
-
- // add show only if advanced
- echo $require_advanced;
- // add setting require if defined
- echo $element_require;
- echo $device_type_require;
+ echo "
";
- // icon
- echo $icon;
- ?>
- el( , {
- label: el('label',{className:'components-base-control__label',style:{width:"100%"}},el('span',{dangerouslySetInnerHTML: {__html: ''}}),deviceType == '' && el('span',{dangerouslySetInnerHTML: {__html: ''},title: deviceType + ": Set preview mode to change",style: {right:"0",position:"absolute",color:"var(--wp-admin-theme-color)"}}))'',
- help: ,
- value: ,
-
-
-
-
-
-
-
- onChange: function ( ) {
-
- }
-
- } ),
- $val ) {
- if(is_array($val)){
- $attributes .= $key.': {'.$this->array_to_attributes( $val, $html ).'},';
- }else{
- $attributes .= $html ? " $key='$val' " : "'$key': '$val',";
- }
- }
-
- }
-
- return $attributes;
- }
-
-
-
- /**
- * A self looping function to create the output for JS block elements.
- *
- * This is what is output in the WP Editor visual view.
- *
- * @param $args
- */
- public function block_element( $args, $save = false ) {
-
-
- if ( ! empty( $args ) ) {
- foreach ( $args as $element => $new_args ) {
-
- if ( is_array( $new_args ) ) { // its an element
-
-
- if ( isset( $new_args['element'] ) ) {
-
- if ( isset( $new_args['element_require'] ) ) {
- echo str_replace( array(
- "'+",
- "+'"
- ), '', $this->block_props_replace( $new_args['element_require'] ) ) . " && ";
- unset( $new_args['element_require'] );
- }
+ $panel_count ++;
- if($new_args['element']=='InnerBlocks'){
- echo "\n el( InnerBlocks, {";
- }elseif($new_args['element']=='innerBlocksProps'){
- $element = isset($new_args['inner_element']) ? esc_attr($new_args['inner_element']) : 'div';
- // echo "\n el( 'section', wp.blockEditor.useInnerBlocksProps( blockProps, {";
-// echo $save ? "\n el( '$element', wp.blockEditor.useInnerBlocksProps.save( " : "\n el( '$element', wp.blockEditor.useInnerBlocksProps( ";
- echo $save ? "\n el( '$element', wp.blockEditor.useInnerBlocksProps.save( " : "\n el( '$element', wp.blockEditor.useInnerBlocksProps( ";
- echo $save ? "wp.blockEditor.useBlockProps.save( {" : "wp.blockEditor.useBlockProps( {";
- echo !empty($new_args['blockProps']) ? $this->block_element( $new_args['blockProps'],$save ) : '';
+ }
+ } else {
+ foreach ( $arguments as $key => $args ) {
+ $this->widget_inputs_row_start($key, $args);
+ $this->widget_inputs( $args, $instance );
+ $this->widget_inputs_row_end($key, $args);
+ }
+ }
- echo "} ), {";
- echo !empty($new_args['innerBlocksProps']) && !$save ? $this->block_element( $new_args['innerBlocksProps'],$save ) : '';
- // echo '###';
+ }
+ }
- // echo '###';
- }elseif($new_args['element']=='BlocksProps'){
+ public function widget_inputs_row_start( $key, $args ) {
+ if ( ! empty( $args['row'] ) ) {
+ // Maybe open
+ if ( ! empty( $args['row']['open'] ) ) {
+ ?>
+ ' data-element_require='convert_element_require( $args['row']['element_require'] ) : '' ); ?>'>
+
+
+
+
+
'>
+
+ ";
+ } else {
+ echo "
";
+ }
+ }
+ }
- unset($new_args['inner_element']);
- echo $save ? "\n el( $element, wp.blockEditor.useBlockProps.save( {" : "\n el( $element, wp.blockEditor.useBlockProps( {";
- echo !empty($new_args['blockProps']) ? $this->block_element( $new_args['blockProps'],$save ) : '';
+ public function widget_inputs_row_end( $key, $args ) {
+ if ( ! empty( $args['row'] ) ) {
+ // Maybe close
+ if ( ! empty( $args['row']['close'] ) ) {
+ echo "
";
+ }
+ echo "
";
+ }
+ }
+ /**
+ * Get the hidden input that when added makes the advanced button show on widget settings.
+ *
+ * @return string
+ */
+ public function widget_advanced_toggle() {
- // echo "} ),";
+ $output = '';
+ if ( $this->block_show_advanced() ) {
+ $val = 1;
+ } else {
+ $val = 0;
+ }
- }else{
- echo "\n el( '" . $new_args['element'] . "', {";
- }
+ $output .= "
";
+ return $output;
+ }
- // get the attributes
- foreach ( $new_args as $new_key => $new_value ) {
-
-
- if ( $new_key == 'element' || $new_key == 'content'|| $new_key == 'if_content' || $new_key == 'element_require' || $new_key == 'element_repeat' || is_array( $new_value ) ) {
- // do nothing
- } else {
- echo $this->block_element( array( $new_key => $new_value ),$save );
- }
- }
-
- echo $new_args['element']=='BlocksProps' ? '} ),' : "},";// end attributes
-
- // get the content
- $first_item = 0;
- foreach ( $new_args as $new_key => $new_value ) {
- if ( $new_key === 'content' || $new_key === 'if_content' || is_array( $new_value ) ) {
-
- if ( $new_key === 'content' ) {
- echo "'" . $this->block_props_replace( wp_slash( $new_value ) ) . "'";
- }else if ( $new_key === 'if_content' ) {
- echo $this->block_props_replace( $new_value );
- }
-
- if ( is_array( $new_value ) ) {
-
- if ( isset( $new_value['element_require'] ) ) {
- echo str_replace( array(
- "'+",
- "+'"
- ), '', $this->block_props_replace( $new_value['element_require'] ) ) . " && ";
- unset( $new_value['element_require'] );
- }
-
- if ( isset( $new_value['element_repeat'] ) ) {
- $x = 1;
- while ( $x <= absint( $new_value['element_repeat'] ) ) {
- $this->block_element( array( '' => $new_value ),$save );
- $x ++;
- }
- } else {
- $this->block_element( array( '' => $new_value ),$save );
- }
- }
- $first_item ++;
- }
- }
+ /**
+ * Convert require element.
+ *
+ * @param string $input Input element.
+ *
+ * @return string $output
+ *@since 1.0.0
+ *
+ */
+ public function convert_element_require( $input ) {
+ $input = str_replace( "'", '"', $input );// we only want double quotes
- if($new_args['element']=='innerBlocksProps' || $new_args['element']=='xBlocksProps'){
- echo "))";// end content
- }else{
- echo ")";// end content
+ $output = esc_attr( str_replace( array( "[%", "%]", "%:checked]" ), array(
+ "jQuery(form).find('[data-argument=\"",
+ "\"]').find('input,select,textarea').val()",
+ "\"]').find('input:checked').val()"
+ ), $input ) );
+
+ return $output;
+ }
+
+ /**
+ * Builds the inputs for the widget options.
+ *
+ * @param $args
+ * @param $instance
+ */
+ public function widget_inputs( $args, $instance ) {
+
+ $class = "";
+ $element_require = "";
+ $custom_attributes = "";
+
+ // get value
+ if ( isset( $instance[ $args['name'] ] ) ) {
+ $value = $instance[ $args['name'] ];
+ } elseif ( ! isset( $instance[ $args['name'] ] ) && ! empty( $args['default'] ) ) {
+ $value = is_array( $args['default'] ) ? array_map( "esc_html", $args['default'] ) : esc_html( $args['default'] );
+ } else {
+ $value = '';
+ }
+
+ // get placeholder
+ if ( ! empty( $args['placeholder'] ) ) {
+ $placeholder = "placeholder='" . esc_html( $args['placeholder'] ) . "'";
+ } else {
+ $placeholder = '';
+ }
+
+ // get if advanced
+ if ( isset( $args['advanced'] ) && $args['advanced'] ) {
+ $class .= " sd-advanced-setting ";
+ }
+
+ // element_require
+ if ( isset( $args['element_require'] ) && $args['element_require'] ) {
+ $element_require = $args['element_require'];
+ }
+
+ // custom_attributes
+ if ( isset( $args['custom_attributes'] ) && $args['custom_attributes'] ) {
+ $custom_attributes = $this->array_to_attributes( $args['custom_attributes'], true );
+ }
+
+ // before wrapper
+ ?>
+
' data-element_require='convert_element_require( $element_require );} ?>'>
+
+
+ class="widefat" id="get_field_id( $args['name'] ) ); ?>" name="get_field_name( $args['name'] ) ); ?>" type="" value="">
+
+
+
+
+ class="widefat" id="get_field_id( $args['name'] ) ); ?>" name="get_field_name( $args['name'] ) ); ?>" type="checkbox" value="1">
+
+
+
+
+
+
+
';
+ }elseif($icon=='box-right'){
+ return '
';
+ }elseif($icon=='box-bottom'){
+ return '
';
+ }elseif($icon=='box-left'){
+ return '
';
+ }
+ }
- echo ", \n";
+ /**
+ * Get the widget input description html.
+ *
+ * @param $args
+ *
+ * @return string
+ * @todo, need to make its own tooltip script
+ */
+ public function widget_field_desc( $args ) {
+
+ $description = '';
+ if ( isset( $args['desc'] ) && $args['desc'] ) {
+ if ( isset( $args['desc_tip'] ) && $args['desc_tip'] ) {
+ $description = $this->desc_tip( $args['desc'] );
+ } else {
+ $description = '
' . wp_kses_post( $args['desc'] ) . '';
+ }
+ }
- }
- } else {
+ return $description;
+ }
- if ( substr( $element, 0, 3 ) === "if_" ) {
- $extra = '';
- if( strpos($new_args, '[%WrapClass%]') !== false ){
- $new_args = str_replace('[%WrapClass%]"','" + sd_build_aui_class(props.attributes)',$new_args);
- $new_args = str_replace('[%WrapClass%]','+ sd_build_aui_class(props.attributes)',$new_args);
- }
- echo str_replace( "if_", "", $element ) . ": " . $this->block_props_replace( $new_args, true ) . ",";
- } elseif ( $element == 'style' && strpos($new_args, '[%WrapStyle%]') !== false ) {
- $new_args = str_replace('[%WrapStyle%]','',$new_args);
- echo $element . ": {..." . $this->block_props_replace( $new_args ) . " , ...sd_build_aui_styles(props.attributes) },";
-// echo $element . ": " . $this->block_props_replace( $new_args ) . ",";
- } elseif ( $element == 'style' ) {
- echo $element . ": " . $this->block_props_replace( $new_args ) . ",";
- } elseif ( ( $element == 'class' || $element == 'className' ) && strpos($new_args, '[%WrapClass%]') !== false ) {
- $new_args = str_replace('[%WrapClass%]','',$new_args);
- echo $element . ": '" . $this->block_props_replace( $new_args ) . "' + sd_build_aui_class(props.attributes),";
- } elseif ( $element == 'template' && $new_args ) {
- echo $element . ": $new_args,";
- } else {
- echo $element . ": '" . $this->block_props_replace( $new_args ) . "',";
- }
-
- }
- }
- }
- }
-
- /**
- * Replace block attributes placeholders with the proper naming.
- *
- * @param $string
- *
- * @return mixed
- */
- public function block_props_replace( $string, $no_wrap = false ) {
- if ( $no_wrap ) {
- $string = str_replace( array( "[%", "%]", "%:checked]" ), array( "props.attributes.", "", "" ), $string );
- } else {
- $string = str_replace( array( "![%", "[%", "%]", "%:checked]" ), array( "'+!props.attributes.", "'+props.attributes.", "+'", "+'" ), $string );
- }
-
- return $string;
- }
-
- /**
- * Outputs the content of the widget
- *
- * @param array $args
- * @param array $instance
- */
- public function widget( $args, $instance ) {
- if ( ! is_array( $args ) ) {
- $args = array();
- }
-
- // Get the filtered values
- $argument_values = $this->argument_values( $instance );
- $argument_values = $this->string_to_bool( $argument_values );
- $output = $this->output( $argument_values, $args );
-
- $no_wrap = false;
- if ( isset( $argument_values['no_wrap'] ) && $argument_values['no_wrap'] ) {
- $no_wrap = true;
- }
-
- ob_start();
- if ( $output && ! $no_wrap ) {
-
- $class_original = $this->options['widget_ops']['classname'];
- $class = $this->options['widget_ops']['classname']." sdel-".$this->get_instance_hash();
-
- // Before widget
- $before_widget = ! empty( $args['before_widget'] ) ? $args['before_widget'] : '';
- $before_widget = $before_widget ? str_replace( $class_original, $class, $before_widget ) : $before_widget;
- $before_widget = apply_filters( 'wp_super_duper_before_widget', $before_widget, $args, $instance, $this );
- $before_widget = apply_filters( 'wp_super_duper_before_widget_' . $this->base_id, $before_widget, $args, $instance, $this );
-
- // After widget
- $after_widget = ! empty( $args['after_widget'] ) ? $args['after_widget'] : '';
- $after_widget = apply_filters( 'wp_super_duper_after_widget', $after_widget, $args, $instance, $this );
- $after_widget = apply_filters( 'wp_super_duper_after_widget_' . $this->base_id, $after_widget, $args, $instance, $this );
-
- 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() ) {
- // 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 "
";
- }
- echo $this->output_title( $args, $instance );
- echo $output;
- if ( $this->is_elementor_widget_output() ) {
- echo "";
- }
- echo $after_widget;
- } elseif ( $this->is_preview() && $output == '' ) {// if preview show a placeholder if empty
- $output = $this->preview_placeholder_text( "{{" . $this->base_id . "}}" );
- echo $output;
- } elseif ( $output && $no_wrap ) {
- echo $output;
- }
- $output = ob_get_clean();
-
- $output = apply_filters( 'wp_super_duper_widget_output', $output, $instance, $args, $this );
-
- echo $output;
- }
-
- /**
- * Tests if the current output is inside a elementor container.
- *
- * @return bool
- *@since 1.0.4
- */
- public function is_elementor_widget_output() {
- $result = false;
- if ( defined( 'ELEMENTOR_VERSION' ) && isset( $this->number ) && $this->number == 'REPLACE_TO_ID' ) {
- $result = true;
- }
-
- return $result;
- }
-
- /**
- * Tests if the current output is inside a elementor preview.
- *
- * @return bool
- *@since 1.0.4
- */
- public function is_elementor_preview() {
- $result = false;
- if ( isset( $_REQUEST['elementor-preview'] ) || ( is_admin() && isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'elementor' ) || ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'elementor_ajax' ) ) {
- $result = true;
- }
-
- return $result;
- }
-
- /**
- * Tests if the current output is inside a Divi preview.
- *
- * @return bool
- *@since 1.0.6
- */
- public function is_divi_preview() {
- $result = false;
- if ( isset( $_REQUEST['et_fb'] ) || isset( $_REQUEST['et_pb_preview'] ) || ( is_admin() && isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'elementor' ) ) {
- $result = true;
- }
-
- return $result;
- }
-
- /**
- * Tests if the current output is inside a Beaver builder preview.
- *
- * @return bool
- *@since 1.0.6
- */
- public function is_beaver_preview() {
- $result = false;
- if ( isset( $_REQUEST['fl_builder'] ) ) {
- $result = true;
- }
-
- return $result;
- }
-
- /**
- * Tests if the current output is inside a siteorigin builder preview.
- *
- * @return bool
- *@since 1.0.6
- */
- public function is_siteorigin_preview() {
- $result = false;
- if ( ! empty( $_REQUEST['siteorigin_panels_live_editor'] ) ) {
- $result = true;
- }
-
- return $result;
- }
-
- /**
- * Tests if the current output is inside a cornerstone builder preview.
- *
- * @return bool
- *@since 1.0.8
- */
- public function is_cornerstone_preview() {
- $result = false;
- if ( ! empty( $_REQUEST['cornerstone_preview'] ) || basename( $_SERVER['REQUEST_URI'] ) == 'cornerstone-endpoint' ) {
- $result = true;
- }
-
- return $result;
- }
-
- /**
- * Tests if the current output is inside a fusion builder preview.
- *
- * @return bool
- *@since 1.1.0
- */
- public function is_fusion_preview() {
- $result = false;
- if ( ! empty( $_REQUEST['fb-edit'] ) || ! empty( $_REQUEST['fusion_load_nonce'] ) ) {
- $result = true;
- }
-
- return $result;
- }
-
- /**
- * Tests if the current output is inside a Oxygen builder preview.
- *
- * @return bool
- *@since 1.0.18
- */
- public function is_oxygen_preview() {
- $result = false;
- if ( ! empty( $_REQUEST['ct_builder'] ) || ( ! empty( $_REQUEST['action'] ) && ( substr( $_REQUEST['action'], 0, 11 ) === "oxy_render_" || substr( $_REQUEST['action'], 0, 10 ) === "ct_render_" ) ) ) {
- $result = true;
- }
-
- return $result;
- }
-
- /**
- * Check for Kallyas theme Zion builder preview.
- *
- * @since 1.1.22
- *
- * @return bool True when preview page otherwise false.
- */
- public function is_kallyas_zion_preview() {
- $result = false;
-
- if ( function_exists( 'znhg_kallyas_theme_config' ) && ! empty( $_REQUEST['zn_pb_edit'] ) ) {
- $result = true;
- }
-
- return $result;
- }
-
- /**
- * Check for Bricks theme builder preview.
- *
- * @since 1.1.31
- *
- * @return bool True when preview page otherwise false.
- */
- public function is_bricks_preview() {
- $result = false;
-
- if ( function_exists( 'bricks_is_builder' ) && ( bricks_is_builder() || bricks_is_builder_call() ) ) {
- $result = true;
- }
-
- return $result;
- }
-
- /**
- * General function to check if we are in a preview situation.
- *
- * @return bool
- *@since 1.0.6
- */
- public function is_preview() {
- $preview = false;
- if ( $this->is_divi_preview() ) {
- $preview = true;
- } elseif ( $this->is_elementor_preview() ) {
- $preview = true;
- } elseif ( $this->is_beaver_preview() ) {
- $preview = true;
- } elseif ( $this->is_siteorigin_preview() ) {
- $preview = true;
- } elseif ( $this->is_cornerstone_preview() ) {
- $preview = true;
- } elseif ( $this->is_fusion_preview() ) {
- $preview = true;
- } elseif ( $this->is_oxygen_preview() ) {
- $preview = true;
- } elseif( $this->is_kallyas_zion_preview() ) {
- $preview = true;
- } elseif( $this->is_block_content_call() ) {
- $preview = true;
- } elseif( $this->is_bricks_preview() ) {
- $preview = true;
- }
-
- return $preview;
- }
-
- /**
- * Output the super title.
- *
- * @param $args
- * @param array $instance
- *
- * @return string
- */
- public function output_title( $args, $instance = array() ) {
- $output = '';
- if ( ! empty( $instance['title'] ) ) {
- /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
- $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
-
- if(empty($instance['widget_title_tag'])){
- $output = $args['before_title'] . $title . $args['after_title'];
- }else{
- $title_tag = esc_attr( $instance['widget_title_tag'] );
-
- // classes
- $title_classes = array();
- $title_classes[] = !empty( $instance['widget_title_size_class'] ) ? sanitize_html_class( $instance['widget_title_size_class'] ) : '';
- $title_classes[] = !empty( $instance['widget_title_align_class'] ) ? sanitize_html_class( $instance['widget_title_align_class'] ) : '';
- $title_classes[] = !empty( $instance['widget_title_color_class'] ) ? "text-".sanitize_html_class( $instance['widget_title_color_class'] ) : '';
- $title_classes[] = !empty( $instance['widget_title_border_class'] ) ? sanitize_html_class( $instance['widget_title_border_class'] ) : '';
- $title_classes[] = !empty( $instance['widget_title_border_color_class'] ) ? "border-".sanitize_html_class( $instance['widget_title_border_color_class'] ) : '';
- $title_classes[] = !empty( $instance['widget_title_mt_class'] ) ? "mt-".absint( $instance['widget_title_mt_class'] ) : '';
- $title_classes[] = !empty( $instance['widget_title_mr_class'] ) ? "mr-".absint( $instance['widget_title_mr_class'] ) : '';
- $title_classes[] = !empty( $instance['widget_title_mb_class'] ) ? "mb-".absint( $instance['widget_title_mb_class'] ) : '';
- $title_classes[] = !empty( $instance['widget_title_ml_class'] ) ? "ml-".absint( $instance['widget_title_ml_class'] ) : '';
- $title_classes[] = !empty( $instance['widget_title_pt_class'] ) ? "pt-".absint( $instance['widget_title_pt_class'] ) : '';
- $title_classes[] = !empty( $instance['widget_title_pr_class'] ) ? "pr-".absint( $instance['widget_title_pr_class'] ) : '';
- $title_classes[] = !empty( $instance['widget_title_pb_class'] ) ? "pb-".absint( $instance['widget_title_pb_class'] ) : '';
- $title_classes[] = !empty( $instance['widget_title_pl_class'] ) ? "pl-".absint( $instance['widget_title_pl_class'] ) : '';
-
- $class = !empty( $title_classes ) ? implode(" ",$title_classes) : '';
- $output = "<$title_tag class='$class' >$title$title_tag>";
- }
-
- }
-
- return $output;
- }
-
- /**
- * Outputs the options form inputs for the widget.
- *
- * @param array $instance The widget options.
- */
- public function form( $instance ) {
-
- // set widget instance
- $this->instance = $instance;
-
- // set it as a SD widget
- echo $this->widget_advanced_toggle();
-
- echo "
" . esc_attr( $this->options['widget_ops']['description'] ) . "
";
- $arguments_raw = $this->get_arguments();
-
- if ( is_array( $arguments_raw ) ) {
-
- $arguments = $this->group_arguments( $arguments_raw );
-
- // Do we have sections?
- $has_sections = $arguments == $arguments_raw ? false : true;
-
-
- if ( $has_sections ) {
- $panel_count = 0;
- foreach ( $arguments as $key => $args ) {
-
- ?>
-
- " . esc_attr( $key ) . "
";
- echo "
";
-
- foreach ( $args as $k => $a ) {
-
- $this->widget_inputs_row_start($k, $a);
- $this->widget_inputs( $a, $instance );
- $this->widget_inputs_row_end($k, $a);
-
- }
-
- echo "
";
-
- $panel_count ++;
-
- }
- } else {
- foreach ( $arguments as $key => $args ) {
- $this->widget_inputs_row_start($key, $args);
- $this->widget_inputs( $args, $instance );
- $this->widget_inputs_row_end($key, $args);
- }
- }
-
- }
- }
-
- public function widget_inputs_row_start( $key, $args ) {
- if ( ! empty( $args['row'] ) ) {
- // Maybe open
- if ( ! empty( $args['row']['open'] ) ) {
- ?>
-
' data-element_require='convert_element_require( $args['row']['element_require'] ) : '' ); ?>'>
-
-
-
-
-
'>
-
- ";
- } else {
- echo "
";
- }
- }
- }
-
- public function widget_inputs_row_end( $key, $args ) {
- if ( ! empty( $args['row'] ) ) {
- // Maybe close
- if ( ! empty( $args['row']['close'] ) ) {
- echo "
";
- }
- echo "
";
- }
- }
-
- /**
- * Get the hidden input that when added makes the advanced button show on widget settings.
- *
- * @return string
- */
- public function widget_advanced_toggle() {
-
- $output = '';
- if ( $this->block_show_advanced() ) {
- $val = 1;
- } else {
- $val = 0;
- }
-
- $output .= "
";
-
- return $output;
- }
-
- /**
- * Convert require element.
- *
- * @param string $input Input element.
- *
- * @return string $output
- *@since 1.0.0
- *
- */
- public function convert_element_require( $input ) {
- $input = str_replace( "'", '"', $input );// we only want double quotes
-
- $output = esc_attr( str_replace( array( "[%", "%]", "%:checked]" ), array(
- "jQuery(form).find('[data-argument=\"",
- "\"]').find('input,select,textarea').val()",
- "\"]').find('input:checked').val()"
- ), $input ) );
-
- return $output;
- }
-
- /**
- * Builds the inputs for the widget options.
- *
- * @param $args
- * @param $instance
- */
- public function widget_inputs( $args, $instance ) {
-
- $class = "";
- $element_require = "";
- $custom_attributes = "";
-
- // get value
- if ( isset( $instance[ $args['name'] ] ) ) {
- $value = $instance[ $args['name'] ];
- } elseif ( ! isset( $instance[ $args['name'] ] ) && ! empty( $args['default'] ) ) {
- $value = is_array( $args['default'] ) ? array_map( "esc_html", $args['default'] ) : esc_html( $args['default'] );
- } else {
- $value = '';
- }
-
- // get placeholder
- if ( ! empty( $args['placeholder'] ) ) {
- $placeholder = "placeholder='" . esc_html( $args['placeholder'] ) . "'";
- } else {
- $placeholder = '';
- }
-
- // get if advanced
- if ( isset( $args['advanced'] ) && $args['advanced'] ) {
- $class .= " sd-advanced-setting ";
- }
-
- // element_require
- if ( isset( $args['element_require'] ) && $args['element_require'] ) {
- $element_require = $args['element_require'];
- }
-
- // custom_attributes
- if ( isset( $args['custom_attributes'] ) && $args['custom_attributes'] ) {
- $custom_attributes = $this->array_to_attributes( $args['custom_attributes'], true );
- }
-
- // before wrapper
- ?>
-
' data-element_require='convert_element_require( $element_require );} ?>'>
-
-
- class="widefat" id="get_field_id( $args['name'] ) ); ?>" name="get_field_name( $args['name'] ) ); ?>" type="" value="">
-
-
-
-
- class="widefat" id="get_field_id( $args['name'] ) ); ?>" name="get_field_name( $args['name'] ) ); ?>" type="checkbox" value="1">
-
-
-
-
-
-
-
';
- }elseif($icon=='box-right'){
- return '
';
- }elseif($icon=='box-bottom'){
- return '
';
- }elseif($icon=='box-left'){
- return '
';
- }
- }
-
- /**
- * Get the widget input description html.
- *
- * @param $args
- *
- * @return string
- * @todo, need to make its own tooltip script
- */
- public function widget_field_desc( $args ) {
-
- $description = '';
- if ( isset( $args['desc'] ) && $args['desc'] ) {
- if ( isset( $args['desc_tip'] ) && $args['desc_tip'] ) {
- $description = $this->desc_tip( $args['desc'] );
- } else {
- $description = '
' . wp_kses_post( $args['desc'] ) . '';
- }
- }
-
- return $description;
- }
-
- /**
- * Get the widget input title html.
- *
- * @param $args
- *
- * @return string
- */
- public function widget_field_title( $args ) {
- $title = '';
-
- if ( isset( $args['title'] ) && $args['title'] ) {
- if ( ! empty( $args['device_type'] ) ) {
- $args['title'] .= ' (' . $args['device_type'] . ')'; // Append device type to title.
- }
-
- if ( isset( $args['icon'] ) && $args['icon'] ) {
- $title = self::get_widget_icon( $args['icon'], $args['title'] );
- } else {
- $title = esc_attr( $args['title'] );
- }
- }
-
- return $title;
- }
-
- /**
- * Get the tool tip html.
- *
- * @param $tip
- * @param bool $allow_html
- *
- * @return string
- */
- function desc_tip( $tip, $allow_html = false ) {
- if ( $allow_html ) {
- $tip = $this->sanitize_tooltip( $tip );
- } else {
- $tip = esc_attr( $tip );
- }
-
- return '
';
- }
-
- /**
- * Sanitize a string destined to be a tooltip.
- *
- * @param string $var
- *
- * @return string
- */
- public function sanitize_tooltip( $var ) {
- return htmlspecialchars( wp_kses( html_entity_decode( $var ), array(
- 'br' => array(),
- 'em' => array(),
- 'strong' => array(),
- 'small' => array(),
- 'span' => array(),
- 'ul' => array(),
- 'li' => array(),
- 'ol' => array(),
- 'p' => array(),
- ) ) );
- }
-
- /**
- * Processing widget options on save
- *
- * @param array $new_instance The new options
- * @param array $old_instance The previous options
- *
- * @return array
- * @todo we should add some sanitation here.
- */
- public function update( $new_instance, $old_instance ) {
-
- //save the widget
- $instance = array_merge( (array) $old_instance, (array) $new_instance );
-
- // set widget instance
- $this->instance = $instance;
-
- if ( empty( $this->arguments ) ) {
- $this->get_arguments();
- }
-
- // check for checkboxes
- if ( ! empty( $this->arguments ) ) {
- foreach ( $this->arguments as $argument ) {
- if ( isset( $argument['type'] ) && $argument['type'] == 'checkbox' && ! isset( $new_instance[ $argument['name'] ] ) ) {
- $instance[ $argument['name'] ] = '0';
- }
- }
- }
-
- return $instance;
- }
-
- /**
- * Checks if the current call is a ajax call to get the block content.
- *
- * This can be used in your widget to return different content as the block content.
- *
- * @return bool
- *@since 1.0.3
- */
- public function is_block_content_call() {
- $result = false;
- if ( wp_doing_ajax() && isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'super_duper_output_shortcode' ) {
- $result = true;
- }
-
- return $result;
- }
-
- /**
- * Get an instance hash that will be unique to the type and settings.
- *
- * @return string
- *@since 1.0.20
- */
- public function get_instance_hash(){
- $instance_string = $this->base_id.serialize($this->instance);
- return hash('crc32b',$instance_string);
- }
-
- /**
- * Generate and return inline styles from CSS rules that will match the unique class of the instance.
- *
- * @param array $rules
- *
- * @return string
- *@since 1.0.20
- */
- public function get_instance_style($rules = array()){
- $css = '';
-
- if(!empty($rules)){
- $rules = array_unique($rules);
- $instance_hash = $this->get_instance_hash();
- $css .= "";
- }
-
- return $css;
- }
-
- /**
- * Encode shortcodes tags.
- *
- * @param string $content Content to search for shortcode tags.
- *
+ /**
+ * Get the widget input title html.
+ *
+ * @param $args
+ *
+ * @return string
+ */
+ public function widget_field_title( $args ) {
+ $title = '';
+
+ if ( isset( $args['title'] ) && $args['title'] ) {
+ if ( ! empty( $args['device_type'] ) ) {
+ $args['title'] .= ' (' . $args['device_type'] . ')'; // Append device type to title.
+ }
+
+ if ( isset( $args['icon'] ) && $args['icon'] ) {
+ $title = self::get_widget_icon( $args['icon'], $args['title'] );
+ } else {
+ $title = esc_attr( $args['title'] );
+ }
+ }
+
+ return $title;
+ }
+
+ /**
+ * Get the tool tip html.
+ *
+ * @param $tip
+ * @param bool $allow_html
+ *
+ * @return string
+ */
+ function desc_tip( $tip, $allow_html = false ) {
+ if ( $allow_html ) {
+ $tip = $this->sanitize_tooltip( $tip );
+ } else {
+ $tip = esc_attr( $tip );
+ }
+
+ return '
';
+ }
+
+ /**
+ * Sanitize a string destined to be a tooltip.
+ *
+ * @param string $var
+ *
+ * @return string
+ */
+ public function sanitize_tooltip( $var ) {
+ return htmlspecialchars( wp_kses( html_entity_decode( $var ), array(
+ 'br' => array(),
+ 'em' => array(),
+ 'strong' => array(),
+ 'small' => array(),
+ 'span' => array(),
+ 'ul' => array(),
+ 'li' => array(),
+ 'ol' => array(),
+ 'p' => array(),
+ ) ) );
+ }
+
+ /**
+ * Processing widget options on save
+ *
+ * @param array $new_instance The new options
+ * @param array $old_instance The previous options
+ *
+ * @return array
+ * @todo we should add some sanitation here.
+ */
+ public function update( $new_instance, $old_instance ) {
+
+ //save the widget
+ $instance = array_merge( (array) $old_instance, (array) $new_instance );
+
+ // set widget instance
+ $this->instance = $instance;
+
+ if ( empty( $this->arguments ) ) {
+ $this->get_arguments();
+ }
+
+ // check for checkboxes
+ if ( ! empty( $this->arguments ) ) {
+ foreach ( $this->arguments as $argument ) {
+ if ( isset( $argument['type'] ) && $argument['type'] == 'checkbox' && ! isset( $new_instance[ $argument['name'] ] ) ) {
+ $instance[ $argument['name'] ] = '0';
+ }
+ }
+ }
+
+ return $instance;
+ }
+
+ /**
+ * Checks if the current call is a ajax call to get the block content.
+ *
+ * This can be used in your widget to return different content as the block content.
+ *
+ * @return bool
+ *@since 1.0.3
+ */
+ public function is_block_content_call() {
+ $result = false;
+ if ( wp_doing_ajax() && isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'super_duper_output_shortcode' ) {
+ $result = true;
+ }
+
+ return $result;
+ }
+
+ /**
+ * Get an instance hash that will be unique to the type and settings.
+ *
+ * @return string
+ *@since 1.0.20
+ */
+ public function get_instance_hash(){
+ $instance_string = $this->base_id.serialize($this->instance);
+ return hash('crc32b',$instance_string);
+ }
+
+ /**
+ * Generate and return inline styles from CSS rules that will match the unique class of the instance.
+ *
+ * @param array $rules
+ *
+ * @return string
+ *@since 1.0.20
+ */
+ public function get_instance_style($rules = array()){
+ $css = '';
+
+ if(!empty($rules)){
+ $rules = array_unique($rules);
+ $instance_hash = $this->get_instance_hash();
+ $css .= "";
+ }
+
+ return $css;
+ }
+
+ /**
+ * Encode shortcodes tags.
+ *
+ * @param string $content Content to search for shortcode tags.
+ *
*@return string Content with shortcode tags removed.
- *@since 1.0.28
- *
- */
- public function encode_shortcodes( $content ) {
- // Avoids existing encoded tags.
- $trans = array(
- '[' => '[',
- ']' => ']',
- '[' => '[',
- ']' => ']',
- '<' => '&0lt;',
- '>' => '&0gt;',
- '<' => '&0lt;',
- '>' => '&0gt;',
- );
-
- $content = strtr( $content, $trans );
-
- $trans = array(
- '[' => '[',
- ']' => ']',
- '<' => '<',
- '>' => '>',
- '"' => '"',
- "'" => ''',
- );
-
- $content = strtr( $content, $trans );
-
- return $content;
- }
-
- /**
- * Remove encoded shortcod tags.
- *
- * @param string $content Content to search for shortcode tags.
- *
+ *@since 1.0.28
+ *
+ */
+ public function encode_shortcodes( $content ) {
+ // Avoids existing encoded tags.
+ $trans = array(
+ '[' => '[',
+ ']' => ']',
+ '[' => '[',
+ ']' => ']',
+ '<' => '&0lt;',
+ '>' => '&0gt;',
+ '<' => '&0lt;',
+ '>' => '&0gt;',
+ );
+
+ $content = strtr( $content, $trans );
+
+ $trans = array(
+ '[' => '[',
+ ']' => ']',
+ '<' => '<',
+ '>' => '>',
+ '"' => '"',
+ "'" => ''',
+ );
+
+ $content = strtr( $content, $trans );
+
+ return $content;
+ }
+
+ /**
+ * Remove encoded shortcod tags.
+ *
+ * @param string $content Content to search for shortcode tags.
+ *
*@return string Content with decoded shortcode tags.
- *@since 1.0.28
- *
- */
- public function decode_shortcodes( $content ) {
- $trans = array(
- '[' => '[',
- ']' => ']',
- '[' => '[',
- ']' => ']',
- '<' => '<',
- '>' => '>',
- '<' => '<',
- '>' => '>',
- '"' => '"',
- ''' => "'",
- );
-
- $content = strtr( $content, $trans );
-
- $trans = array(
- '[' => '[',
- ']' => ']',
- '[' => '[',
- ']' => ']',
- '&0lt;' => '<',
- '&0gt;' => '>',
- '&0lt;' => '<',
- '&0gt;' => '>',
- );
-
- $content = strtr( $content, $trans );
-
- return $content;
- }
-
- public function block_visibility_fields( $args ) {
- $value = ! empty( $args['value'] ) ? esc_attr( $args['value'] ) : '';
- $content = '
';
- $content .= '
';
- $content .= '
';
- $content .= '
';
- $content .= '
';
- $content .= aui()->select(
- array(
- 'id' => 'bsvc_rule_BSVCINDEX',
- 'name' => 'bsvc_rule_BSVCINDEX',
- 'label' => __( 'Rule', 'ayecode-connect' ),
- 'placeholder' => __( 'Select Rule...', 'ayecode-connect' ),
- 'class' => 'bsvc_rule form-select-sm no-select2 mw-100',
- 'options' => sd_visibility_rules_options(),
- 'default' => '',
- 'value' => '',
- 'label_type' => '',
- 'select2' => false,
- 'input_group_left' => __( 'Rule:', 'ayecode-connect' ),
- 'extra_attributes' => array(
- 'data-minimum-results-for-search' => '-1'
- )
- )
- );
-
- $content .= '
';
-
- if ( class_exists( 'GeoDirectory' ) ) {
- $content .= '
';
-
- $content .= aui()->select(
- array(
- 'id' => 'bsvc_gd_field_BSVCINDEX',
- 'name' => 'bsvc_gd_field_BSVCINDEX',
- 'label' => __( 'FIELD', 'ayecode-connect' ),
- 'placeholder' => __( 'FIELD', 'ayecode-connect' ),
- 'class' => 'bsvc_gd_field form-select-sm no-select2 mw-100',
- 'options' => sd_visibility_gd_field_options(),
- 'default' => '',
- 'value' => '',
- 'label_type' => '',
- 'select2' => false,
- 'element_require' => '[%bsvc_rule_BSVCINDEX%]=="gd_field"',
- 'extra_attributes' => array(
- 'data-minimum-results-for-search' => '-1'
- )
- )
- );
-
- $content .= '
';
- $content .= '
';
-
- $content .= aui()->select(
- array(
- 'id' => 'bsvc_gd_field_condition_BSVCINDEX',
- 'name' => 'bsvc_gd_field_condition_BSVCINDEX',
- 'label' => __( 'CONDITION', 'ayecode-connect' ),
- 'placeholder' => __( 'CONDITION', 'ayecode-connect' ),
- 'class' => 'bsvc_gd_field_condition form-select-sm no-select2 mw-100',
- 'options' => sd_visibility_field_condition_options(),
- 'default' => '',
- 'value' => '',
- 'label_type' => '',
- 'select2' => false,
- 'element_require' => '[%bsvc_rule_BSVCINDEX%]=="gd_field"',
- 'extra_attributes' => array(
- 'data-minimum-results-for-search' => '-1'
- )
- )
- );
-
- $content .= '
';
- $content .= '
';
-
- $content .= aui()->input(
- array(
- 'type' => 'text',
- 'id' => 'bsvc_gd_field_search_BSVCINDEX',
- 'name' => 'bsvc_gd_field_search_BSVCINDEX',
- 'label' => __( 'VALUE TO MATCH', 'ayecode-connect' ),
- 'class' => 'bsvc_gd_field_search form-control-sm',
- 'placeholder' => __( 'VALUE TO MATCH', 'ayecode-connect' ),
- 'label_type' => '',
- 'value' => '',
- 'element_require' => '([%bsvc_rule_BSVCINDEX%]=="gd_field" && [%bsvc_gd_field_condition_BSVCINDEX%] && [%bsvc_gd_field_condition_BSVCINDEX%]!="is_empty" && [%bsvc_gd_field_condition_BSVCINDEX%]!="is_not_empty")'
- )
- );
-
- $content .= '
';
- }
-
- $content .= '
';
-
- $content .= '
';
- $role_options = sd_user_roles_options();
-
- $role_option_i = 0;
- foreach ( $role_options as $role_option_key => $role_option_name ) {
- $role_option_i++;
-
- $content .= '
';
- $content .= aui()->input(
- array(
- 'id' => 'bsvc_user_roles_BSVCINDEX_' . $role_option_i,
- 'name' => 'bsvc_user_roles_BSVCINDEX[]',
- 'type' => 'checkbox',
- 'label' => $role_option_name,
- 'label_type' => 'hidden',
- 'class' => 'bsvc_user_roles',
- 'value' => $role_option_key,
- 'switch' => 'md',
- 'no_wrap' => true
- )
- );
- $content .= '
';
- }
- $content .= '
';
- $content .= '
';
- $content .= '
';
- $content .= '
';
-
- return $content;
- }
- }
+ *@since 1.0.28
+ *
+ */
+ public function decode_shortcodes( $content ) {
+ $trans = array(
+ '[' => '[',
+ ']' => ']',
+ '[' => '[',
+ ']' => ']',
+ '<' => '<',
+ '>' => '>',
+ '<' => '<',
+ '>' => '>',
+ '"' => '"',
+ ''' => "'",
+ );
+
+ $content = strtr( $content, $trans );
+
+ $trans = array(
+ '[' => '[',
+ ']' => ']',
+ '[' => '[',
+ ']' => ']',
+ '&0lt;' => '<',
+ '&0gt;' => '>',
+ '&0lt;' => '<',
+ '&0gt;' => '>',
+ );
+
+ $content = strtr( $content, $trans );
+
+ return $content;
+ }
+
+ public function block_visibility_fields( $args ) {
+ $value = ! empty( $args['value'] ) ? esc_attr( $args['value'] ) : '';
+ $content = '
';
+ $content .= '
';
+ $content .= '
';
+ $content .= '
';
+ $content .= '
';
+ $content .= aui()->select(
+ array(
+ 'id' => 'bsvc_rule_BSVCINDEX',
+ 'name' => 'bsvc_rule_BSVCINDEX',
+ 'label' => __( 'Rule', 'ayecode-connect' ),
+ 'placeholder' => __( 'Select Rule...', 'ayecode-connect' ),
+ 'class' => 'bsvc_rule form-select-sm no-select2 mw-100',
+ 'options' => sd_visibility_rules_options(),
+ 'default' => '',
+ 'value' => '',
+ 'label_type' => '',
+ 'select2' => false,
+ 'input_group_left' => __( 'Rule:', 'ayecode-connect' ),
+ 'extra_attributes' => array(
+ 'data-minimum-results-for-search' => '-1'
+ )
+ )
+ );
+
+ $content .= '
';
+
+ if ( class_exists( 'GeoDirectory' ) ) {
+ $content .= '
';
+
+ $content .= aui()->select(
+ array(
+ 'id' => 'bsvc_gd_field_BSVCINDEX',
+ 'name' => 'bsvc_gd_field_BSVCINDEX',
+ 'label' => __( 'FIELD', 'ayecode-connect' ),
+ 'placeholder' => __( 'FIELD', 'ayecode-connect' ),
+ 'class' => 'bsvc_gd_field form-select-sm no-select2 mw-100',
+ 'options' => sd_visibility_gd_field_options(),
+ 'default' => '',
+ 'value' => '',
+ 'label_type' => '',
+ 'select2' => false,
+ 'element_require' => '[%bsvc_rule_BSVCINDEX%]=="gd_field"',
+ 'extra_attributes' => array(
+ 'data-minimum-results-for-search' => '-1'
+ )
+ )
+ );
+
+ $content .= '
';
+ $content .= '
';
+
+ $content .= aui()->select(
+ array(
+ 'id' => 'bsvc_gd_field_condition_BSVCINDEX',
+ 'name' => 'bsvc_gd_field_condition_BSVCINDEX',
+ 'label' => __( 'CONDITION', 'ayecode-connect' ),
+ 'placeholder' => __( 'CONDITION', 'ayecode-connect' ),
+ 'class' => 'bsvc_gd_field_condition form-select-sm no-select2 mw-100',
+ 'options' => sd_visibility_field_condition_options(),
+ 'default' => '',
+ 'value' => '',
+ 'label_type' => '',
+ 'select2' => false,
+ 'element_require' => '[%bsvc_rule_BSVCINDEX%]=="gd_field"',
+ 'extra_attributes' => array(
+ 'data-minimum-results-for-search' => '-1'
+ )
+ )
+ );
+
+ $content .= '
';
+ $content .= '
';
+
+ $content .= aui()->input(
+ array(
+ 'type' => 'text',
+ 'id' => 'bsvc_gd_field_search_BSVCINDEX',
+ 'name' => 'bsvc_gd_field_search_BSVCINDEX',
+ 'label' => __( 'VALUE TO MATCH', 'ayecode-connect' ),
+ 'class' => 'bsvc_gd_field_search form-control-sm',
+ 'placeholder' => __( 'VALUE TO MATCH', 'ayecode-connect' ),
+ 'label_type' => '',
+ 'value' => '',
+ 'element_require' => '([%bsvc_rule_BSVCINDEX%]=="gd_field" && [%bsvc_gd_field_condition_BSVCINDEX%] && [%bsvc_gd_field_condition_BSVCINDEX%]!="is_empty" && [%bsvc_gd_field_condition_BSVCINDEX%]!="is_not_empty")'
+ )
+ );
+
+ $content .= '
';
+ }
+
+ $content .= '
';
+
+ $content .= '
';
+ $role_options = sd_user_roles_options();
+
+ $role_option_i = 0;
+ foreach ( $role_options as $role_option_key => $role_option_name ) {
+ $role_option_i++;
+
+ $content .= '
';
+ $content .= aui()->input(
+ array(
+ 'id' => 'bsvc_user_roles_BSVCINDEX_' . $role_option_i,
+ 'name' => 'bsvc_user_roles_BSVCINDEX[]',
+ 'type' => 'checkbox',
+ 'label' => $role_option_name,
+ 'label_type' => 'hidden',
+ 'class' => 'bsvc_user_roles',
+ 'value' => $role_option_key,
+ 'switch' => 'md',
+ 'no_wrap' => true
+ )
+ );
+ $content .= '
';
+ }
+ $content .= '
';
+ $content .= '
';
+ $content .= '
';
+ $content .= '
';
+
+ return $content;
+ }
+ }
}
diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php
index afef3fa2..7824d8f7 100644
--- a/vendor/composer/ClassLoader.php
+++ b/vendor/composer/ClassLoader.php
@@ -42,35 +42,37 @@
*/
class ClassLoader
{
- /** @var ?string */
+ /** @var \Closure(string):void */
+ private static $includeFile;
+
+ /** @var string|null */
private $vendorDir;
// PSR-4
/**
- * @var array[]
- * @psalm-var array
>
+ * @var array>
*/
private $prefixLengthsPsr4 = array();
/**
- * @var array[]
- * @psalm-var array>
+ * @var array>
*/
private $prefixDirsPsr4 = array();
/**
- * @var array[]
- * @psalm-var array
+ * @var list
*/
private $fallbackDirsPsr4 = array();
// PSR-0
/**
- * @var array[]
- * @psalm-var array>
+ * List of PSR-0 prefixes
+ *
+ * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
+ *
+ * @var array>>
*/
private $prefixesPsr0 = array();
/**
- * @var array[]
- * @psalm-var array
+ * @var list
*/
private $fallbackDirsPsr0 = array();
@@ -78,8 +80,7 @@ class ClassLoader
private $useIncludePath = false;
/**
- * @var string[]
- * @psalm-var array
+ * @var array
*/
private $classMap = array();
@@ -87,29 +88,29 @@ class ClassLoader
private $classMapAuthoritative = false;
/**
- * @var bool[]
- * @psalm-var array
+ * @var array
*/
private $missingClasses = array();
- /** @var ?string */
+ /** @var string|null */
private $apcuPrefix;
/**
- * @var self[]
+ * @var array
*/
private static $registeredLoaders = array();
/**
- * @param ?string $vendorDir
+ * @param string|null $vendorDir
*/
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
+ self::initializeIncludeClosure();
}
/**
- * @return string[]
+ * @return array>
*/
public function getPrefixes()
{
@@ -121,8 +122,7 @@ public function getPrefixes()
}
/**
- * @return array[]
- * @psalm-return array>
+ * @return array>
*/
public function getPrefixesPsr4()
{
@@ -130,8 +130,7 @@ public function getPrefixesPsr4()
}
/**
- * @return array[]
- * @psalm-return array
+ * @return list
*/
public function getFallbackDirs()
{
@@ -139,8 +138,7 @@ public function getFallbackDirs()
}
/**
- * @return array[]
- * @psalm-return array
+ * @return list
*/
public function getFallbackDirsPsr4()
{
@@ -148,8 +146,7 @@ public function getFallbackDirsPsr4()
}
/**
- * @return string[] Array of classname => path
- * @psalm-return array
+ * @return array Array of classname => path
*/
public function getClassMap()
{
@@ -157,8 +154,7 @@ public function getClassMap()
}
/**
- * @param string[] $classMap Class to filename map
- * @psalm-param array $classMap
+ * @param array $classMap Class to filename map
*
* @return void
*/
@@ -175,24 +171,25 @@ public function addClassMap(array $classMap)
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
- * @param string $prefix The prefix
- * @param string[]|string $paths The PSR-0 root directories
- * @param bool $prepend Whether to prepend the directories
+ * @param string $prefix The prefix
+ * @param list|string $paths The PSR-0 root directories
+ * @param bool $prepend Whether to prepend the directories
*
* @return void
*/
public function add($prefix, $paths, $prepend = false)
{
+ $paths = (array) $paths;
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
- (array) $paths,
+ $paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
- (array) $paths
+ $paths
);
}
@@ -201,19 +198,19 @@ public function add($prefix, $paths, $prepend = false)
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
- $this->prefixesPsr0[$first][$prefix] = (array) $paths;
+ $this->prefixesPsr0[$first][$prefix] = $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
- (array) $paths,
+ $paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
- (array) $paths
+ $paths
);
}
}
@@ -222,9 +219,9 @@ public function add($prefix, $paths, $prepend = false)
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
- * @param string $prefix The prefix/namespace, with trailing '\\'
- * @param string[]|string $paths The PSR-4 base directories
- * @param bool $prepend Whether to prepend the directories
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param list|string $paths The PSR-4 base directories
+ * @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*
@@ -232,17 +229,18 @@ public function add($prefix, $paths, $prepend = false)
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
+ $paths = (array) $paths;
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
- (array) $paths,
+ $paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
- (array) $paths
+ $paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
@@ -252,18 +250,18 @@ public function addPsr4($prefix, $paths, $prepend = false)
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
- $this->prefixDirsPsr4[$prefix] = (array) $paths;
+ $this->prefixDirsPsr4[$prefix] = $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
- (array) $paths,
+ $paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
- (array) $paths
+ $paths
);
}
}
@@ -272,8 +270,8 @@ public function addPsr4($prefix, $paths, $prepend = false)
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
- * @param string $prefix The prefix
- * @param string[]|string $paths The PSR-0 base directories
+ * @param string $prefix The prefix
+ * @param list|string $paths The PSR-0 base directories
*
* @return void
*/
@@ -290,8 +288,8 @@ public function set($prefix, $paths)
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
- * @param string $prefix The prefix/namespace, with trailing '\\'
- * @param string[]|string $paths The PSR-4 base directories
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param list|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*
@@ -425,7 +423,8 @@ public function unregister()
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
- includeFile($file);
+ $includeFile = self::$includeFile;
+ $includeFile($file);
return true;
}
@@ -476,9 +475,9 @@ public function findFile($class)
}
/**
- * Returns the currently registered loaders indexed by their corresponding vendor directories.
+ * Returns the currently registered loaders keyed by their corresponding vendor directories.
*
- * @return self[]
+ * @return array
*/
public static function getRegisteredLoaders()
{
@@ -555,18 +554,26 @@ private function findFileWithExtension($class, $ext)
return false;
}
-}
-/**
- * Scope isolated include.
- *
- * Prevents access to $this/self from included files.
- *
- * @param string $file
- * @return void
- * @private
- */
-function includeFile($file)
-{
- include $file;
+ /**
+ * @return void
+ */
+ private static function initializeIncludeClosure()
+ {
+ if (self::$includeFile !== null) {
+ return;
+ }
+
+ /**
+ * Scope isolated include.
+ *
+ * Prevents access to $this/self from included files.
+ *
+ * @param string $file
+ * @return void
+ */
+ self::$includeFile = \Closure::bind(static function($file) {
+ include $file;
+ }, null, null);
+ }
}
diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php
index d50e0c9f..51e734a7 100644
--- a/vendor/composer/InstalledVersions.php
+++ b/vendor/composer/InstalledVersions.php
@@ -21,12 +21,14 @@
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
*
* To require its presence, you can require `composer-runtime-api ^2.0`
+ *
+ * @final
*/
class InstalledVersions
{
/**
* @var mixed[]|null
- * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null
+ * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null
*/
private static $installed;
@@ -37,7 +39,7 @@ class InstalledVersions
/**
* @var array[]
- * @psalm-var array}>
+ * @psalm-var array}>
*/
private static $installedByVendor = array();
@@ -96,7 +98,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true)
{
foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
- return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
+ return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
}
}
@@ -117,7 +119,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true)
*/
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
- $constraint = $parser->parseConstraints($constraint);
+ $constraint = $parser->parseConstraints((string) $constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
return $provided->matches($constraint);
@@ -241,7 +243,7 @@ public static function getInstallPath($packageName)
/**
* @return array
- * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
+ * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
*/
public static function getRootPackage()
{
@@ -255,7 +257,7 @@ public static function getRootPackage()
*
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
* @return array[]
- * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}
+ * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}
*/
public static function getRawData()
{
@@ -278,7 +280,7 @@ public static function getRawData()
* Returns the raw data of all installed.php which are currently loaded for custom implementations
*
* @return array[]
- * @psalm-return list}>
+ * @psalm-return list}>
*/
public static function getAllRawData()
{
@@ -301,7 +303,7 @@ public static function getAllRawData()
* @param array[] $data A vendor/composer/installed.php data set
* @return void
*
- * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data
+ * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data
*/
public static function reload($data)
{
@@ -311,7 +313,7 @@ public static function reload($data)
/**
* @return array[]
- * @psalm-return list}>
+ * @psalm-return list}>
*/
private static function getInstalled()
{
@@ -326,7 +328,9 @@ private static function getInstalled()
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
- $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
+ /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */
+ $required = require $vendorDir.'/composer/installed.php';
+ $installed[] = self::$installedByVendor[$vendorDir] = $required;
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
self::$installed = $installed[count($installed) - 1];
}
@@ -338,12 +342,17 @@ private static function getInstalled()
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
- self::$installed = require __DIR__ . '/installed.php';
+ /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */
+ $required = require __DIR__ . '/installed.php';
+ self::$installed = $required;
} else {
self::$installed = array();
}
}
- $installed[] = self::$installed;
+
+ if (self::$installed !== array()) {
+ $installed[] = self::$installed;
+ }
return $installed;
}
diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php
index 9c08f155..3ac14a39 100644
--- a/vendor/composer/autoload_classmap.php
+++ b/vendor/composer/autoload_classmap.php
@@ -2,7 +2,7 @@
// autoload_classmap.php @generated by Composer
-$vendorDir = dirname(dirname(__FILE__));
+$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php
index 05da11ff..ec3143e1 100644
--- a/vendor/composer/autoload_files.php
+++ b/vendor/composer/autoload_files.php
@@ -2,12 +2,12 @@
// autoload_files.php @generated by Composer
-$vendorDir = dirname(dirname(__FILE__));
+$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
+ 'e8d544c98e79f913e13eae1306ab635e' => $vendorDir . '/ayecode/wp-ayecode-ui/ayecode-ui-loader.php',
'942e926b62933a5c0292cfd46ab28c95' => $vendorDir . '/ayecode/wp-country-database/wp-country-database.php',
'24583d3588ebda5228dd453cfaa070da' => $vendorDir . '/ayecode/wp-font-awesome-settings/wp-font-awesome-settings.php',
'42671a413efb740d7040437ff2a982cd' => $vendorDir . '/ayecode/wp-super-duper/sd-functions.php',
- 'e8d544c98e79f913e13eae1306ab635e' => $vendorDir . '/ayecode/wp-ayecode-ui/ayecode-ui-loader.php',
);
diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php
index b7fc0125..15a2ff3a 100644
--- a/vendor/composer/autoload_namespaces.php
+++ b/vendor/composer/autoload_namespaces.php
@@ -2,7 +2,7 @@
// autoload_namespaces.php @generated by Composer
-$vendorDir = dirname(dirname(__FILE__));
+$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php
index 12ea9ccc..e480e283 100644
--- a/vendor/composer/autoload_psr4.php
+++ b/vendor/composer/autoload_psr4.php
@@ -2,7 +2,7 @@
// autoload_psr4.php @generated by Composer
-$vendorDir = dirname(dirname(__FILE__));
+$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php
index de94e76c..75d10120 100644
--- a/vendor/composer/autoload_real.php
+++ b/vendor/composer/autoload_real.php
@@ -25,56 +25,26 @@ public static function getLoader()
require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit3225cff1a6fbcb5c09d8a0b088568404', 'loadClassLoader'), true, true);
- self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit3225cff1a6fbcb5c09d8a0b088568404', 'loadClassLoader'));
- $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
- if ($useStaticLoader) {
- require __DIR__ . '/autoload_static.php';
+ require __DIR__ . '/autoload_static.php';
+ call_user_func(\Composer\Autoload\ComposerStaticInit3225cff1a6fbcb5c09d8a0b088568404::getInitializer($loader));
- call_user_func(\Composer\Autoload\ComposerStaticInit3225cff1a6fbcb5c09d8a0b088568404::getInitializer($loader));
- } else {
- $map = require __DIR__ . '/autoload_namespaces.php';
- foreach ($map as $namespace => $path) {
- $loader->set($namespace, $path);
- }
+ $loader->register(true);
- $map = require __DIR__ . '/autoload_psr4.php';
- foreach ($map as $namespace => $path) {
- $loader->setPsr4($namespace, $path);
- }
+ $filesToLoad = \Composer\Autoload\ComposerStaticInit3225cff1a6fbcb5c09d8a0b088568404::$files;
+ $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
+ if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
+ $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
- $classMap = require __DIR__ . '/autoload_classmap.php';
- if ($classMap) {
- $loader->addClassMap($classMap);
+ require $file;
}
- }
-
- $loader->register(true);
-
- if ($useStaticLoader) {
- $includeFiles = Composer\Autoload\ComposerStaticInit3225cff1a6fbcb5c09d8a0b088568404::$files;
- } else {
- $includeFiles = require __DIR__ . '/autoload_files.php';
- }
- foreach ($includeFiles as $fileIdentifier => $file) {
- composerRequire3225cff1a6fbcb5c09d8a0b088568404($fileIdentifier, $file);
+ }, null, null);
+ foreach ($filesToLoad as $fileIdentifier => $file) {
+ $requireFile($fileIdentifier, $file);
}
return $loader;
}
}
-
-/**
- * @param string $fileIdentifier
- * @param string $file
- * @return void
- */
-function composerRequire3225cff1a6fbcb5c09d8a0b088568404($fileIdentifier, $file)
-{
- if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
- $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
-
- require $file;
- }
-}
diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php
index 3ec88691..7f9860a7 100644
--- a/vendor/composer/autoload_static.php
+++ b/vendor/composer/autoload_static.php
@@ -7,10 +7,10 @@
class ComposerStaticInit3225cff1a6fbcb5c09d8a0b088568404
{
public static $files = array (
+ 'e8d544c98e79f913e13eae1306ab635e' => __DIR__ . '/..' . '/ayecode/wp-ayecode-ui/ayecode-ui-loader.php',
'942e926b62933a5c0292cfd46ab28c95' => __DIR__ . '/..' . '/ayecode/wp-country-database/wp-country-database.php',
'24583d3588ebda5228dd453cfaa070da' => __DIR__ . '/..' . '/ayecode/wp-font-awesome-settings/wp-font-awesome-settings.php',
'42671a413efb740d7040437ff2a982cd' => __DIR__ . '/..' . '/ayecode/wp-super-duper/sd-functions.php',
- 'e8d544c98e79f913e13eae1306ab635e' => __DIR__ . '/..' . '/ayecode/wp-ayecode-ui/ayecode-ui-loader.php',
);
public static $prefixLengthsPsr4 = array (
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 642ad7dd..ce6da437 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -55,20 +55,20 @@
},
{
"name": "ayecode/wp-ayecode-ui",
- "version": "0.2.11",
- "version_normalized": "0.2.11.0",
+ "version": "0.2.12",
+ "version_normalized": "0.2.12.0",
"source": {
"type": "git",
"url": "https://github.com/AyeCode/wp-ayecode-ui.git",
- "reference": "47f6f0ad1b7e2aefe17dc1d6618b8614a4da90c4"
+ "reference": "b0b1d246540e82c9bbcc62bb22fb4b3151df5b06"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/AyeCode/wp-ayecode-ui/zipball/47f6f0ad1b7e2aefe17dc1d6618b8614a4da90c4",
- "reference": "47f6f0ad1b7e2aefe17dc1d6618b8614a4da90c4",
+ "url": "https://api.github.com/repos/AyeCode/wp-ayecode-ui/zipball/b0b1d246540e82c9bbcc62bb22fb4b3151df5b06",
+ "reference": "b0b1d246540e82c9bbcc62bb22fb4b3151df5b06",
"shasum": ""
},
- "time": "2024-04-11T13:06:14+00:00",
+ "time": "2024-04-25T09:26:39+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -97,7 +97,7 @@
],
"support": {
"issues": "https://github.com/AyeCode/wp-ayecode-ui/issues",
- "source": "https://github.com/AyeCode/wp-ayecode-ui/tree/0.2.11"
+ "source": "https://github.com/AyeCode/wp-ayecode-ui/tree/0.2.12"
},
"install-path": "../ayecode/wp-ayecode-ui"
},
@@ -246,24 +246,24 @@
},
{
"name": "ayecode/wp-super-duper",
- "version": "1.1.37",
- "version_normalized": "1.1.37.0",
+ "version": "1.1.39",
+ "version_normalized": "1.1.39.0",
"source": {
"type": "git",
"url": "https://github.com/AyeCode/wp-super-duper.git",
- "reference": "6ec94389d86572b4975c65881c887858fbfe165c"
+ "reference": "b6d557cee33213e8b775d4ec595209bab4b8c440"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/AyeCode/wp-super-duper/zipball/6ec94389d86572b4975c65881c887858fbfe165c",
- "reference": "6ec94389d86572b4975c65881c887858fbfe165c",
+ "url": "https://api.github.com/repos/AyeCode/wp-super-duper/zipball/b6d557cee33213e8b775d4ec595209bab4b8c440",
+ "reference": "b6d557cee33213e8b775d4ec595209bab4b8c440",
"shasum": ""
},
"require": {
"composer/installers": "~1.0",
"php": ">=5.3.0"
},
- "time": "2024-04-11T13:01:09+00:00",
+ "time": "2024-04-18T10:11:36+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -295,7 +295,7 @@
],
"support": {
"issues": "https://github.com/AyeCode/wp-super-duper/issues",
- "source": "https://github.com/AyeCode/wp-super-duper/tree/1.1.37"
+ "source": "https://github.com/AyeCode/wp-super-duper/tree/1.1.39"
},
"install-path": "../ayecode/wp-super-duper"
},
diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php
index 1cbafb92..9aed655f 100644
--- a/vendor/composer/installed.php
+++ b/vendor/composer/installed.php
@@ -1,85 +1,85 @@
array(
+ 'name' => 'ayecode/geodirectory',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
+ 'reference' => 'dbc93f47aed8caa34d2e58ede4a02bcbb3335fe6',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
- 'reference' => '68b6f9d526f7505e5ec321466252449424112fc4',
- 'name' => 'ayecode/geodirectory',
'dev' => true,
),
'versions' => array(
'ayecode/ayecode-connect-helper' => array(
'pretty_version' => '1.0.4',
'version' => '1.0.4.0',
+ 'reference' => 'd9d9ba849b808a38bb23532e7585c4186bc086cd',
'type' => 'library',
'install_path' => __DIR__ . '/../ayecode/ayecode-connect-helper',
'aliases' => array(),
- 'reference' => 'd9d9ba849b808a38bb23532e7585c4186bc086cd',
'dev_requirement' => false,
),
'ayecode/geodirectory' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
+ 'reference' => 'dbc93f47aed8caa34d2e58ede4a02bcbb3335fe6',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
- 'reference' => '68b6f9d526f7505e5ec321466252449424112fc4',
'dev_requirement' => false,
),
'ayecode/wp-ayecode-ui' => array(
- 'pretty_version' => '0.2.11',
- 'version' => '0.2.11.0',
+ 'pretty_version' => '0.2.12',
+ 'version' => '0.2.12.0',
+ 'reference' => 'b0b1d246540e82c9bbcc62bb22fb4b3151df5b06',
'type' => 'library',
'install_path' => __DIR__ . '/../ayecode/wp-ayecode-ui',
'aliases' => array(),
- 'reference' => '47f6f0ad1b7e2aefe17dc1d6618b8614a4da90c4',
'dev_requirement' => false,
),
'ayecode/wp-country-database' => array(
'pretty_version' => '1.0.4',
'version' => '1.0.4.0',
+ 'reference' => 'c23ae6061fe373525ecd069a5069e376ed9b8178',
'type' => 'library',
'install_path' => __DIR__ . '/../ayecode/wp-country-database',
'aliases' => array(),
- 'reference' => 'c23ae6061fe373525ecd069a5069e376ed9b8178',
'dev_requirement' => false,
),
'ayecode/wp-deactivation-survey' => array(
'pretty_version' => '1.0.7',
'version' => '1.0.7.0',
+ 'reference' => '674f19132ca65e88f600dd212b721bbb8967c678',
'type' => 'library',
'install_path' => __DIR__ . '/../ayecode/wp-deactivation-survey',
'aliases' => array(),
- 'reference' => '674f19132ca65e88f600dd212b721bbb8967c678',
'dev_requirement' => false,
),
'ayecode/wp-font-awesome-settings' => array(
'pretty_version' => '1.1.7',
'version' => '1.1.7.0',
+ 'reference' => 'f52f48d05ff760eb1e22e747a2d011c669f25ed1',
'type' => 'library',
'install_path' => __DIR__ . '/../ayecode/wp-font-awesome-settings',
'aliases' => array(),
- 'reference' => 'f52f48d05ff760eb1e22e747a2d011c669f25ed1',
'dev_requirement' => false,
),
'ayecode/wp-super-duper' => array(
- 'pretty_version' => '1.1.37',
- 'version' => '1.1.37.0',
+ 'pretty_version' => '1.1.39',
+ 'version' => '1.1.39.0',
+ 'reference' => 'b6d557cee33213e8b775d4ec595209bab4b8c440',
'type' => 'library',
'install_path' => __DIR__ . '/../ayecode/wp-super-duper',
'aliases' => array(),
- 'reference' => '6ec94389d86572b4975c65881c887858fbfe165c',
'dev_requirement' => false,
),
'composer/installers' => array(
'pretty_version' => '1.x-dev',
'version' => '1.9999999.9999999.9999999-dev',
+ 'reference' => '894a0b5c5d34c88b69b097f2aae1439730fa6836',
'type' => 'composer-plugin',
'install_path' => __DIR__ . '/./installers',
'aliases' => array(),
- 'reference' => '894a0b5c5d34c88b69b097f2aae1439730fa6836',
'dev_requirement' => false,
),
'roundcube/plugin-installer' => array(