コード例 #1
0
ファイル: cpt-archive-settings.php プロジェクト: nkeat12/dv
 /**
  * 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');
     }
     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 fields for user permissions for Genesis features to the user edit screen.
 *
 * Checkbox settings are:
 *
 * * Enable Genesis Admin Menu?
 * * Enable SEO Settings Submenu?
 * * Enable Import/Export Submenu?
 *
 * @since 1.4.0
 *
 * @param \WP_User $user User object.
 *
 * @return false Return false if current user can not edit users.
 */
function genesis_user_options_fields($user)
{
    if (!current_user_can('edit_users', $user->ID)) {
        return false;
    }
    ?>
	<h3><?php 
    _e('User Permissions', 'genesis');
    ?>
</h3>
	<table class="form-table">
		<tbody>
			<tr>
				<th scope="row"><?php 
    _e('Genesis Admin Menus', 'genesis');
    ?>
</th>
				<td>
					<label for="genesis-meta[genesis_admin_menu]"><input id="genesis-meta[genesis_admin_menu]" name="genesis-meta[genesis_admin_menu]" type="checkbox" value="1" <?php 
    checked(get_the_author_meta('genesis_admin_menu', $user->ID));
    ?>
 />
					<?php 
    _e('Enable Genesis Admin Menu?', 'genesis');
    ?>
</label><br />

					<?php 
    if (!genesis_seo_disabled()) {
        ?>
					<label for="genesis-meta[genesis_seo_settings_menu]"><input id="genesis-meta[genesis_seo_settings_menu]" name="genesis-meta[genesis_seo_settings_menu]" type="checkbox" value="1" <?php 
        checked(get_the_author_meta('genesis_seo_settings_menu', $user->ID));
        ?>
 />
					<?php 
        _e('Enable SEO Settings Submenu?', 'genesis');
        ?>
</label><br />
					<?php 
    }
    ?>

					<label for="genesis-meta[genesis_import_export_menu]"><input id="genesis-meta[genesis_import_export_menu]" name="genesis-meta[genesis_import_export_menu]" type="checkbox" value="1" <?php 
    checked(get_the_author_meta('genesis_import_export_menu', $user->ID));
    ?>
 />
					<?php 
    _e('Enable Import/Export Submenu?', 'genesis');
    ?>
</label>
				</td>
			</tr>
		</tbody>
	</table>
	<?php 
}
コード例 #3
0
ファイル: load-scripts.php プロジェクト: hscale/webento
/**
 * Conditionally enqueues the scripts used in the admin.
 *
 * Includes Thickbox, theme preview and a Genesis script (actually enqueued
 * in genesis_load_admin_js()).
 *
 * @since 0.2.3
 *
 * @uses genesis_load_admin_js()
 * @uses genesis_is_menu_page()
 * @uses genesis_update_check()
 * @uses genesis_seo_disabled()
 *
 * @global stdClass $post Post object
 *
 * @param string $hook_suffix Admin page identifier.
 */
function genesis_load_admin_scripts($hook_suffix)
{
    /** Only add thickbox/preview if there is an update to Genesis available */
    if (genesis_update_check()) {
        add_thickbox();
        wp_enqueue_script('theme-preview');
        genesis_load_admin_js();
    }
    /** If we're on a Genesis admin screen */
    if (genesis_is_menu_page('genesis') || genesis_is_menu_page('seo-settings') || genesis_is_menu_page('design-settings')) {
        genesis_load_admin_js();
    }
    global $post;
    /** If we're viewing an edit post page, make sure we need Genesis SEO JS */
    if ('post-new.php' == $hook_suffix || 'post.php' == $hook_suffix) {
        if (!genesis_seo_disabled() && post_type_supports($post->post_type, 'genesis-seo')) {
            genesis_load_admin_js();
        }
    }
}
コード例 #4
0
/**
 * Conditionally enqueue the scripts used in the admin.
 *
 * Includes Thickbox, theme preview and a Genesis script (actually enqueued in genesis_load_admin_js()).
 *
 * @since 0.2.3
 *
 * @uses genesis_load_admin_js() Enqueues the custom script and localizations used in the admin.
 * @uses genesis_is_menu_page()  Check that we're targeting a specific Genesis admin page.
 * @uses genesis_update_check()  Ping http://api.genesistheme.com/ asking if a new version of this theme is available.
 * @uses genesis_seo_disabled()  Detect whether or not Genesis SEO has been disabled.
 *
 * @param string $hook_suffix Admin page identifier.
 */
