コード例 #1
0
 /**
  * Register meta boxes on the CPT Archive pages.
  *
  * Some of the meta box additions are dependent on certain theme support or user capabilities.
  *
  * The 'genesis_cpt_archives_settings_metaboxes' action hook is called at the end of this function.
  *
  * @since 2.0.0
  *
  * @see \Genesis_Admin_CPT_Archives_Settings::archive_box() Callback for Archive box.
  * @see \Genesis_Admin_CPT_Archives_Settings::seo_box()     Callback for SEO box.
  * @see \Genesis_Admin_CPT_Archives_Settings::layout_box()  Callback for Layout box.
  */
 public function metaboxes()
 {
     add_meta_box('genesis-cpt-archives-settings', __('Archive Settings', 'genesis'), array($this, 'archive_box'), $this->pagehook, 'main');
     if (!genesis_seo_disabled()) {
         add_meta_box('genesis-cpt-archives-seo-settings', __('SEO Settings', 'genesis'), array($this, 'seo_box'), $this->pagehook, 'main');
     }
     if (genesis_has_multiple_layouts()) {
         add_meta_box('genesis-cpt-archives-layout-settings', __('Layout Settings', 'genesis'), array($this, 'layout_box'), $this->pagehook, 'main');
     }
     do_action('genesis_cpt_archives_settings_metaboxes', $this->pagehook);
 }
コード例 #2
0
/**
 * Add the layout options to each custom taxonomy edit screen.
 *
 * @since 1.4.0
 *
 * @see genesis_taxonomy_layout_options() Callback for layout selector.
 */
function genesis_add_taxonomy_layout_options()
{
    if (!current_theme_supports('genesis-archive-layouts')) {
        return;
    }
    if (!genesis_has_multiple_layouts()) {
        return;
    }
    foreach (get_taxonomies(array('public' => true)) as $tax_name) {
        add_action($tax_name . '_edit_form', 'genesis_taxonomy_layout_options', 10, 2);
    }
}
コード例 #3
0
/**
 * Callback for in-post layout meta box.
 *
 * @since 0.2.2
 */
function genesis_inpost_layout_box()
{
    wp_nonce_field('genesis_inpost_layout_save', 'genesis_inpost_layout_nonce');
    $layout = genesis_get_custom_field('_genesis_layout');
    ?>

	<table class="form-table">
	<tbody>

	<?php 
    if (genesis_has_multiple_layouts()) {
        ?>
		<tr valign="top">
			<th scope="row"><?php 
        _e('Select Layout', 'genesis');
        ?>
</th>
			<td>
				<fieldset class="genesis-layout-selector">
					<legend class="screen-reader-text"><?php 
        _e('Layout Settings', 'genesis');
        ?>
</legend>

					<p><input type="radio" name="genesis_layout[_genesis_layout]" class="default-layout" id="default-layout" value="" <?php 
        checked($layout, '');
        ?>
 /> <label class="default" for="default-layout"><?php 
        printf(__('Default Layout set in <a href="%s">Theme Settings</a>', 'genesis'), menu_page_url('genesis', 0));
        ?>
</label></p>
					<?php 
        genesis_layout_selector(array('name' => 'genesis_layout[_genesis_layout]', 'selected' => $layout, 'type' => 'site'));
        ?>

				</fieldset>
			</td>
		</tr>
	<?php 
    }
    ?>

		<tr valign="top">
			<th scope="row"><label for="genesis_custom_body_class"><?php 
    _e('Custom Body Class', 'genesis');
    ?>
</label></th>
			<td><p><input class="large-text" type="text" name="genesis_layout[_genesis_custom_body_class]" id="genesis_custom_body_class" value="<?php 
    echo esc_attr(genesis_get_custom_field('_genesis_custom_body_class'));
    ?>
" /></p></td>
		</tr>

		<tr valign="top">
			<th scope="row"><label for="genesis_custom_post_class"><?php 
    _e('Custom Post Class', 'genesis');
    ?>
</label></th>
			<td><p><input class="large-text" type="text" name="genesis_layout[_genesis_custom_post_class]" id="genesis_custom_post_class" value="<?php 
    echo esc_attr(genesis_get_custom_field('_genesis_custom_post_class'));
    ?>
" /></p></td>
		</tr>

	</tbody>
	</table>

	<?php 
}
コード例 #4
0
 /**
  * Register new Customizer elements.
  *
  * Actual registration of settings and controls are handled in private methods.
  *
  * @since 2.1.0
  *
  * @param WP_Customize_Manager $wp_customize WP_Customize_Manager instance.
  */
 public function register($wp_customize)
 {
     if (!current_theme_supports('genesis-custom-header') && !current_theme_supports('custom-header')) {
         $this->blog_title($wp_customize);
     }
     $this->color_scheme($wp_customize);
     if (genesis_has_multiple_layouts()) {
         $this->layout($wp_customize);
     }
     if (current_theme_supports('genesis-breadcrumbs')) {
         $this->breadcrumbs($wp_customize);
     }
     $this->comments($wp_customize);
     $this->archives($wp_customize);
 }
コード例 #5
0
/**
 * Add author archive layout selector to the user edit screen.
 *
 * @since 1.4.0
 *
 * @uses genesis_layout_selector() Layout selector.
 *
 * @param \WP_User $user User object.
 *
 * @return false Return false if current user can not edit users.
 */
