| Server IP : 62.60.133.156 / Your IP : 216.73.217.51 Web Server : LiteSpeed System : Linux linux24.centraldnserver.com 4.18.0-553.141.2.lve.el8.x86_64 #1 SMP Wed Jul 8 16:10:02 UTC 2026 x86_64 User : mimradmin ( 1166) PHP Version : 7.4.33 Disable Function : show_source, system, shell_exec, passthru, exec, popen, proc_open MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/mimradmin/.trash/wp-content.1/themes/wp-buka/includes/ |
Upload File : |
<?php
// Prevent Direct Access
if( !defined('ABSPATH') ){
exit;
}
// ---------- Function to get theme panel options
if ( ! function_exists( 'buka_get_option' ) ) {
function buka_get_option( $option = '', $default = false ) {
$options = get_option( 'buka_panel' );
return ( isset( $options[$option] ) ? $options[$option] : $default );
}
}
// ------- Function to get option value from url or customizer
function buka_get_customizer_option($option, $default = false, $custom_option = false, $custom_default = false){
// Define a variable to save output
$output = [];
// if there is a url parameter for the option get the value from url
if( isset($_GET[$option]) ){
$output['value'] = sanitize_text_field($_GET[$option]);
$output['type'] = 'url';
}
// else get the value from customizer
else{
$output['value'] = get_theme_mod($option, $default);
$output['type'] = 'customizer';
}
// if $custom_option is present and the value of output is "custom" means we want to get the value of the custom option that is related to the main option
if( $custom_option && $output['value'] === 'custom' ){
// If the type of output is "url", means the "custom" value was from url parameter and therefore we should also get the custom option from url
if( $output['type'] == 'url' ){
// if the custom option is set in the url
if( isset($_GET[$custom_option]) ){
// Get value of $custom_option from url
$output['value'] = sanitize_text_field($_GET[$custom_option]);
}
// if the custom option is not set in the url
else{
// make the value equal to $option value which is 'custom'
$output['value'] = 'custom';
}
}
// If the type of output is not "url, means it's "customizer" and the "custom" value was from customizer and therefore we should also get the custom option from customizer
else{
// Get value of $custom_option from Customizer
$output['value'] = get_theme_mod($custom_option, $custom_default);
}
}
// Return the output
return $output['value'];
}