Exemple #1
0
/**
 * Loads the `admin-widgets.css` file when viewing the widgets screen.
 *
 * @since  0.9.0
 * @access public
 * @return void
 */
function omega_admin_enqueue_styles($hook_suffix)
{
    wp_enqueue_style('omega-admin');
    if (current_theme_supports('omega-widgets') && 'widgets.php' == $hook_suffix) {
        wp_enqueue_style('omega-admin-widgets');
    }
    if (omega_get_settings_page_name() == $hook_suffix) {
        wp_enqueue_script('omega-admin');
    }
}
/**
 * Adds the core about theme meta box to the theme settings page.
 *
 * @since 0.9.1
 * @return void
 */
function omega_meta_box_theme_add_about()
{
    /* Get theme information. */
    $theme = wp_get_theme(get_template(), get_theme_root(get_template_directory()));
    /* If the user is using a child theme, add an About box for it. */
    if (is_child_theme()) {
        $child = wp_get_theme(get_stylesheet(), get_theme_root(get_stylesheet_directory()));
        add_meta_box('omega-about-child', sprintf(__('About %s', 'omega'), $child->get('Name')), 'omega_meta_box_theme_display_about', omega_get_settings_page_name(), 'side', 'high');
    } else {
        /* Adds the About box for the parent theme. */
        add_meta_box('omega-about-theme', sprintf(__('About %s', 'omega'), $theme->get('Name')), 'omega_meta_box_theme_display_about', omega_get_settings_page_name(), 'side', 'high');
    }
}
/**
 * Adds the core theme scripts meta box to the theme settings page in the admin.
 *
 * @since 0.3.0
 * @return void
 */
function omega_theme_settings_scripts()
{
    add_meta_box('omega-theme-scripts', __('Header and Footer Scripts', 'omega'), 'omega_meta_box_theme_display_scripts', omega_get_settings_page_name(), 'normal', 'high');
}
/**
 * Adds the core theme scripts meta box to the theme settings page in the admin.
 *
 * @since 0.3.0
 * @return void
 */
function omega_theme_settings_comments()
{
    /* Add a custom meta box. */
    add_meta_box('omega-theme-comments', __('Comments and Trackbacks', 'omega'), 'omega_meta_box_theme_display_comments', omega_get_settings_page_name(), 'normal', 'high');
}
Exemple #5
0
/**
 * Loads the JavaScript required for toggling the meta boxes on the theme settings page.
 *
 * @since 0.7.0
 * @return void
 */
function omega_settings_page_load_scripts()
{
    ?>
	<script type="text/javascript">
		//<![CDATA[
		jQuery(document).ready( function($) {
			$('.if-js-closed').removeClass('if-js-closed').addClass('closed');
			postboxes.add_postbox_toggles( '<?php 
    echo omega_get_settings_page_name();
    ?>
' );
		});
		//]]>
	</script><?php 
}
<?php

/**
 * Creates a meta box for the theme settings page, which holds textareas for custom scripts within 
 * the theme. 
 *
 */
/* Create a settings meta box only on the theme settings page. */
add_action('add_meta_boxes', 'omega_theme_settings_archives');
/* Sanitize the scripts settings before adding them to the database. */
add_filter("sanitize_option_omega_theme_settings", 'omega_theme_validate_archives');
/* Adds my_help_tab when my_admin_page loads */
add_action('load-' . omega_get_settings_page_name(), 'omega_theme_settings_archives_help');
/**
 * Adds Content Archives meta box to the theme settings page in the admin.
 *
 * @since 0.3.0
 * @return void
 */
function omega_theme_settings_archives()
{
    add_meta_box('omega-theme-archives', __('Content Archives', 'omega'), 'omega_meta_box_theme_display_archives', 'appearance_page_theme-settings', 'normal', 'high');
}
/**
 * Callback for Theme Settings Post Archives meta box.
 */
function omega_meta_box_theme_display_archives()
{
    ?>
	<p>
		<label for="<?php