|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /home/njnconst/public_html/cd/wp-content/themes/skt-white/inc/ |
Upload File : |
<?php
/*
Version: 1.9
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
// Don't load if optionsframework_init is already defined
if (is_admin() && ! function_exists( 'optionsframework_init' ) ) :
function optionsframework_init() {
// If user can't edit theme options, exit
if ( ! current_user_can( 'edit_theme_options' ) ) {
return;
}
// Include the required files
require plugin_dir_path( __FILE__ ) . 'includes/class-options-framework.php';
require plugin_dir_path( __FILE__ ) . 'includes/class-options-framework-admin.php';
require plugin_dir_path( __FILE__ ) . 'includes/class-options-interface.php';
require plugin_dir_path( __FILE__ ) . 'includes/class-options-media-uploader.php';
require plugin_dir_path( __FILE__ ) . 'includes/class-options-sanitize.php';
// Instantiate the options page.
$options_framework_admin = new Options_Framework_Admin;
$options_framework_admin->init();
// Instantiate the media uploader class
$options_framework_media_uploader = new Options_Framework_Media_Uploader;
$options_framework_media_uploader->init();
}
add_action( 'init', 'optionsframework_init', 20 );
endif;
/**
* Helper function to return the theme option value.
* If no value has been saved, it returns $default.
* Needed because options are saved as serialized strings.
*
* Not in a class to support backwards compatibility in themes.
*/
if ( ! function_exists( 'of_get_option' ) ) :
function of_get_option( $name, $default = false ) {
$option_name = '';
// Gets option name as defined in the theme
if ( function_exists( 'optionsframework_option_name' ) ) {
$option_name = optionsframework_option_name();
}
// Fallback option name
if ( '' == $option_name ) {
$option_name = get_option( 'stylesheet' );
$option_name = preg_replace( "/\W/", "_", strtolower( $option_name ) );
}
// Get option settings from database
$options = get_option( $option_name );
// Return specific option
if ( isset( $options[$name] ) ) {
return $options[$name];
}
return $default;
}
endif;