function genesis_load_admin_scripts($hook_suffix)
{
    //* Only add thickbox/preview if there is an update to Genesis available
    if (genesis_update_check()) {
        add_thickbox();
        wp_enqueue_script('theme-preview');
        genesis_load_admin_js();
    }
    //* If we're on a Genesis admin screen
    if (genesis_is_menu_page('genesis') || genesis_is_menu_page('seo-settings') || genesis_is_menu_page('design-settings')) {
        genesis_load_admin_js();
    }
    //* If we're viewing an edit post page, make sure we need Genesis SEO JS
    if (in_array($hook_suffix, array('post-new.php', 'post.php'))) {
        if (!genesis_seo_disabled() && post_type_supports(get_post_type(), 'genesis-seo')) {
            genesis_load_admin_js();
        }
    }
}
コード例 #5
0
ファイル: whats-new.php プロジェクト: netmagik/netmagik
    /**
     * Callback for displaying the What's New admin page.
     *
     * @since 1.9.0
     */
    public function admin()
    {
        ?>
		<div class="wrap about-wrap">

		<img src="<?php 
        echo get_template_directory_uri() . '/lib/admin/images/whats-new.png';
        ?>
" class="alignright whats-new" />

		<h1><?php 
        echo esc_html(get_admin_page_title());
        ?>
</h1>

		<p class="about-text"><?php 
        _e('Genesis 2.4 focuses mainly on updating and adding inline documentation, better conforming to the WordPress code standards, and enhancing the Markup API so that most Genesis generated markup is filterable.', 'genesis');
        ?>
</p>


		<div class="changelog">
			<div class="feature-section">

			<h3><?php 
        _e('Added', 'genesis');
        ?>
</h3>
			<ul>
				<li><?php 
        _e('Added <code>unfiltered_or_safe_html</code> sanitizer.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Added or corrected lots of inline documentation.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Added <code>phpcs.xml</code> file for code standards testing.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Added identifying classes to featured posts\' "More Posts" section title and list.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Added <code>$wrap</code> and <code>$title</code> to the passed arguments of the <code>genesis_post_title_output</code> filter.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Added new features to the Markup API, allowing for open and close arguments, passing content, and new filters.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Added <code>js-superfish</code> class to all menus that support it.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Added missing "to" in <code>genesis_prev_next_post_nav()</code>\'s comment header.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Added new functions that handle the logic for meta and favicon markup, and amended existing output functions to use them.', 'genesis');
        ?>
</li>
			</ul>

			<h3><?php 
        _e('Changed', 'genesis');
        ?>
</h3>
			<ul>
				<li><?php 
        _e('Changed URLs for gravatars on the "What\'s New" page to use HTTPS.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Corrected typo on SEO settings screen.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Changed Featured Post widget to use placeholder instead of default value for number of posts to show.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Updated <code>CHANGELOG.md</code> with release notes going back to 1.6.0.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Changed CPT archive intro setting to use <code>unfiltered_or_safe_html</code> sanitizer.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Changed some code and all documentation to better match WordPress coding standards.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Moved <code>h1</code> elements outside the form on admin settings pages.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Changed Featured Post entry header to display <code>&lt;header&gt;</code> wrapper even when only byline is showing.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Changed heading on the import/export admin page to <code>h2</code> from <code>h1</code>.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Extracted XHTML from Genesis output, and added it back in with new Markup API filters if HTML5 is not supported.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Moved SEO tooltips to Help tab on post editor screen.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Changed to use of time constants in update check transients.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Changed sitemap to hide Posts-related sections if the site has no Posts.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Changed <code>genesis_user_meta_default_on()</code> and <code>Genesis_Admin::create()</code> to do return checks earlier.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Moved <code>genesis_create_initial_layouts()</code> to the <code>genesis_setup</code> hook. Possible breaking change, in order to ensure compatibility with WordPress 4.7+.', 'genesis');
        ?>
</li>
			</ul>

			<h3><?php 
        _e('Removed', 'genesis');
        ?>
</h3>
			<ul>
				<li><?php 
        _e('Removed colons from labels on settings screens.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Removed errant <code>$</code> in the URL used in the "parent theme active" admin notice.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Removed unused global for Admin Readme class.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Removed dead code in two post shortcode callback functions.', 'genesis');
        ?>
</li>
				<li><?php 
        _e('Removed unused parameters in <code>genesis_nav_menu_link_attributes()</code>.', 'genesis');
        ?>
</li>
			</ul>

			</div>
		</div>

		<div class="project-leads">

			<h2><?php 
        _e('Project Leads', 'genesis');
        ?>
</h2>

			<ul class="wp-people-group " id="wp-people-group-project-leaders">
			<li class="wp-person">
				<a href="http://twitter.com/nathanrice"><img src="https://0.gravatar.com/avatar/fdbd4b13e3bcccb8b48cc18f846efb7f?s=120" class="gravatar" alt="Nathan Rice" /></a>
				<a class="web" href="http://twitter.com/nathanrice">Nathan Rice</a>
				<span class="title"><?php 
        _e('Lead Developer', 'genesis');
        ?>
</span>
			</li>
			<li class="wp-person">
				<a href="http://twitter.com/bgardner"><img src="https://0.gravatar.com/avatar/c845c86ebe395cea0d21c03bc4a93957?s=120" class="gravatar" alt="Brian Gardner" /></a>
				<a class="web" href="http://twitter.com/bgardner">Brian Gardner</a>
				<span class="title"><?php 
        _e('Lead Developer', 'genesis');
        ?>
</span>
			</li>
			</ul>

		</div>

		<div class="contributors">

			<h2><?php 
        _e('Contributors', 'genesis');
        ?>
</h2>

			<ul class="wp-people-group" id="wp-people-group-contributing-developers">
			<?php 
        $contributors = genesis_contributors();
        shuffle($contributors);
        foreach ($contributors as $contributor) {
            echo '<li class="wp-person">';
            printf('<a href="%s"><img src="%s" alt="%s" class="gravatar" /></a><a class="web" href="%s">%s</a>', esc_url($contributor['url']), esc_url($contributor['gravatar']), esc_attr($contributor['name']), esc_url($contributor['url']), esc_html($contributor['name']));
            printf('<span class="title">%s</span>', __('Contributor', 'genesis'));
            echo '</li>' . "\n";
        }
        ?>
			</ul>

		</div>

		<div class="return-to-dashboard">
			<p><a href="<?php 
        echo esc_url(menu_page_url('genesis', 0));
        ?>
"><?php 
        _e('Go to Theme Settings &rarr;', 'genesis');
        ?>
</a></p>
			<?php 
        if (!genesis_seo_disabled()) {
            ?>
<p><a href="<?php 
            echo esc_url(menu_page_url('seo-settings', 0));
            ?>
"><?php 
            _e('Go to SEO Settings &rarr;', 'genesis');
            ?>
</a></p><?php 
        }
        ?>

		</div>

		</div>
		<?php 
    }