function genesis_user_layout_fields($user)
{
    if (!current_theme_supports('genesis-archive-layouts')) {
        return;
    }
    if (!genesis_has_multiple_layouts()) {
        return;
    }
    if (!current_user_can('edit_users', $user->ID)) {
        return false;
    }
    $layout = get_the_author_meta('layout', $user->ID);
    $layout = $layout ? $layout : '';
    ?>
	<h3><?php 
    _e('Layout Settings', 'genesis');
    ?>
</h3>
	<p><span class="description"><?php 
    _e('These settings apply to this author\'s archive pages.', 'genesis');
    ?>
</span></p>
	<table class="form-table">
		<tbody>
			<tr>
				<th scope="row"><?php 
    _e('Choose Layout', 'genesis');
    ?>
</th>
				<td>
					<fieldset class="genesis-layout-selector">
						<legend class="screen-reader-text"><?php 
    _e('Choose Layout', 'genesis');
    ?>
</legend>

						<p><input type="radio" name="genesis-meta[layout]" class="default-layout" id="default-layout" value="" <?php 
    checked($layout, '');
    ?>
 /> <label class="default" for="default-layout"><?php 
    printf(__('Default Layout set in <a href="%s">Theme Settings</a>', 'genesis'), menu_page_url('genesis', 0));
    ?>
</label></p>
						<?php 
    genesis_layout_selector(array('name' => 'genesis-meta[layout]', 'selected' => $layout, 'type' => 'site'));
    ?>

					</fieldset>
				</td>
			</tr>
		</tbody>
	</table>
	<?php 
}
コード例 #6
0
ファイル: theme-settings.php プロジェクト: netmagik/netmagik
 /**
  * Register meta boxes on the Theme Settings page.
  *
  * Some of the meta box additions are dependent on certain theme support or user capabilities.
  *
  * The 'genesis_theme_settings_metaboxes' action hook is called at the end of this function.
  *
  * @since 1.0.0
  *
  * @see \Genesis_Admin_Settings::info_box()          Callback for Information box.
  * @see \Genesis_Admin_Settings::style_box()         Callback for Color Style box (if supported).
  * @see \Genesis_Admin_Settings::feeds_box()         Callback for Custom Feeds box.
  * @see \Genesis_Admin_Settings::layout_box()        Callback for Default Layout box.
  * @see \Genesis_Admin_Settings::header_box()        Callback for Header box (if no custom header support).
  * @see \Genesis_Admin_Settings::nav_box()           Callback for Navigation box.
  * @see \Genesis_Admin_Settings::breadcrumb_box()    Callback for Breadcrumbs box.
  * @see \Genesis_Admin_Settings::comments_box()      Callback for Comments and Trackbacks box.
  * @see \Genesis_Admin_Settings::post_archives_box() Callback for Content Archives box.
  * @see \Genesis_Admin_Settings::blogpage_box()      Callback for Blog Page box.
  * @see \Genesis_Admin_Settings::scripts_box()       Callback for Header and Footer Scripts box (if user has
  *                                                   unfiltered_html capability).
  */
 function metaboxes()
 {
     add_action('genesis_admin_before_metaboxes', array($this, 'hidden_fields'));
     add_meta_box('genesis-theme-settings-version', __('Information', 'genesis'), array($this, 'info_box'), $this->pagehook, 'main', 'high');
     if (current_theme_supports('genesis-style-selector')) {
         add_meta_box('genesis-theme-settings-style-selector', __('Color Style', 'genesis'), array($this, 'style_box'), $this->pagehook, 'main');
     }
     add_meta_box('genesis-theme-settings-feeds', __('Custom Feeds', 'genesis'), array($this, 'feeds_box'), $this->pagehook, 'main');
     if (genesis_has_multiple_layouts()) {
         add_meta_box('genesis-theme-settings-layout', __('Default Layout', 'genesis'), array($this, 'layout_box'), $this->pagehook, 'main');
     }
     if (!current_theme_supports('genesis-custom-header') && !current_theme_supports('custom-header')) {
         add_meta_box('genesis-theme-settings-header', __('Header', 'genesis'), array($this, 'header_box'), $this->pagehook, 'main');
     }
     if (current_theme_supports('genesis-menus') && genesis_first_version_compare('2.0.2', '<=')) {
         add_meta_box('genesis-theme-settings-nav', __('Navigation', 'genesis'), array($this, 'nav_box'), $this->pagehook, 'main');
     }
     if (current_theme_supports('genesis-breadcrumbs')) {
         add_meta_box('genesis-theme-settings-breadcrumb', __('Breadcrumbs', 'genesis'), array($this, 'breadcrumb_box'), $this->pagehook, 'main');
     }
     add_meta_box('genesis-theme-settings-comments', __('Comments and Trackbacks', 'genesis'), array($this, 'comments_box'), $this->pagehook, 'main');
     add_meta_box('genesis-theme-settings-posts', __('Content Archives', 'genesis'), array($this, 'post_archives_box'), $this->pagehook, 'main');
     add_meta_box('genesis-theme-settings-blogpage', __('Blog Page Template', 'genesis'), array($this, 'blogpage_box'), $this->pagehook, 'main');
     if (current_user_can('unfiltered_html')) {
         add_meta_box('genesis-theme-settings-scripts', __('Header and Footer Scripts', 'genesis'), array($this, 'scripts_box'), $this->pagehook, 'main');
     }
     do_action('genesis_theme_settings_metaboxes', $this->pagehook);
 }