/**
* Copyright (C) 2014-2025 ServMask Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Attribution: This code is part of the All-in-One WP Migration plugin, developed by
*
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
*/
if ( ! defined( 'ABSPATH' ) ) {
die( 'Kangaroos cannot jump here' );
}
class Ai1wm_Export_Content {
public static function execute( $params ) {
// Set archive bytes offset
if ( isset( $params['archive_bytes_offset'] ) ) {
$archive_bytes_offset = (int) $params['archive_bytes_offset'];
} else {
$archive_bytes_offset = ai1wm_archive_bytes( $params );
}
// Set file bytes offset
if ( isset( $params['file_bytes_offset'] ) ) {
$file_bytes_offset = (int) $params['file_bytes_offset'];
} else {
$file_bytes_offset = 0;
}
// Set content bytes offset
if ( isset( $params['content_bytes_offset'] ) ) {
$content_bytes_offset = (int) $params['content_bytes_offset'];
} else {
$content_bytes_offset = 0;
}
// Get processed files size
if ( isset( $params['processed_files_size'] ) ) {
$processed_files_size = (int) $params['processed_files_size'];
} else {
$processed_files_size = 0;
}
// Get total content files size
if ( isset( $params['total_content_files_size'] ) ) {
$total_content_files_size = (int) $params['total_content_files_size'];
} else {
$total_content_files_size = 1;
}
// Get total content files count
if ( isset( $params['total_content_files_count'] ) ) {
$total_content_files_count = (int) $params['total_content_files_count'];
} else {
$total_content_files_count = 1;
}
// What percent of files have we processed?
$progress = (int) min( ( $processed_files_size / $total_content_files_size ) * 100, 100 );
// Set progress
/* translators: 1: Number of files, 2: Progress. */
Ai1wm_Status::info( sprintf( __( 'Archiving %1$d content files...
%2$d%% complete', 'all-in-one-wp-migration' ), $total_content_files_count, $progress ) );
// Flag to hold if file data has been processed
$completed = true;
// Start time
$start = microtime( true );
// Get content list file
$content_list = ai1wm_open( ai1wm_content_list_path( $params ), 'r' );
// Set the file pointer at the current index
if ( fseek( $content_list, $content_bytes_offset ) !== -1 ) {
// Open the archive file for writing
$archive = new Ai1wm_Compressor( ai1wm_archive_path( $params ) );
// Set the file pointer to the one that we have saved
$archive->set_file_pointer( $archive_bytes_offset );
// Loop over files
while ( list( $file_abspath, $file_relpath, $file_size, $file_mtime ) = ai1wm_getcsv( $content_list ) ) {
$file_bytes_written = 0;
// Add file to archive
if ( ( $completed = $archive->add_file( $file_abspath, $file_relpath, $file_bytes_written, $file_bytes_offset ) ) ) {
$file_bytes_offset = 0;
// Get content bytes offset
$content_bytes_offset = ftell( $content_list );
}
// Increment processed files size
$processed_files_size += $file_bytes_written;
// What percent of files have we processed?
$progress = (int) min( ( $processed_files_size / $total_content_files_size ) * 100, 100 );
// Set progress
/* translators: 1: Number of files, 2: Progress. */
Ai1wm_Status::info( sprintf( __( 'Archiving %1$d content files...
%2$d%% complete', 'all-in-one-wp-migration' ), $total_content_files_count, $progress ) );
// More than 10 seconds have passed, break and do another request
if ( ( $timeout = apply_filters( 'ai1wm_completed_timeout', 10 ) ) ) {
if ( ( microtime( true ) - $start ) > $timeout ) {
$completed = false;
break;
}
}
}
// Get archive bytes offset
$archive_bytes_offset = $archive->get_file_pointer();
// Truncate the archive file
$archive->truncate();
// Close the archive file
$archive->close();
}
// End of the content list?
if ( feof( $content_list ) ) {
// Unset archive bytes offset
unset( $params['archive_bytes_offset'] );
// Unset file bytes offset
unset( $params['file_bytes_offset'] );
// Unset content bytes offset
unset( $params['content_bytes_offset'] );
// Unset processed files size
unset( $params['processed_files_size'] );
// Unset total content files size
unset( $params['total_content_files_size'] );
// Unset total content files count
unset( $params['total_content_files_count'] );
// Unset completed flag
unset( $params['completed'] );
} else {
// Set archive bytes offset
$params['archive_bytes_offset'] = $archive_bytes_offset;
// Set file bytes offset
$params['file_bytes_offset'] = $file_bytes_offset;
// Set content bytes offset
$params['content_bytes_offset'] = $content_bytes_offset;
// Set processed files size
$params['processed_files_size'] = $processed_files_size;
// Set total content files size
$params['total_content_files_size'] = $total_content_files_size;
// Set total content files count
$params['total_content_files_count'] = $total_content_files_count;
// Set completed flag
$params['completed'] = $completed;
}
// Close the content list file
ai1wm_close( $content_list );
return $params;
}
}/**
* Astra Updates
*
* Functions for updating data, used by the background updater.
*
* @package Astra
* @version 2.1.3
*/
defined( 'ABSPATH' ) || exit;
/**
* Open Submenu just below menu for existing users.
*
* @since 2.1.3
* @return void
*/
function astra_submenu_below_header() {
$theme_options = get_option( 'astra-settings' );
// Set flag to use flex align center css to open submenu just below menu.
if ( ! isset( $theme_options['submenu-open-below-header'] ) ) {
$theme_options['submenu-open-below-header'] = false;
update_option( 'astra-settings', $theme_options );
}
}
/**
* Do not apply new default colors to the Elementor & Gutenberg Buttons for existing users.
*
* @since 2.2.0
*
* @return void
*/
function astra_page_builder_button_color_compatibility() {
$theme_options = get_option( 'astra-settings', array() );
// Set flag to not load button specific CSS.
if ( ! isset( $theme_options['pb-button-color-compatibility'] ) ) {
$theme_options['pb-button-color-compatibility'] = false;
update_option( 'astra-settings', $theme_options );
}
}
/**
* Migrate option data from button vertical & horizontal padding to the new responsive padding param.
*
* @since 2.2.0
*
* @return void
*/
function astra_vertical_horizontal_padding_migration() {
$theme_options = get_option( 'astra-settings', array() );
$btn_vertical_padding = isset( $theme_options['button-v-padding'] ) ? $theme_options['button-v-padding'] : 10;
$btn_horizontal_padding = isset( $theme_options['button-h-padding'] ) ? $theme_options['button-h-padding'] : 40;
if ( false === astra_get_db_option( 'theme-button-padding', false ) ) {
// Migrate button vertical padding to the new padding param for button.
$theme_options['theme-button-padding'] = array(
'desktop' => array(
'top' => $btn_vertical_padding,
'right' => $btn_horizontal_padding,
'bottom' => $btn_vertical_padding,
'left' => $btn_horizontal_padding,
),
'tablet' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'mobile' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
);
update_option( 'astra-settings', $theme_options );
}
}
/**
* Migrate option data from button url to the new link param.
*
* @since 2.3.0
*
* @return void
*/
function astra_header_button_new_options() {
$theme_options = get_option( 'astra-settings', array() );
$btn_url = isset( $theme_options['header-main-rt-section-button-link'] ) ? $theme_options['header-main-rt-section-button-link'] : 'https://www.wpastra.com';
$theme_options['header-main-rt-section-button-link-option'] = array(
'url' => $btn_url,
'new_tab' => false,
'link_rel' => '',
);
update_option( 'astra-settings', $theme_options );
}
/**
* For existing users, do not provide Elementor Default Color Typo settings compatibility by default.
*
* @since 2.3.3
*
* @return void
*/
function astra_elementor_default_color_typo_comp() {
$theme_options = get_option( 'astra-settings', array() );
// Set flag to not load button specific CSS.
if ( ! isset( $theme_options['ele-default-color-typo-setting-comp'] ) ) {
$theme_options['ele-default-color-typo-setting-comp'] = false;
update_option( 'astra-settings', $theme_options );
}
}
/**
* For existing users, change the separator from html entity to css entity.
*
* @since 2.3.4
*
* @return void
*/
function astra_breadcrumb_separator_fix() {
$theme_options = get_option( 'astra-settings', array() );
// Check if the saved database value for Breadcrumb Separator is "»", then change it to '\00bb'.
if ( isset( $theme_options['breadcrumb-separator'] ) && '»' === $theme_options['breadcrumb-separator'] ) {
$theme_options['breadcrumb-separator'] = '\00bb';
update_option( 'astra-settings', $theme_options );
}
}
/**
* Check if we need to change the default value for tablet breakpoint.
*
* @since 2.4.0
* @return void
*/
function astra_update_theme_tablet_breakpoint() {
$theme_options = get_option( 'astra-settings' );
if ( ! isset( $theme_options['can-update-theme-tablet-breakpoint'] ) ) {
// Set a flag to check if we need to change the theme tablet breakpoint value.
$theme_options['can-update-theme-tablet-breakpoint'] = false;
}
update_option( 'astra-settings', $theme_options );
}
/**
* Migrate option data from site layout background option to its desktop counterpart.
*
* @since 2.4.0
*
* @return void
*/
function astra_responsive_base_background_option() {
$theme_options = get_option( 'astra-settings', array() );
if ( false === get_option( 'site-layout-outside-bg-obj-responsive', false ) && isset( $theme_options['site-layout-outside-bg-obj'] ) ) {
$theme_options['site-layout-outside-bg-obj-responsive']['desktop'] = $theme_options['site-layout-outside-bg-obj'];
$theme_options['site-layout-outside-bg-obj-responsive']['tablet'] = array(
'background-color' => '',
'background-image' => '',
'background-repeat' => 'repeat',
'background-position' => 'center center',
'background-size' => 'auto',
'background-attachment' => 'scroll',
);
$theme_options['site-layout-outside-bg-obj-responsive']['mobile'] = array(
'background-color' => '',
'background-image' => '',
'background-repeat' => 'repeat',
'background-position' => 'center center',
'background-size' => 'auto',
'background-attachment' => 'scroll',
);
}
update_option( 'astra-settings', $theme_options );
}
/**
* Do not apply new wide/full image CSS for existing users.
*
* @since 2.4.4
*
* @return void
*/
function astra_gtn_full_wide_image_group_css() {
$theme_options = get_option( 'astra-settings', array() );
// Set flag to not load button specific CSS.
if ( ! isset( $theme_options['gtn-full-wide-image-grp-css'] ) ) {
$theme_options['gtn-full-wide-image-grp-css'] = false;
update_option( 'astra-settings', $theme_options );
}
}
/**
* Do not apply new wide/full Group and Cover block CSS for existing users.
*
* @since 2.5.0
*
* @return void
*/
function astra_gtn_full_wide_group_cover_css() {
$theme_options = get_option( 'astra-settings', array() );
if ( ! isset( $theme_options['gtn-full-wide-grp-cover-css'] ) ) {
$theme_options['gtn-full-wide-grp-cover-css'] = false;
update_option( 'astra-settings', $theme_options );
}
}
/**
* Do not apply the global border width and border color setting for the existng users.
*
* @since 2.5.0
*
* @return void
*/
function astra_global_button_woo_css() {
$theme_options = get_option( 'astra-settings', array() );
// Set flag to not load button specific CSS.
if ( ! isset( $theme_options['global-btn-woo-css'] ) ) {
$theme_options['global-btn-woo-css'] = false;
update_option( 'astra-settings', $theme_options );
}
}
/**
* Migrate Footer Widget param to array.
*
* @since 2.5.2
*
* @return void
*/
function astra_footer_widget_bg() {
$theme_options = get_option( 'astra-settings', array() );
// Check if Footer Backgound array is already set or not. If not then set it as array.
if ( isset( $theme_options['footer-adv-bg-obj'] ) && ! is_array( $theme_options['footer-adv-bg-obj'] ) ) {
$theme_options['footer-adv-bg-obj'] = array(
'background-color' => '',
'background-image' => '',
'background-repeat' => 'repeat',
'background-position' => 'center center',
'background-size' => 'auto',
'background-attachment' => 'scroll',
);
update_option( 'astra-settings', $theme_options );
}
}
/**
* Migrate Background control options to new array.
*
* @since 2.6.0
*
* @return void
*/
function astra_bg_control_migration() {
$db_options = array(
'footer-adv-bg-obj',
'footer-bg-obj',
'sidebar-bg-obj',
);
$theme_options = get_option( 'astra-settings', array() );
foreach ( $db_options as $option_name ) {
if ( ! ( isset( $theme_options[ $option_name ]['background-type'] ) && isset( $theme_options[ $option_name ]['background-media'] ) ) && isset( $theme_options[ $option_name ] ) ) {
if ( ! empty( $theme_options[ $option_name ]['background-image'] ) ) {
$theme_options[ $option_name ]['background-type'] = 'image';
$theme_options[ $option_name ]['background-media'] = attachment_url_to_postid( $theme_options[ $option_name ]['background-image'] );
} else {
$theme_options[ $option_name ]['background-type'] = '';
$theme_options[ $option_name ]['background-media'] = '';
}
update_option( 'astra-settings', $theme_options );
}
}
}
/**
* Migrate Background Responsive options to new array.
*
* @since 2.6.0
*
* @return void
*/
function astra_bg_responsive_control_migration() {
$db_options = array(
'site-layout-outside-bg-obj-responsive',
'content-bg-obj-responsive',
'header-bg-obj-responsive',
'primary-menu-bg-obj-responsive',
'above-header-bg-obj-responsive',
'above-header-menu-bg-obj-responsive',
'below-header-bg-obj-responsive',
'below-header-menu-bg-obj-responsive',
);
$theme_options = get_option( 'astra-settings', array() );
foreach ( $db_options as $option_name ) {
if ( ! ( isset( $theme_options[ $option_name ]['desktop']['background-type'] ) && isset( $theme_options[ $option_name ]['desktop']['background-media'] ) ) && isset( $theme_options[ $option_name ] ) ) {
if ( ! empty( $theme_options[ $option_name ]['desktop']['background-image'] ) ) {
$theme_options[ $option_name ]['desktop']['background-type'] = 'image';
$theme_options[ $option_name ]['desktop']['background-media'] = attachment_url_to_postid( $theme_options[ $option_name ]['desktop']['background-image'] );
} else {
$theme_options[ $option_name ]['desktop']['background-type'] = '';
$theme_options[ $option_name ]['desktop']['background-media'] = '';
}
if ( ! empty( $theme_options[ $option_name ]['tablet']['background-image'] ) ) {
$theme_options[ $option_name ]['tablet']['background-type'] = 'image';
$theme_options[ $option_name ]['tablet']['background-media'] = attachment_url_to_postid( $theme_options[ $option_name ]['tablet']['background-image'] );
} else {
$theme_options[ $option_name ]['tablet']['background-type'] = '';
$theme_options[ $option_name ]['tablet']['background-media'] = '';
}
if ( ! empty( $theme_options[ $option_name ]['mobile']['background-image'] ) ) {
$theme_options[ $option_name ]['mobile']['background-type'] = 'image';
$theme_options[ $option_name ]['mobile']['background-media'] = attachment_url_to_postid( $theme_options[ $option_name ]['mobile']['background-image'] );
} else {
$theme_options[ $option_name ]['mobile']['background-type'] = '';
$theme_options[ $option_name ]['mobile']['background-media'] = '';
}
update_option( 'astra-settings', $theme_options );
}
}
}
/**
* Do not apply new Group, Column and Media & Text block CSS for existing users.
*
* @since 2.6.0
*
* @return void
*/
function astra_gutenberg_core_blocks_design_compatibility() {
$theme_options = get_option( 'astra-settings', array() );
if ( ! isset( $theme_options['guntenberg-core-blocks-comp-css'] ) ) {
$theme_options['guntenberg-core-blocks-comp-css'] = false;
update_option( 'astra-settings', $theme_options );
}
}/**
* Admin functions - Functions that add some functionality to WordPress admin panel
*
* @package Astra
* @since 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Register menus
*/
if ( ! function_exists( 'astra_register_menu_locations' ) ) {
/**
* Register menus
*
* @since 1.0.0
*/
function astra_register_menu_locations() {
/**
* Menus
*/
register_nav_menus(
array(
'primary' => __( 'Primary Menu', 'astra' ),
'footer_menu' => __( 'Footer Menu', 'astra' ),
)
);
}
}
add_action( 'init', 'astra_register_menu_locations' );/**
* Deprecated Functions of Astra Theme.
*
* @package Astra
* @author Astra
* @copyright Copyright (c) 2020, Astra
* @link https://wpastra.com/
* @since Astra 1.0.23
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! function_exists( 'astra_blog_post_thumbnai_and_title_order' ) ) :
/**
* Blog post thumbnail & title order
*
* @since 1.4.9
* @deprecated 1.4.9 Use astra_blog_post_thumbnail_and_title_order()
* @see astra_blog_post_thumbnail_and_title_order()
*
* @return void
*/
function astra_blog_post_thumbnai_and_title_order() {
_deprecated_function( __FUNCTION__, '1.4.9', 'astra_blog_post_thumbnail_and_title_order()' );
astra_blog_post_thumbnail_and_title_order();
}
endif;
if ( ! function_exists( 'get_astra_secondary_class' ) ) :
/**
* Retrieve the classes for the secondary element as an array.
*
* @since 1.5.2
* @deprecated 1.5.2 Use astra_get_secondary_class()
* @param string|array $class One or more classes to add to the class list.
* @see astra_get_secondary_class()
*
* @return array
*/
function get_astra_secondary_class( $class = '' ) {
_deprecated_function( __FUNCTION__, '1.5.2', 'astra_get_secondary_class()' );
return astra_get_secondary_class( $class );
}
endif;
if ( ! function_exists( 'deprecated_astra_color_palette' ) ) :
/**
* Depreciating astra_color_palletes filter.
*
* @since 1.5.2
* @deprecated 1.5.2 Use astra_deprecated_color_palette()
* @param array $color_palette customizer color palettes.
* @see astra_deprecated_color_palette()
*
* @return array
*/
function deprecated_astra_color_palette( $color_palette ) {
_deprecated_function( __FUNCTION__, '1.5.2', 'astra_deprecated_color_palette()' );
return astra_deprecated_color_palette( $color_palette );
}
endif;
if ( ! function_exists( 'deprecated_astra_sigle_post_navigation_enabled' ) ) :
/**
* Deprecating astra_sigle_post_navigation_enabled filter.
*
* @since 1.5.2
* @deprecated 1.5.2 Use astra_deprecated_sigle_post_navigation_enabled()
* @param boolean $post_nav true | false.
* @see astra_deprecated_sigle_post_navigation_enabled()
*
* @return array
*/
function deprecated_astra_sigle_post_navigation_enabled( $post_nav ) {
_deprecated_function( __FUNCTION__, '1.5.2', 'astra_deprecated_sigle_post_navigation_enabled()' );
return astra_deprecated_sigle_post_navigation_enabled( $post_nav );
}
endif;
if ( ! function_exists( 'deprecated_astra_primary_header_main_rt_section' ) ) :
/**
* Deprecating astra_primary_header_main_rt_section filter.
*
* @since 1.5.2
* @deprecated 1.5.2 Use astra_deprecated_primary_header_main_rt_section()
* @param array $elements List of elements.
* @param string $header Header section type.
* @see astra_deprecated_primary_header_main_rt_section()
*
* @return array
*/
function deprecated_astra_primary_header_main_rt_section( $elements, $header ) {
_deprecated_function( __FUNCTION__, '1.5.2', 'astra_deprecated_primary_header_main_rt_section()' );
return astra_deprecated_primary_header_main_rt_section( $elements, $header );
}
endif;
if ( ! function_exists( 'astar' ) ) :
/**
* Get a specific property of an array without needing to check if that property exists.
*
* @since 1.5.2
* @deprecated 1.5.2 Use astra_get_prop()
* @param array $array Array from which the property's value should be retrieved.
* @param string $prop Name of the property to be retrieved.
* @param string $default Optional. Value that should be returned if the property is not set or empty. Defaults to null.
* @see astra_get_prop()
*
* @return null|string|mixed The value
*/
function astar( $array, $prop, $default = null ) {
return astra_get_prop( $array, $prop, $default );
}
endif;
/**
* Check if we're being delivered AMP.
*
* @return bool
*/
function astra_is_emp_endpoint() {
_deprecated_function( __FUNCTION__, '2.0.1', 'astra_is_amp_endpoint()' );
return astra_is_amp_endpoint();
}namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Elementor skin base.
*
* An abstract class to register new skins for Elementor widgets. Skins allows
* you to add new templates, set custom controls and more.
*
* To register new skins for your widget use the `add_skin()` method inside the
* widget's `register_skins()` method.
*
* @since 1.0.0
* @abstract
*/
abstract class Skin_Base extends Sub_Controls_Stack {
/**
* Parent widget.
*
* Holds the parent widget of the skin. Default value is null, no parent widget.
*
* @access protected
*
* @var Widget_Base|null
*/
protected $parent = null;
/**
* Skin base constructor.
*
* Initializing the skin base class by setting parent widget and registering
* controls actions.
*
* @since 1.0.0
* @access public
* @param Widget_Base $element_parent
*/
public function __construct( Widget_Base $element_parent ) {
parent::__construct( $element_parent );
$this->_register_controls_actions();
}
/**
* Render skin.
*
* Generates the final HTML on the frontend.
*
* @since 1.0.0
* @access public
* @abstract
*/
abstract public function render();
/**
* Render element in static mode.
*
* If not inherent will call the base render.
*/
public function render_static() {
$this->render();
}
/**
* Determine the render logic.
*/
public function render_by_mode() {
if ( Plugin::$instance->frontend->is_static_render_mode() ) {
$this->render_static();
return;
}
$this->render();
}
/**
* Register skin controls actions.
*
* Run on init and used to register new skins to be injected to the widget.
* This method is used to register new actions that specify the location of
* the skin in the widget.
*
* Example usage:
* `add_action( 'elementor/element/{widget_id}/{section_id}/before_section_end', [ $this, 'register_controls' ] );`
*
* @since 1.0.0
* @access protected
*/
protected function _register_controls_actions() {}
/**
* Get skin control ID.
*
* Retrieve the skin control ID. Note that skin controls have special prefix
* to distinguish them from regular controls, and from controls in other
* skins.
*
* @since 1.0.0
* @access protected
*
* @param string $control_base_id Control base ID.
*
* @return string Control ID.
*/
protected function get_control_id( $control_base_id ) {
$skin_id = str_replace( '-', '_', $this->get_id() );
return $skin_id . '_' . $control_base_id;
}
/**
* Get skin settings.
*
* Retrieve all the skin settings or, when requested, a specific setting.
*
* @since 1.0.0
* @TODO: rename to get_setting() and create backward compatibility.
*
* @access public
*
* @param string $control_base_id Control base ID.
*
* @return mixed
*/
public function get_instance_value( $control_base_id ) {
$control_id = $this->get_control_id( $control_base_id );
return $this->parent->get_settings( $control_id );
}
/**
* Start skin controls section.
*
* Used to add a new section of controls to the skin.
*
* @since 1.3.0
* @access public
*
* @param string $id Section ID.
* @param array $args Section arguments.
*/
public function start_controls_section( $id, $args = [] ) {
$args['condition']['_skin'] = $this->get_id();
parent::start_controls_section( $id, $args );
}
/**
* Add new skin control.
*
* Register a single control to the allow the user to set/update skin data.
*
* @param string $id Control ID.
* @param array $args Control arguments.
* @param array $options
*
* @return bool True if skin added, False otherwise.
* @since 3.0.0 New `$options` parameter added.
* @access public
*/
public function add_control( $id, $args = [], $options = [] ) {
$args['condition']['_skin'] = $this->get_id();
return parent::add_control( $id, $args, $options );
}
/**
* Update skin control.
*
* Change the value of an existing skin control.
*
* @since 1.3.0
* @since 1.8.1 New `$options` parameter added.
*
* @access public
*
* @param string $id Control ID.
* @param array $args Control arguments. Only the new fields you want to update.
* @param array $options Optional. Some additional options.
*/
public function update_control( $id, $args, array $options = [] ) {
$args['condition']['_skin'] = $this->get_id();
parent::update_control( $id, $args, $options );
}
/**
* Add new responsive skin control.
*
* Register a set of controls to allow editing based on user screen size.
*
* @param string $id Responsive control ID.
* @param array $args Responsive control arguments.
* @param array $options
*
* @since 1.0.5
* @access public
*/
public function add_responsive_control( $id, $args, $options = [] ) {
$args['condition']['_skin'] = $this->get_id();
parent::add_responsive_control( $id, $args );
}
/**
* Start skin controls tab.
*
* Used to add a new tab inside a group of tabs.
*
* @since 1.5.0
* @access public
*
* @param string $id Control ID.
* @param array $args Control arguments.
*/
public function start_controls_tab( $id, $args ) {
$args['condition']['_skin'] = $this->get_id();
parent::start_controls_tab( $id, $args );
}
/**
* Start skin controls tabs.
*
* Used to add a new set of tabs inside a section.
*
* @since 1.5.0
* @access public
*
* @param string $id Control ID.
*/
public function start_controls_tabs( $id ) {
$args['condition']['_skin'] = $this->get_id();
parent::start_controls_tabs( $id );
}
/**
* Add new group control.
*
* Register a set of related controls grouped together as a single unified
* control.
*
* @param string $group_name Group control name.
* @param array $args Group control arguments. Default is an empty array.
* @param array $options
*
* @since 1.0.0
* @access public
*/
final public function add_group_control( $group_name, $args = [], $options = [] ) {
$args['condition']['_skin'] = $this->get_id();
parent::add_group_control( $group_name, $args );
}
/**
* Set parent widget.
*
* Used to define the parent widget of the skin.
*
* @since 1.0.0
* @access public
*
* @param Widget_Base $element_parent Parent widget.
*/
public function set_parent( $element_parent ) {
$this->parent = $element_parent;
}
}