コード例 #6
0
    /**
     * Callback for displaying the What's New admin page.
     *
     * @since 1.9.0
     */
    public function admin()
    {
        ?>
		<div class="wrap about-wrap">

		<img src="<?php 
        echo get_template_directory_uri() . '/lib/admin/images/whats-new.png';
        ?>
" class="alignright whats-new" />

		<h1><?php 
        echo esc_html(get_admin_page_title());
        ?>
</h1>

		<div class="about-text"><?php 
        printf(__('Congratulations! You\'re now running Genesis %s.', 'genesis'), PARENT_THEME_BRANCH);
        ?>
</div>

		<div class="changelog">
			<h2><?php 
        _e('What&#8217;s New', 'genesis');
        ?>
</h2>
			<div class="feature-section">

			<p><?php 
        _e('Occasionally, even the most mature software needs a little freshening up. Instead of focusing on big new features and large changes, we opted to go through the backlog of bug reports and enhancement suggestions. The result is a much more polished and stable Genesis Framework. Have a look at what has changed in 2.3.', 'genesis');
        ?>
</p>

				<h3><?php 
        _e('New and Improved', 'genesis');
        ?>
</h3>

					<ul>
						<li><?php 
        _e('A CHANGELOG.md file for the project. (yay!)', 'genesis');
        ?>
</li>
						<li><?php 
        _e('Update to normalize.css 4.1.1.', 'genesis');
        ?>
</li>
						<li><?php 
        _e('Update our theme tags in style.css.', 'genesis');
        ?>
</li>
						<li><?php 
        _e('Improve the look of the settings screens.', 'genesis');
        ?>
</li>
						<li><?php 
        _e('Pass entry image link through the markup API.', 'genesis');
        ?>
</li>
						<li><?php 
        _e('Add a toolbar link to CPT archive settings when viewing a CPT archive.', 'genesis');
        ?>
</li>
						<li><?php 
        _e('Add shortcodes for site title and home link.', 'genesis');
        ?>
</li>
						<li><?php 
        _e('Enable after entry widget area for all post types via post type support.', 'genesis');
        ?>
</li>
						<li><?php 
        _e('Hide layout selector when only one layout is supported.', 'genesis');
        ?>
</li>
						<li><?php 
        _e('Use TinyMCE (visual editor) for archive intro text input.', 'genesis');
        ?>
</li>
						<li><?php 
        _e('Allow foreign language characters in content limit functions.', 'genesis');
        ?>
</li>
						<li><?php 
        _e('Add accessibility to the paginated post navigation.', 'genesis');
        ?>
</li>
						<li><?php 
        _e('Allow adjacent single entry navigation via post type support.', 'genesis');
        ?>
</li>
						<li><?php 
        _e('Added relative_depth parameter to date shortcodes.', 'genesis');
        ?>
</li>
					</ul>


				<h3><?php 
        _e('Bug Fixes', 'genesis');
        ?>
</h3>
				<p>
					<ul>
						<li><?php 
        _e('Use correct class for superfish hover state.', 'genesis');
        ?>
</li>
						<li><?php 
        _e('Prevent empty footer widgets markup.', 'genesis');
        ?>
</li>
						<li><?php 
        _e('Prevent empty spaces in entry footer of CPTs.', 'genesis');
        ?>
</li>
						<li><?php 
        _e('Prevent author shortcode from outputting empty markup when no author is assigned.', 'genesis');
        ?>
</li>
						<li><?php 
        _e("Disable author box on entries where post type doesn't support author.", 'genesis');
        ?>
</li>
						<li><?php 
        _e('Disable author shortcode output if author is not supported by post type.', 'genesis');
        ?>
</li>
						<li><?php 
        _e('Fix issue with no sitemap when running html5 and no a11y support for 404 page.', 'genesis');
        ?>
</li>
						<li><?php 
        _e('Exclude posts page from page selection dropdown in Featured Page widget.', 'genesis');
        ?>
</li>
					</ul>
				</p>

				</div>
		</div>

		<div class="project-leads">

			<h2><?php 
        _e('Project Leads', 'genesis');
        ?>
</h2>

			<ul class="wp-people-group " id="wp-people-group-project-leaders">
			<li class="wp-person">
				<a href="http://twitter.com/nathanrice"><img src="//0.gravatar.com/avatar/fdbd4b13e3bcccb8b48cc18f846efb7f?s=120" class="gravatar" alt="Nathan Rice" /></a>
				<a class="web" href="http://twitter.com/nathanrice">Nathan Rice</a>
				<span class="title"><?php 
        _e('Lead Developer', 'genesis');
        ?>
</span>
			</li>
			<li class="wp-person">
				<a href="http://twitter.com/bgardner"><img src="//0.gravatar.com/avatar/c845c86ebe395cea0d21c03bc4a93957?s=120" class="gravatar" alt="Brian Gardner" /></a>
				<a class="web" href="http://twitter.com/bgardner">Brian Gardner</a>
				<span class="title"><?php 
        _e('Lead Developer', 'genesis');
        ?>
</span>
			</li>
			</ul>

		</div>

		<div class="contributors">

			<h2><?php 
        _e('Contributors', 'genesis');
        ?>
</h2>

			<ul class="wp-people-group" id="wp-people-group-contributing-developers">
			<?php 
        $contributors = genesis_contributors();
        shuffle($contributors);
        foreach ($contributors as $contributor) {
            echo '<li class="wp-person">';
            printf('<a href="%s"><img src="%s" alt="%s" class="gravatar" /></a><a class="web" href="%s">%s</a>', esc_url($contributor['url']), esc_url($contributor['gravatar']), esc_attr($contributor['name']), esc_url($contributor['url']), esc_html($contributor['name']));
            printf('<span class="title">%s</span>', __('Contributor', 'genesis'));
            echo '</li>' . "\n";
        }
        ?>
			</ul>

		</div>

		<div class="return-to-dashboard">
			<p><a href="<?php 
        echo esc_url(menu_page_url('genesis', 0));
        ?>
"><?php 
        _e('Go to Theme Settings &rarr;', 'genesis');
        ?>
</a></p>
			<?php 
        if (!genesis_seo_disabled()) {
            ?>
<p><a href="<?php 
            echo esc_url(menu_page_url('seo-settings', 0));
            ?>
"><?php 
            _e('Go to SEO Settings &rarr;', 'genesis');
            ?>
</a></p><?php 
        }
        ?>

		</div>

		</div>
		<?php 
    }
