Skip to content

Commit

Permalink
Move a few actions/filters out of the core Hybrid class into appropri…
Browse files Browse the repository at this point in the history
…ate files. Consolidate the actions and filters methods.

git-svn-id: http://svn.locallylost.com/themes/hybrid-core/trunk@408 dba0f204-706d-4bc1-bc29-8b92e0485636
  • Loading branch information
greenshady committed Oct 16, 2010
1 parent 8cb9113 commit b2d4785
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 25 deletions.
6 changes: 6 additions & 0 deletions functions/media.php
Expand Up @@ -8,6 +8,12 @@
* @subpackage Functions
*/

/* Load specific scripts for the framework. */
add_action( 'template_redirect', 'hybrid_enqueue_script' );

/* Load the development stylsheet in script debug mode. */
add_filter( 'stylesheet_uri', 'hybrid_debug_stylesheet', 10, 2 );

/**
* Function for using a debug stylesheet when developing. To develop with the debug stylesheet,
* SCRIPT_DEBUG must be set to 'true' in the 'wp-config.php' file. This will check if a 'style.dev.css'
Expand Down
33 changes: 8 additions & 25 deletions hybrid.php
Expand Up @@ -81,11 +81,8 @@ function __construct() {
/* Language functions and translations setup. */
add_action( 'after_setup_theme', array( &$this, 'locale' ), 3 );

/* Initialize the framework's default actions. */
add_action( 'after_setup_theme', array( &$this, 'actions' ), 4 );

/* Initialize the framework's default filters. */
add_action( 'after_setup_theme', array( &$this, 'filters' ), 4 );
/* Initialize the framework's default actions and filters. */
add_action( 'after_setup_theme', array( &$this, 'default_filters' ), 4 );

/* Load the framework functions. */
add_action( 'after_setup_theme', array( &$this, 'functions' ), 12 );
Expand Down Expand Up @@ -278,39 +275,25 @@ function admin() {
}

/**
* Adds the default theme actions.
* Adds the default framework actions and filters.
*
* @since 0.7.0
* @since 1.0.0
*/
function actions() {
function default_filters() {

/* Remove WP and plugin functions. */
/* Move the WordPress generator to a better priority. */
remove_action( 'wp_head', 'wp_generator' );

/* Head actions. */
add_action( 'wp_head', 'wp_generator', 1 );
add_action( 'wp_head', 'hybrid_meta_template', 1 );

/* WP print scripts. */
add_action( 'template_redirect', 'hybrid_enqueue_script' );
}

/**
* Adds the default theme filters.
*
* @since 0.7.0
*/
function filters() {
/* Add the theme info to the header (lets theme developers give better support). */
add_action( 'wp_head', 'hybrid_meta_template', 1 );

/* Filter the textdomain mofile to allow child themes to load the parent theme translation. */
add_filter( 'load_textdomain_mofile', 'hybrid_load_textdomain', 10, 2 );

/* Make text widgets and term descriptions shortcode aware. */
add_filter( 'widget_text', 'do_shortcode' );
add_filter( 'term_description', 'do_shortcode' );

/* Stylesheet filters. */
add_filter( 'stylesheet_uri', 'hybrid_debug_stylesheet', 10, 2 );
}
}

Expand Down

0 comments on commit b2d4785

Please sign in to comment.