get_option_settings_keys(); foreach ($settings as $key) { $options[$key] = isset($options[$key]) ? $options[$key] : ''; } $old_data = ultimate_post()->get_setting(); $options = array_merge($old_data, $options); } return $options; } /** * Settings Fields Key Return */ public function get_option_settings_keys() { $attr = array(); $data = $this->get_option_settings(); if (!empty($data)) { foreach ($data as $key => $inner_data) { if (isset($inner_data['attr'])) { foreach ($inner_data['attr'] as $k => $val) { $attr[] = $k; } } } } return $attr; } /** * Settings Field Return */ public function get_option_settings(){ return apply_filters('ultp_settings', array( 'general' => array( 'label' => __('General Settings', 'ultimate-post'), 'attr' => array( 'css_save_as' => array( 'type' => 'select', 'label' => __('CSS Add Via', 'ultimate-post'), 'options' => array( 'wp_head' => __( 'Header - (Internal)','ultimate-post' ), 'filesystem' => __( 'File System - (External)','ultimate-post' ), ), 'default' => 'wp_head', 'desc' => __('Select where you want to save CSS.', 'ultimate-post') ), 'preloader_style' => array( 'type' => 'select', 'label' => __('Preloader Style', 'ultimate-post'), 'options' => array( 'style1' => __( 'Preloader Style 1','ultimate-post' ), 'style2' => __( 'Preloader Style 2','ultimate-post' ), ), 'default' => 'style1', 'desc' => __('Select Preloader Style.', 'ultimate-post') ), 'container_width' => array( 'type' => 'number', 'label' => __('Container Width', 'ultimate-post'), 'default' => '1140', 'desc' => __('Change Container Width of the Page Template(PostX Template).', 'ultimate-post') ), 'hide_import_btn' => array( 'type' => 'switch', 'label' => __('Hide Import Button', 'ultimate-post'), 'default' => '', 'desc' => __('Hide Import Layout Button from the Gutenberg Editor.', 'ultimate-post') ), 'disable_image_size' => array( 'type' => 'switch', 'label' => __('Disable Image Size', 'ultimate-post'), 'default' => '', 'desc' => __('Disable Image Size of the Plugins.', 'ultimate-post') ), 'disable_view_cookies' => array( 'type' => 'switch', 'label' => __('Disable All Cookies', 'ultimate-post'), 'default' => '', 'desc' => __('Disable All Frontend Cookies (Cookies Used for Post View Count).', 'ultimate-post') ), ) ) )); } /** * Settings page output */ public function get_settings_data( $data ) { $option_data = ultimate_post()->get_setting(); foreach ($data as $key => $value) { if ($value['type'] == 'hidden') { echo ''; } else { if ($value['type'] == 'heading') { echo '
'.esc_html($value['desc']).'
'; echo ''.esc_html($value['desc']).'
'; echo ''.esc_html($value['desc']).'
'; echo ''.esc_html($value['desc']).'
'; echo '