コード例 #7
0
    /**
     * Callback for displaying the What's New admin page.
     *
     * @since 1.9.0
     */
    public function admin()
    {
        ?>
		<div class="wrap about-wrap">

		<img src="<?php 
        echo get_template_directory_uri() . '/lib/admin/images/whats-new.png';
        ?>
" class="alignright whats-new" />

		<h1><?php 
        echo esc_html(get_admin_page_title());
        ?>
</h1>

		<div class="about-text"><?php 
        printf(__('Congratulations! You\'re now running Genesis %s.', 'genesis'), PARENT_THEME_BRANCH);
        ?>
</div>

		<div class="changelog">
			<h2><?php 
        _e('What&#8217;s New', 'genesis');
        ?>
</h2>
			<div class="feature-section">

				<h3><?php 
        _e('Accessibility', 'genesis');
        ?>
</h3>
				<p><?php 
        _e('Child themes now have the ability to turn on accessibility features like special text for screen readers, accessible search forms, consistent page and section headings, skip links, and an accessible drop-down navigation menu.', 'genesis');
        ?>
</p>

				<h3><?php 
        _e('Schema.org Microdata Improvements', 'genesis');
        ?>
</h3>
				<p><?php 
        _e('Genesis continues to improve its implementation of Schema.org microdata in our markup, now including breadcrumb microdata.', 'genesis');
        ?>
</p>

				<h3><?php 
        _e('WordPress Feature Compatibility', 'genesis');
        ?>
</h3>
				<p><?php 
        _e('WordPress recently included support for generated title tags, as well as adding support for uploading a custom site icon, and now Genesis is compatible with both new features.', 'genesis');
        ?>
</p>

				</div>
		</div>

		<div class="project-leads">

			<h2><?php 
        _e('Project Leads', 'genesis');
        ?>
</h2>

			<ul class="wp-people-group " id="wp-people-group-project-leaders">
			<li class="wp-person">
				<a href="http://twitter.com/nathanrice"><img src="//0.gravatar.com/avatar/fdbd4b13e3bcccb8b48cc18f846efb7f?s=120" class="gravatar" alt="Nathan Rice" /></a>
				<a class="web" href="http://twitter.com/nathanrice">Nathan Rice</a>
				<span class="title"><?php 
        _e('Lead Developer', 'genesis');
        ?>
</span>
			</li>
			<li class="wp-person">
				<a href="http://twitter.com/bgardner"><img src="//0.gravatar.com/avatar/c845c86ebe395cea0d21c03bc4a93957?s=120" class="gravatar" alt="Brian Gardner" /></a>
				<a class="web" href="http://twitter.com/bgardner">Brian Gardner</a>
				<span class="title"><?php 
        _e('Lead Developer', 'genesis');
        ?>
</span>
			</li>
			</ul>

		</div>

		<div class="contributors">

			<h2><?php 
        _e('Contributors', 'genesis');
        ?>
</h2>

			<ul class="wp-people-group" id="wp-people-group-contributing-developers">
			<?php 
        $contributors = genesis_contributors();
        shuffle($contributors);
        foreach ($contributors as $contributor) {
            echo '<li class="wp-person">';
            printf('<a href="%s"><img src="%s" alt="%s" class="gravatar" /></a><a class="web" href="%s">%s</a>', esc_url($contributor['url']), esc_url($contributor['gravatar']), esc_attr($contributor['name']), esc_url($contributor['url']), esc_html($contributor['name']));
            printf('<span class="title">%s</span>', __('Contributor', 'genesis'));
            echo '</li>' . "\n";
        }
        ?>
			</ul>

		</div>

		<div class="return-to-dashboard">
			<p><a href="<?php 
        echo esc_url(menu_page_url('genesis', 0));
        ?>
"><?php 
        _e('Go to Theme Settings &rarr;', 'genesis');
        ?>
</a></p>
			<?php 
        if (!genesis_seo_disabled()) {
            ?>
<p><a href="<?php 
            echo esc_url(menu_page_url('seo-settings', 0));
            ?>
"><?php 
            _e('Go to SEO Settings &rarr;', 'genesis');
            ?>
</a></p><?php 
        }
        ?>

		</div>

		</div>
		<?php 
    }