forked from mirror/_s
Merge pull request #460 from grappler/content_width
Move $content_width within setup function
This commit is contained in:
commit
ce796e39a5
|
@ -5,13 +5,6 @@
|
||||||
* @package _s
|
* @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' ) ) :
|
if ( ! function_exists( '_s_setup' ) ) :
|
||||||
/**
|
/**
|
||||||
* Sets up theme defaults and registers support for various WordPress features.
|
* Sets up theme defaults and registers support for various WordPress features.
|
||||||
|
@ -78,6 +71,18 @@ function _s_setup() {
|
||||||
endif; // _s_setup
|
endif; // _s_setup
|
||||||
add_action( 'after_setup_theme', '_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.
|
* Register widget area.
|
||||||
*
|
*
|
||||||
|
|
Reference in New Issue