403Webshell
Server IP : www.new.bangkokfinder.com  /  Your IP : 172.70.188.39
Web Server : nginx/1.20.1
System : Linux new 4.15.0-159-generic #167-Ubuntu SMP Tue Sep 21 08:55:05 UTC 2021 x86_64
User : bangkokfinder ( 1000)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/bangkokfinder/www/wp-content/plugins/generateblocks/includes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/bangkokfinder/www/wp-content/plugins/generateblocks/includes/class-legacy-attributes.php
<?php
/**
 * Handles legacy attributes that have changed.
 *
 * @package GenerateBlocks
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * Provides a method to define old attributes and serve old settings based on them.
 */
class GenerateBlocks_Legacy_Attributes {
	/**
	 * Get our old defaults that have changed.
	 *
	 * @param string $version The version to get defaults from.
	 */
	public static function get_defaults( $version ) {
		if ( '1.4.0' === $version ) {
			return apply_filters(
				'generateblocks_defaults',
				array(
					'gridContainer' => array(
						'horizontalGap' => 30,
					),
					'container' => array(
						'paddingTop' => '40',
						'paddingRight' => '40',
						'paddingBottom' => '40',
						'paddingLeft' => '40',
						'width' => 50,
						'widthMobile' => 100,
						'gradientDirection' => 90,
						'gradientColorOne' => '#ffffff',
						'gradientColorOneOpacity' => 0.1,
						'gradientColorTwo' => '#000000',
						'gradientColorTwoOpacity' => 0.3,
					),
					'button' => array(
						'gradientDirection' => 90,
						'gradientColorOne' => '#ffffff',
						'gradientColorOneOpacity' => 0.1,
						'gradientColorTwo' => '#000000',
						'gradientColorTwoOpacity' => 0.3,
					),
				)
			);
		}
	}

	/**
	 * Update our settings based on old defaults.
	 *
	 * @param string $version The version to target.
	 * @param string $block The name of the block we're targeting.
	 * @param array  $settings The current settings.
	 * @param array  $atts The block attributes.
	 */
	public static function get_settings( $version, $block, $settings, $atts ) {
		$legacy_defaults = self::get_defaults( $version );

		if ( empty( $legacy_defaults ) ) {
			return $settings;
		}

		if ( '1.4.0' === $version ) {
			if ( 'grid' === $block ) {
				$legacy_settings = wp_parse_args(
					$atts,
					$legacy_defaults['gridContainer']
				);

				$settings['horizontalGap'] = $legacy_settings['horizontalGap'];
			}

			if ( 'container' === $block ) {
				$legacy_settings = wp_parse_args(
					$atts,
					$legacy_defaults['container']
				);

				$settings['paddingTop'] = $legacy_settings['paddingTop'];
				$settings['paddingRight'] = $legacy_settings['paddingRight'];
				$settings['paddingBottom'] = $legacy_settings['paddingBottom'];
				$settings['paddingLeft'] = $legacy_settings['paddingLeft'];
				$settings['width'] = $legacy_settings['width'];
				$settings['widthMobile'] = $legacy_settings['widthMobile'];

				$settings['gradientDirection'] = $legacy_settings['gradientDirection'];
				$settings['gradientColorOne'] = $legacy_settings['gradientColorOne'];
				$settings['gradientColorOneOpacity'] = $legacy_settings['gradientColorOneOpacity'];
				$settings['gradientColorTwo'] = $legacy_settings['gradientColorTwo'];
				$settings['gradientColorTwoOpacity'] = $legacy_settings['gradientColorTwoOpacity'];
			}

			if ( 'button' === $block ) {
				$button_legacy_settings = wp_parse_args(
					$atts,
					$legacy_defaults['button']
				);

				$settings['gradientColorOne'] = $button_legacy_settings['gradientColorOne'];
				$settings['gradientColorOneOpacity'] = $button_legacy_settings['gradientColorOneOpacity'];
				$settings['gradientColorTwo'] = $button_legacy_settings['gradientColorTwo'];
				$settings['gradientColorTwoOpacity'] = $button_legacy_settings['gradientColorTwoOpacity'];
				$settings['gradientDirection'] = $button_legacy_settings['gradientDirection'];
			}
		}

		return $settings;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit