$setting) { if (!empty($key)) { $options[$key] = isset($options[$key]) ? sanitize_text_field($options[$key]) : ''; } } } return $options; } /** * Settings Field Return */ public static function get_option_settings(){ return apply_filters('ultp_settings', 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(Gutenberg Post Blocks Template).', 'ultimate-post') ), 'editor_container' => array( 'type' => 'select', 'label' => __('Editor Container', 'ultimate-post'), 'options' => array( 'full_width' => __( 'Full Width','ultimate-post' ), 'theme_default' => __( 'Theme Default','ultimate-post' ) ), 'default' => 'full_width', 'desc' => __('Select Editor Container Width.', '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') ), )); } /** * Changelog Data */ public static function get_changelog_data() { $html = ''; $resource_data = file_get_contents(ULTP_PATH.'/readme.txt', "r"); $data = array(); if ($resource_data) { $resource_data = explode('== Changelog ==', $resource_data); if (isset($resource_data[1])) { $resource_data = $resource_data[1]; $resource_data = explode("\n", $resource_data); $inner = false; $count = -1; foreach ($resource_data as $element) { if ($element){ if (substr_count($element, '=') > 1) { $count++; $temp = trim(str_replace('=', '', $element)); if (strpos($temp, '-') !== false) { $temp = explode('-', $temp); $data[$count]['date'] = trim($temp[1]); $data[$count]['version'] = trim($temp[0]); } } if (strpos($element, '* New:') !== false) { $data[$count]['new'][] = trim(str_replace('* New:', '', $element)); } if (strpos($element, '* Fix:') !== false) { $data[$count]['fix'][] = trim(str_replace('* Fix:', '', $element)); } if (strpos($element, '* Update:') !== false) { $data[$count]['update'][] = trim(str_replace('* Update:', '', $element)); } } } } } if (!empty($data)) { foreach ($data as $k => $inner_data) { $html .= '
'.$value['desc'].'
'; $html .= ''.$value['desc'].'
'; $html .= ''.$value['desc'].'
'; $html .= ''.$value['desc'].'
'; $html .= '