Willkommen bei WordPress. Dies ist dein erster Beitrag. Bearbeite oder lösche ihn und beginne mit dem Schreiben!
Hallo Welt!
von raredesign | Dez 3, 2019 | Allgemein | 0 Kommentare
Cokiee Shell
Current Path : /var/www/web284/html/wp-content/themes/splendor/admin/functions/ |
Current File : //var/www/web284/html/wp-content/themes/splendor/admin/functions/functions.admin.php |
<?php /** * SMOF Admin * * @package WordPress * @subpackage SMOF * @since 1.4.0 * @author Syamil MJ */ /** * Head Hook * * @since 1.0.0 */ function of_head() { do_action( 'of_head' ); } /** * Add default options upon activation else DB does not exist * * @since 1.0.0 */ function of_option_setup() { global $of_options, $options_machine; $options_machine = new Options_Machine($of_options); if (!of_get_options()) { of_save_options($options_machine->Defaults); } } /** * Change activation message * * @since 1.0.0 */ function optionsframework_admin_message() { //Tweaked the message on theme activate ?> <script type="text/javascript"> jQuery(function(){ var message = '<p>This theme comes with an <a href="<?php echo admin_url('admin.php?page=optionsframework'); ?>">options panel</a> to configure settings. This theme also supports widgets, please visit the <a href="<?php echo admin_url('widgets.php'); ?>">widgets settings page</a> to configure them.</p>'; jQuery('.themes-php #message2').html(message); }); </script> <?php } /** * Get header classes * * @since 1.0.0 */ function of_get_header_classes_array() { global $of_options; foreach ($of_options as $value) { if ($value['type'] == 'heading') $hooks[] = str_replace(' ','',strtolower($value['name'])); } return $hooks; } /** * Get options from the database and process them with the load filter hook. * * @author Jonah Dahlquist * @since 1.4.0 * @return array */ function of_get_options($key = OPTIONS) { $data = get_option($key); $data = apply_filters('of_options_after_load', $data); return $data; } /** * Save options to the database after processing them * * @param $data Options array to save * @author Jonah Dahlquist * @since 1.4.0 * @uses update_option() * @return void */ function of_save_options($data, $key=OPTIONS) { $data = apply_filters('of_options_before_save', $data); update_option($key, $data); } /** * For use in themes * * @since forever */ $data = of_get_options(); $smof_data = of_get_options(); /*-----------------------------------------------------------------------------------*/ /* Generate a static css file from the defined options /*-----------------------------------------------------------------------------------*/ // This function will generate a static css file which you can use in your theme. // Some examples of the dynamically generated options has been defined in css/styles.php function generate_options_css($newdata) { $smof_data = $newdata; $css_dir = get_template_directory() . '/assets/css/'; // Shorten code, save 1 call ob_start(); // Capture all output (output buffering) require($css_dir . 'style.php'); // Generate CSS $css = ob_get_clean(); // Get generated CSS (output buffering) file_put_contents($css_dir . 'options.css', $css, LOCK_EX); // Save it }
Cokiee Shell Web 1.0, Coded By Razor
Neueste Kommentare