data = Avada()->settings->get_all(); add_action( 'add_meta_boxes', [ $this, 'add_meta_boxes' ], 11 ); add_action( 'save_post', [ $this, 'save_meta_boxes' ], 10, 3 ); add_action( 'admin_enqueue_scripts', [ $this, 'admin_script_loader' ], 99 ); add_filter( 'awb_metaboxes_sections', [ $this, 'filter_sections' ] ); add_filter( 'awb_responsive_params', [ $this, 'add_responsive_params' ], 10, 2 ); add_filter( 'awb_states_params', [ $this, 'add_states_params' ], 10, 2 ); } /** * Get value for a setting. * * @access protected * @since 6.2.0 * @param string $id The option-ID. * @return mixed */ protected function get_value( $id ) { global $post; $override_value = apply_filters( 'awb_po_get_value', null, $id ); if ( null !== $override_value ) { return $override_value; } if ( ! $post ) { return ''; } return fusion_data()->post_meta( $post->ID )->get( $id ); } /** * Format the option-name for use in our $_POST data. * * @access protected * @since 6.2.0 * @param string $id The option-ID. * @return string */ protected function format_option_name( $id ) { $override_name = apply_filters( 'awb_po_get_option_name', null, $id ); if ( null !== $override_name ) { return $override_name; } if ( false !== strpos( $id, '[' ) ) { $parts = explode( '[', $id ); return Fusion_Data_PostMeta::ROOT . '[' . $parts[0] . '][' . $parts[1]; } return Fusion_Data_PostMeta::ROOT . '[' . $id . ']'; } /** * Load backend scripts. * * @access public */ public function admin_script_loader() { $screen = get_current_screen(); if ( isset( $screen->post_type ) && in_array( $screen->post_type, apply_filters( 'avada_hide_page_options', [] ) ) ) { // phpcs:ignore WordPress.PHP.StrictInArray return; } $theme_info = wp_get_theme(); wp_enqueue_script( 'jquery.biscuit', Avada::$template_dir_url . '/assets/admin/js/jquery.biscuit.js', [ 'jquery' ], $theme_info->get( 'Version' ), false ); wp_register_script( 'avada_upload', Avada::$template_dir_url . '/assets/admin/js/upload.js', [ 'jquery' ], $theme_info->get( 'Version' ), false ); wp_enqueue_script( 'avada_upload' ); wp_enqueue_script( 'media-upload' ); wp_enqueue_script( 'thickbox' ); wp_enqueue_style( 'thickbox' ); wp_enqueue_script( 'jquery-ui-core' ); wp_enqueue_script( 'jquery-ui-tabs' ); wp_enqueue_script( 'jquery-ui-widget' ); wp_enqueue_script( 'jquery-ui-button' ); // Select field assets. wp_dequeue_script( 'tribe-events-select2' ); wp_enqueue_style( 'select2-css', Avada::$template_dir_url . '/assets/admin/css/select2.css', [], $theme_info->get( 'Version' ), 'all' ); wp_enqueue_script( 'selectwoo-js', Avada::$template_dir_url . '/assets/admin/js/selectWoo.full.min.js', [ 'jquery' ], $theme_info->get( 'Version' ), false ); // Range field assets. wp_enqueue_style( 'avadaredux-nouislider-css', FUSION_LIBRARY_URL . '/inc/redux/framework/FusionReduxCore/inc/fields/slider/vendor/nouislider/fusionredux.jquery.nouislider.css', [], $theme_info->get( 'Version' ), 'all' ); wp_enqueue_script( 'avadaredux-nouislider-js', Avada::$template_dir_url . '/assets/admin/js/jquery.nouislider.min.js', [ 'jquery' ], $theme_info->get( 'Version' ), true ); wp_enqueue_script( 'wnumb-js', Avada::$template_dir_url . '/assets/admin/js/wNumb.js', [ 'jquery' ], $theme_info->get( 'Version' ), true ); wp_enqueue_script( 'icon-picker', Avada::$template_dir_url . '/assets/admin/js/icon-picker.js', [ 'jquery' ], $theme_info->get( 'Version' ), true ); // Color fields. if ( function_exists( 'AWB_Global_Colors' ) ) { AWB_Global_Colors()->enqueue(); } // General JS for fields. wp_enqueue_script( 'avada-fusion-options', Avada::$template_dir_url . '/assets/admin/js/avada-fusion-options.js', [ 'jquery', 'jquery-ui-sortable' ], $theme_info->get( 'Version' ), false ); do_action( 'avada_page_option_scripts', $screen->post_type ); } /** * Gets the tabs for post type. * * @access public * @param string $posttype post type. * @since 6.0 */ public static function get_pagetype_tab( $posttype = false ) { $pagetype_data = [ 'page' => [ 'page', 'header', 'sliders', 'pagetitlebar', 'content', 'sidebars', 'footer', 'seo', 'code_fields' ], 'post' => [ 'post', 'page', 'header', 'sliders', 'pagetitlebar', 'content', 'sidebars', 'footer', 'seo', 'code_fields' ], 'avada_faq' => [ 'post', 'page', 'header', 'sliders', 'pagetitlebar', 'content', 'sidebars', 'footer' ], 'avada_portfolio' => [ 'portfolio_post', 'page', 'header', 'sliders', 'pagetitlebar', 'content', 'sidebars', 'footer', 'seo', 'code_fields' ], 'product' => [ 'page', 'header', 'sliders', 'pagetitlebar', 'content', 'sidebars', 'footer', 'seo', 'code_fields' ], 'tribe_events' => [ 'page', 'header', 'sliders', 'pagetitlebar', 'content', 'sidebars', 'footer', 'seo', 'code_fields' ], 'fusion_tb_section' => [ 'template', 'content', 'sidebars' ], 'fusion_form' => [ 'form_general', 'form_appearance', 'form_submission', 'form_notifications', 'form_confirmation', 'form_steps', 'form_privacy' ], 'awb_off_canvas' => [ 'template', 'off_canvas_general', 'off_canvas_design', 'off_canvas_overlay', 'off_canvas_close', 'off_canvas_animation', 'off_canvas_conditions', 'off_canvas_triggers', 'off_canvas_rules', 'code_fields' ], 'fusion_element' => [], 'fusion_template' => [ 'content', 'page', 'fusion_template' ], 'post_card' => [ 'template' ], 'mega_menu' => [ 'template' ], 'default' => [ 'post', 'page', 'header', 'sliders', 'pagetitlebar', 'content', 'sidebars', 'footer', 'seo', 'code_fields' ], ]; if ( ! isset( $posttype ) || ! $posttype ) { $posttype = get_post_type(); } // If editing a post card, treat separately. if ( fusion_is_post_card() ) { $posttype = 'post_card'; } // If editing a mega menu, treat separately. if ( fusion_is_mega_menu() ) { $posttype = 'mega_menu'; } $pagetype_data = apply_filters( 'fusion_pagetype_data', $pagetype_data, $posttype ); if ( isset( $pagetype_data[ $posttype ] ) ) { return $pagetype_data[ $posttype ]; } return $pagetype_data['default']; } /** * Gets the options for page type. * * @access public * @since 6.0 * @return array */ public function get_options() { if ( ! isset( $pagetype ) ) { $pagetype = get_post_type(); } $tabs = $this::get_pagetype_tab( $pagetype ); $sections = []; if ( is_array( $tabs ) ) { foreach ( $tabs as $tab_name ) { $path = Avada::$template_dir_path . '/includes/metaboxes/tabs/tab_' . $tab_name . '.php'; require_once wp_normalize_path( $path ); if ( function_exists( 'avada_page_options_tab_' . $tab_name ) ) { $sections = call_user_func( 'avada_page_options_tab_' . $tab_name, $sections ); } } } return apply_filters( 'awb_metaboxes_sections', $sections ); } /** * Adds the metaboxes. * * @access public */ public function add_meta_boxes() { $post_types = get_post_types( [ 'public' => true, ] ); // Libary is not public but post cards need PO. $post_types[] = 'fusion_element'; $post_types = apply_filters( 'awb_page_options_post_types', $post_types ); $disallowed = [ 'page', 'post', 'attachment', 'avada_portfolio', 'themefusion_elastic', 'product', 'wpsc-product', 'slide', 'tribe_events', 'fusion_tb_section', 'fusion_form', 'fusion_element', 'fusion_template', 'awb_off_canvas' ]; $disallowed = array_merge( $disallowed, apply_filters( 'avada_hide_page_options', [] ) ); foreach ( $post_types as $post_type ) { if ( in_array( $post_type, $disallowed, true ) ) { continue; } $this->add_meta_box( 'post_options', apply_filters( 'avada_page_options_metabox_title', esc_html__( 'Avada Options', 'Avada' ) ), $post_type ); } $this->add_meta_box( 'post_options', esc_html__( 'Avada Page Options', 'Avada' ), 'avada_faq' ); $this->add_meta_box( 'post_options', esc_html__( 'Avada Page Options', 'Avada' ), 'post' ); $this->add_meta_box( 'page_options', esc_html__( 'Avada Page Options', 'Avada' ), 'page' ); $this->add_meta_box( 'portfolio_options', esc_html__( 'Avada Page Options', 'Avada' ), 'avada_portfolio' ); $this->add_meta_box( 'es_options', esc_html__( 'Elastic Slide Options', 'Avada' ), 'themefusion_elastic' ); $this->add_meta_box( 'woocommerce_options', esc_html__( 'Avada Page Options', 'Avada' ), 'product' ); $this->add_meta_box( 'slide_options', esc_html__( 'Slide Options', 'Avada' ), 'slide' ); $this->add_meta_box( 'events_calendar_options', esc_html__( 'Events Calendar Event Options', 'Avada' ), 'tribe_events' ); $this->add_meta_box( 'fusion_tb_section', esc_html__( 'Layout Section Options', 'Avada' ), 'fusion_tb_section' ); $this->add_meta_box( 'fusion_form', esc_html__( 'Avada Form Options', 'Avada' ), 'fusion_form' ); $this->add_meta_box( 'awb_off_canvas', esc_html__( 'Off Canvas Options', 'Avada' ), 'awb_off_canvas' ); $this->add_meta_box( 'fusion_element', esc_html__( 'Avada Page Options', 'Avada' ), 'fusion_element' ); $this->add_meta_box( 'fusion_template', esc_html__( 'Avada Page Options', 'Avada' ), 'fusion_template' ); if ( class_exists( 'Avada_Studio' ) ) { $this->add_meta_box( 'fusion_template', esc_html__( 'Avada Page Options', 'Avada' ), 'fusion_template' ); } } /** * Adds a metabox. * * @access public * @param string $id The metabox ID. * @param string $label The metabox label. * @param string $post_type The post-type. */ public function add_meta_box( $id, $label, $post_type ) { if ( ( 'fusion_element' === $post_type && ! fusion_is_post_card() && ! fusion_is_mega_menu() && ! class_exists( 'Avada_Studio' ) ) || ! current_user_can( apply_filters( 'awb_role_manager_access_capability', 'edit_', $post_type, 'page_options' ) ) ) { return; } $label = '' . esc_html( $label ) . ''; add_meta_box( 'pyre_' . $id, $label, [ $this, $id ], $post_type, 'advanced', 'high' ); } /** * Saves the metaboxes. * * @access public * @param string|int $post_id The post ID. */ public function save_meta_boxes( $post_id, $post, $update ) { // Simple return did still somehow trigger the meta update. if ( ! current_user_can( apply_filters( 'awb_role_manager_access_capability', 'edit_', $post->post_type, 'page_options' ) ) ) { unset( $_POST[ Fusion_Data_PostMeta::ROOT ] ); } if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) ) { return; } if ( isset( $_POST[ Fusion_Data_PostMeta::ROOT ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification $fusion_meta = $this->sanitize( $_POST[ Fusion_Data_PostMeta::ROOT ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput, WordPress.Security.NonceVerification foreach ( $fusion_meta as $key => $val ) { if ( 0 === strpos( $key, '_' ) ) { $fusion_meta[ ltrim( $key, '_' ) ] = $val; unset( $fusion_meta[ $key ] ); } if ( '' === $val || 'default' === $val || ( is_array( $val ) && isset( $val['url'] ) && empty( $val['url'] ) ) ) { unset( $fusion_meta[ $key ] ); } } update_post_meta( $post_id, Fusion_Data_PostMeta::ROOT, $fusion_meta ); } } /** * Handle rendering options for pages. * * @access public */ public function page_options() { $this->render_option_tabs( $this::get_pagetype_tab( 'page' ) ); } /** * Sanitize post meta. * * @param mixed $meta_array The value. * @access public */ public function sanitize( $meta_array ) { return map_deep( $meta_array, [ $this, 'sanitize_strings_only' ] ); } /** * Sanitize stings_only. * * @param mixed $value The value. * @access public */ public function sanitize_strings_only( $value ) { if ( is_string( $value ) ) { if ( current_user_can( 'unfiltered_html' ) ) { return $value; } else { return wp_kses_post( $value ); } } else { return $value; } } /** * Handle rendering options for posts. * * @access public */ public function post_options() { $this->render_option_tabs( $this::get_pagetype_tab( 'post' ) ); } /** * Handle rendering options for portfolios. * * @access public */ public function portfolio_options() { $this->render_option_tabs( $this::get_pagetype_tab( 'avada_portfolio' ) ); } /** * Handle rendering options for woocommerce. * * @access public */ public function woocommerce_options() { $this->render_option_tabs( $this::get_pagetype_tab( 'product' ), 'product' ); } /** * Handle rendering options for ES. * * @access public */ public function es_options() { include 'options/options_es.php'; } /** * Handle rendering options for slides. * * @access public */ public function slide_options() { include 'options/options_slide.php'; } /** * Handle rendering options for events. * * @access public */ public function events_calendar_options() { $this->render_option_tabs( $this::get_pagetype_tab( 'tribe_events' ) ); } /** * Handle rendering options for events. * * @access public */ public function fusion_tb_section() { $this->render_option_tabs( $this::get_pagetype_tab( 'fusion_tb_section' ) ); } /** * Handle rendering options for events. * * @access public */ public function fusion_form() { $this->render_option_tabs( $this::get_pagetype_tab( 'fusion_form' ) ); } /** * Handle rendering options for fusion templates. * * @access public */ public function fusion_template() { $this->render_option_tabs( $this::get_pagetype_tab( 'fusion_template' ) ); } /** * Handle rendering options for fusion elements. * * @access public */ public function fusion_element() { $this->render_option_tabs( $this::get_pagetype_tab( 'fusion_element' ) ); } /** * Handle rendering options for events. * * @access public */ public function awb_off_canvas() { $this->render_option_tabs( $this::get_pagetype_tab( 'awb_off_canvas' ) ); } /** * Render fields within tab. * * @access public * @param array $tab_data The tab map. * @param string $repeater Used for repeater fields. * @since 6.0 */ public function render_tab_fields( $tab_data, $repeater = false ) { if ( ! is_array( $tab_data ) ) { return; } foreach ( $tab_data['fields'] as $field ) { // Defaults. $field['id'] = isset( $field['id'] ) ? $field['id'] : ''; $field['label'] = isset( $field['label'] ) ? $field['label'] : ''; $field['choices'] = isset( $field['choices'] ) ? $field['choices'] : []; $field['description'] = isset( $field['description'] ) ? $field['description'] : ''; $field['default'] = isset( $field['default'] ) ? $field['default'] : ''; $field['dependency'] = isset( $field['dependency'] ) ? $field['dependency'] : []; $field['ajax'] = isset( $field['ajax'] ) ? $field['ajax'] : false; $field['ajax_params'] = isset( $field['ajax_params'] ) ? $field['ajax_params'] : false; $field['max_input'] = isset( $field['max_input'] ) ? $field['max_input'] : 1000; $field['placeholder'] = isset( $field['placeholder'] ) ? $field['placeholder'] : 1000; $field['responsive'] = isset( $field['responsive'] ) ? $field['responsive']['state'] : false; $field['icons'] = isset( $field['icons'] ) ? $field['icons'] : []; $field['allow_globals'] = ( isset( $field['allow_globals'] ) && ( false === $field['allow_globals'] ) ? false : true ); $field['state'] = isset( $field['state'] ) ? $field['state'] : ''; $field['states'] = isset( $field['states'] ) ? $field['states'] : []; $field['default_state_option'] = isset( $field['default_state_option'] ) ? $field['default_state_option'] : ''; $field['row_title'] = isset( $field['row_title'] ) ? $field['row_title'] : ''; switch ( $field['type'] ) { case 'radio-buttonset': $this->radio_buttonset( $field['id'], $field['label'], $field['choices'], $field['description'], $field['default'], $field['dependency'], null, $field['responsive'], $field['icons'] ); break; case 'checkbox-buttonset': $this->checkbox_buttonset( $field['id'], $field['label'], $field['value'], $field['description'], $field['default'], $field['dependency'], $field['responsive'] ); break; case 'color-alpha': $this->color( $field['id'], $field['label'], $field['description'], true, $field['dependency'], $field['default'], $field['responsive'], $field['allow_globals'], $field['state'], $field['states'], $field['default_state_option'] ); break; case 'color': $this->color( $field['id'], $field['label'], $field['description'], false, $field['dependency'], $field['default'], $field['responsive'], $field['allow_globals'], $field['state'], $field['states'], $field['default_state_option'] ); break; case 'typography': $this->typography( $field['id'], $field['label'], $field['description'], $field['dependency'], $field ); break; case 'media': case 'media_url': case 'upload': $this->upload( $field['id'], $field['label'], $field['description'], $field['dependency'], $field['responsive'] ); break; case 'ajax_select': case 'multiple_select': $this->multiple( $field['id'], $field['label'], $field['choices'], $field['description'], $field['dependency'], $field['ajax'], $field['ajax_params'], $field['max_input'], $field['placeholder'], $repeater, null, $field['responsive'], $field['default'] ); break; case 'select': $this->select( $field['id'], $field['label'], $field['choices'], $field['description'], $field['default'], $field['dependency'], $repeater, $field['responsive'], $field['state'], $field['states'], $field['default_state_option'] ); break; case 'dimensions': $this->dimension( $field['id'], $field['value'], $field['label'], $field['description'], $field['dependency'], $field['responsive'] ); break; case 'text': $this->text( $field['id'], $field['label'], $field['description'], $field['dependency'], $field['responsive'] ); break; case 'textarea': $this->textarea( $field['id'], $field['label'], $field['description'], $field['default'], $field['dependency'], $field['responsive'], $field ); break; case 'code': $this->code( $field['id'], $field['label'], $field['description'], $field['default'], $field['dependency'], $field['responsive'], $field ); break; case 'custom': $this->raw( $field['id'], $field['label'], $field['description'], $field['dependency'], $field['responsive'] ); break; case 'hidden': $this->hidden( $field['id'], $field['default'] ); break; case 'slider': $this->range( $field['id'], $field['label'], $field['description'], $field['choices']['min'], $field['choices']['max'], $field['choices']['step'], $field['default'], '', $field['dependency'], null, $field['responsive'] ); break; case 'sortable': $this->sortable( $field['id'], $field['label'], $field['choices'], $field['description'], $field['dependency'], $field['default'], $field['responsive'] ); break; case 'layout_conditions': $this->layout_conditions( $field['id'], $field['label'], $field['description'], $field['dependency'], $field['responsive'] ); break; case 'hubspot_map': $this->hubspot_map( $field['id'], $field['label'], $field['choices'], $field['description'], $field['dependency'], $field['default'], $field['responsive'] ); break; case 'hubspot_consent_map': $this->hubspot_consent_map( $field['id'], $field['label'], $field['choices'], $field['description'], $field['dependency'], $field['default'], $field['responsive'] ); break; case 'mailchimp_map': $this->mailchimp_map( $field['id'], $field['label'], $field['choices'], $field['description'], $field['dependency'], $field['default'], $field['responsive'] ); break; case 'repeater': $labels = [ 'row_add' => $field['row_add'], 'row_title' => $field['row_title'], ]; $this->repeater( $field['id'], $field['label'], $field['description'], $field['dependency'], $field['fields'], $field['bind_title'], $labels, $field['responsive'], $field['default'] ); break; case 'toggle': case 'group': $this->toggle( $field['id'], $field['label'], $field['description'], $field['dependency'], $field['fields'], $field['responsive'], $field['row_title'], $field['state'] ); break; case 'iconpicker': $this->iconpicker( $field['id'], $field['label'], $field['description'], $field['dependency'], $field['responsive'] ); break; case 'date_time_picker': $this->date_time_picker( $field['id'], $field['label'], $field['description'], $field['dependency'], $field['responsive'] ); break; } } } /** * Handle rendering options. * * @access public * @param array $requested_tabs The requested tabs. * @param string $post_type The post-type. */ public function render_option_tabs( $requested_tabs, $post_type = 'default' ) { global $post; $screen = get_current_screen(); $preview_types = [ 'fusion_element', 'awb_off_canvas' ]; $tabs_names = [ 'sliders' => esc_html__( 'Sliders', 'Avada' ), 'page' => esc_html__( 'Layout', 'Avada' ), 'post' => 'avada_faq' === $screen->post_type ? esc_html__( 'FAQ', 'Avada' ) : esc_html__( 'Post', 'Avada' ), 'header' => esc_html__( 'Header', 'Avada' ), 'content' => esc_html__( 'Content', 'Avada' ), 'sidebars' => esc_html__( 'Sidebars', 'Avada' ), 'pagetitlebar' => esc_html__( 'Page Title Bar', 'Avada' ), 'portfolio_post' => esc_html__( 'Portfolio', 'Avada' ), 'product' => esc_html__( 'Product', 'Avada' ), 'template' => in_array( $screen->post_type, $preview_types, true ) ? esc_html__( 'Preview', 'Avada' ) : esc_html__( 'Layout Section', 'Avada' ), 'form_general' => esc_html__( 'General', 'Avada' ), 'form_submission' => esc_html__( 'Submission', 'Avada' ), 'form_notifications' => esc_html__( 'Notifications', 'Avada' ), 'form_confirmation' => esc_html__( 'Confirmation', 'Avada' ), 'form_appearance' => esc_html__( 'Appearance', 'Avada' ), 'form_privacy' => esc_html__( 'Privacy', 'Avada' ), 'footer' => esc_html__( 'Footer', 'Avada' ), 'studio' => esc_html__( 'Studio', 'Avada' ), 'studio_tools' => esc_html__( 'Studio Tools', 'Avada' ), 'off_canvas_general' => esc_html__( 'General', 'Avada' ), 'off_canvas_design' => esc_html__( 'Design', 'Avada' ), 'off_canvas_overlay' => esc_html__( 'Overlay', 'Avada' ), 'off_canvas_close' => esc_html__( 'Close', 'Avada' ), 'off_canvas_animation' => esc_html__( 'Animation', 'Avada' ), 'off_canvas_conditions' => esc_html__( 'Conditions', 'Avada' ), 'off_canvas_triggers' => esc_html__( 'Triggers', 'Avada' ), 'off_canvas_rules' => esc_html__( 'Rules', 'Avada' ), 'fusion_template' => esc_html__( 'Template', 'Avada' ), 'form_steps' => esc_html__( 'Step Progress', 'Avada' ), 'seo' => esc_html__( 'SEO', 'Avada' ), 'code_fields' => esc_html__( 'Code Fields', 'Avada' ), ]; // Set tab name for mega menu. if ( 'fusion_element' === $screen->post_type ) { $terms = get_the_terms( $post->ID, 'element_category' ); $type = is_array( $terms ) ? $terms[0]->name : false; $tabs_names['template'] = 'mega_menus' === $type ? esc_html__( 'Mega Menu', 'Avada' ) : $tabs_names['template']; } $tabs = [ 'requested_tabs' => $requested_tabs, 'tabs_names' => $tabs_names, 'tabs_path' => [], ]; $tabs = apply_filters( 'avada_metabox_tabs', $tabs, $post_type ); ?>
get_value( $id ); $conditions = json_decode( $value ); $has_conditions = is_object( $conditions ) && count( (array) $conditions ) ? true : false; ?> get_value( $id ); $default = $this->is_meta_data_key_saved_in_db( $id ) ? '' : $default; $value = $db_value ? $db_value : $default; $hidden_state_class = ( ! empty( $state ) ? ' pyre_metabox_field_state_hidden' : '' ); ?> ' . esc_attr__( 'Reset to default.', 'Avada' ) . '' . esc_attr__( 'Using default value.', 'Avada' ) . ''; } $hidden_state_class = ( ! empty( $state ) ? ' pyre_metabox_field_state_hidden' : '' ); ?> get_value( $id ); if ( ! is_array( $setting ) ) { $setting = []; } // The hidden input fields approach is used only in Avada Studio by designers. if ( class_exists( 'Avada_Studio' ) ) { ?> ' . esc_attr__( 'Reset to default.', 'Avada' ) . '' . esc_attr__( 'Using default value.', 'Avada' ) . ''; } ?> get_value( $id ) ) ? $default : $this->get_value( $id ); // phpcs:ignore WordPress.PHP.StrictComparisons ?> get_value( $id ) ) ? $default : $this->get_value( $id ); // phpcs:ignore WordPress.PHP.StrictComparisons $value = ! is_array( $value ) ? explode( ',', $value ) : $value; ?> get_value( $id ) ? $default : $this->get_value( $id ); ?> get_value( $id ); $default = $this->is_meta_data_key_saved_in_db() ? '' : $default; $value = $db_value ? $db_value : $default; $rows = 10; if ( 'heading' === $id || 'caption' === $id ) { $rows = 5; } elseif ( 'page_title_custom_text' === $id || 'page_title_custom_subheader' === $id ) { $rows = 1; } $max_length = isset( $field['max'] ) ? $field['max'] : ''; $range = isset( $field['range'] ) ? $field['range'] : ''; $counter_class = isset( $field['counter'] ) && $field['counter'] ? '-counter' : ''; ?> get_value( $id ); if ( function_exists( 'wp_enqueue_code_editor' ) ) { $settings = wp_enqueue_code_editor( [] ); } ?> get_value( $id ); $sort_order_saved = ( ! $sort_order_saved ) ? '' : $sort_order_saved; $sort_order = ( empty( $sort_order_saved ) ) ? $default : $sort_order_saved; $sort_order = ( is_array( $sort_order ) ) ? $sort_order : explode( ',', $sort_order ); ?> post_meta( $post->ID )->get( $id ) : []; $value = ! empty( $value ) ? $value : $default; $value = 'awb_pages' === $id ? '' : $value; if ( is_array( $value ) ) { $value = wp_json_encode( $value ); } ?> get_value( $id ); if ( is_array( $value ) ) { $value = wp_json_encode( $value ); } ?> get_value( $id ); if ( is_array( $value ) ) { $value = wp_json_encode( $value ); } ?> get_value( $id ); if ( is_array( $value ) ) { $value = wp_json_encode( $value ); } ?> get_value( $id ); ?> settings->get( 'dependencies_status' ) ) { return ''; } $data_dependency = ''; if ( is_array( $dependency ) && 0 < count( $dependency ) ) { $data_dependency .= '