| Server IP : 93.115.150.27 / Your IP : 216.73.216.221 Web Server : LiteSpeed System : Linux host2.azar.host 4.18.0-553.80.1.lve.el8.x86_64 #1 SMP Wed Oct 22 19:29:36 UTC 2025 x86_64 User : dorfakkh ( 1797) PHP Version : 8.1.34 Disable Function : show_source, system, passthru, exec, popen, proc_open, mail MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/dorfakkh/public_html/wp-content/themes/dorfakkhabar/tabnakweb/ |
Upload File : |
<?php
/*-----------------------------------------------------------------------------------*/
/* Add default options after activation */
/*-----------------------------------------------------------------------------------*/
if (is_admin() && isset($_GET['activated'] ) ) {
//Call action that sets
add_action('admin_head','tt_option_setup');
}
function tt_option_setup(){
//Update EMPTY options
$tt_array = array();
add_option('tt_options',$tt_array);
$template = of_options();
$saved_options = get_option('tt_options');
foreach($template as $option) {
if($option['type'] != 'heading'){
$id = $option['id'];
$std = $option['std'];
$db_option = get_option($id);
if(empty($db_option)){
if(is_array($option['type'])) {
foreach($option['type'] as $child){
$c_id = $child['id'];
$c_std = $child['std'];
update_option($c_id,$c_std);
$tt_array[$c_id] = $c_std;
}
} else {
update_option($id,$std);
$tt_array[$id] = $std;
}
}
else { //So just store the old values over again.
$tt_array[$id] = $db_option;
}
}
}
update_option('tt_options',$tt_array);
}
/*-----------------------------------------------------------------------------------*/
/* Admin Backend */
/*-----------------------------------------------------------------------------------*/
function siteoptions_admin_head() { ?>
<script type="text/javascript">
jQuery(function(){
var message = '<p><strong>فعال سازی موفق بود!</strong> این قالب دارای یک پنل تنظیمات قوی می باشد که از طریق آدرس <a href="<?php echo admin_url('admin.php?page=siteoptions'); ?>">نمایش > تنظیمات قالب</a> در دسترس می باشد.</p>';
jQuery('.themes-php #message2').html(message);
});
</script>
<?php }
add_action('admin_head', 'siteoptions_admin_head');
?>