Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move $content_width within setup function #460

Merged
merged 1 commit into from
May 11, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
* @package _s
*/

/**
* Set the content width based on the theme's design and stylesheet.
*/
if ( ! isset( $content_width ) ) {
$content_width = 640; /* pixels */
}

if ( ! function_exists( '_s_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
Expand Down Expand Up @@ -65,6 +58,18 @@ function _s_setup() {
endif; // _s_setup
add_action( 'after_setup_theme', '_s_setup' );

/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
function _s_content_width() {
$GLOBALS['content_width'] = apply_filters( '_s_content_width', 640 );
}
add_action( 'after_setup_theme', '_s_content_width', 0 );

/**
* Register widget area.
*
Expand Down