예제 #1
0
파일: nova.php 프로젝트: sayedwp/supernova
     * @since 0.8.0
     */
    function nova_load_textdomain()
    {
        $textdomain = 'nova';
        // Look for WP_LANG_DIR/{$domain}-{$locale}.mo
        if (file_exists(WP_LANG_DIR . '/' . $textdomain . '-' . get_locale() . '.mo')) {
            $file = WP_LANG_DIR . '/' . $textdomain . '-' . get_locale() . '.mo';
        }
        // Look for Nova::$path/languages/{$domain}-{$locale}.mo
        if (!isset($file) && file_exists(Nova::$path . DIRECTORY_SEPARATOR . 'languages' . DIRECTORY_SEPARATOR . $textdomain . '-' . get_locale() . '.mo')) {
            $file = Nova::$path . DIRECTORY_SEPARATOR . 'languages' . DIRECTORY_SEPARATOR . $textdomain . '-' . get_locale() . '.mo';
        }
        if (isset($file)) {
            load_textdomain($textdomain, $file);
        }
        load_plugin_textdomain($textdomain, false, Nova::$path . DIRECTORY_SEPARATOR . 'languages');
    }
    add_action('plugins_loaded', 'nova_load_textdomain');
}
// Add an empty config for global fields
Nova::add_config('');
/**
 * To enable the demo theme, just add this line to your wp-config.php file:
 * define( 'KIRKI_CONFIG', true );
 * Once you add that line, you'll see a new theme in your dashboard called "Nova Demo".
 * Activate that theme to test all controls.
 */
if (defined('KIRKI_DEMO') && KIRKI_DEMO && file_exists(dirname(__FILE__) . '/demo-theme/style.css')) {
    register_theme_directory(dirname(__FILE__));
}
예제 #2
0
<?php

/**
 * Contains Customizer Settings
 */
if (!class_exists('Nova')) {
    return;
}
/**
 * Add the configuration.
 * This way all the fields using the 'supernova' ID
 * will inherit these options
 */
Nova::add_config('supernova', array('capability' => 'edit_theme_options', 'option_type' => 'theme_mod'));
/*
|--------------------------------------------------------------------------
| Site Identity
|--------------------------------------------------------------------------
*/
//Upload logo
Nova::add_field('supernova', array('settings' => 'sup_logo', 'label' => esc_attr__('Upload Logo', 'supernova'), 'section' => 'title_tagline', 'type' => 'upload'));
//Logo Placement
Nova::add_field('supernova', array('settings' => 'sup_site_identity_placement', 'label' => esc_attr__('Logo/Title Placement', 'supernova'), 'section' => 'title_tagline', 'type' => 'radio-buttonset', 'default' => 'left', 'choices' => array('left' => __('Left', 'supernova'), 'center' => __('Center', 'supernova'), 'right' => __('right', 'supernova'))));
//Logo Placement
Nova::add_field('supernova', array('settings' => 'sup_display_header_text', 'label' => esc_attr__('Display Header Text', 'supernova'), 'section' => 'title_tagline', 'type' => 'checkbox', 'default' => true));
/*
|--------------------------------------------------------------------------
| Layout
|--------------------------------------------------------------------------
*/
Nova::add_section('layout', array('title' => esc_attr__('Layout', 'supernova'), 'priority' => 35, 'capability' => 'edit_theme_options'));