[wp-trac] [WordPress Trac] #12806: twentyten_setup can't be removed in a clean manner
WordPress Trac
wp-trac at lists.automattic.com
Fri Apr 2 01:08:14 UTC 2010
#12806: twentyten_setup can't be removed in a clean manner
--------------------------+-------------------------------------------------
Reporter: jorbin | Owner:
Type: defect (bug) | Status: closed
Priority: high | Milestone: 3.0
Component: Themes | Version: 3.0
Severity: normal | Resolution: fixed
Keywords: has-patch |
--------------------------+-------------------------------------------------
Comment(by nacin):
I don't have a problem with [13923], but I fail to see how the example in
the inline docs doesn't handle this without feeling like a hack:
{{{
* Functions that are not pluggable (not wrapped in function_exists()) are
instead attached
* to a filter or action hook. The hook can be removed by using
remove_action() or
* remove_filter() and you can attach your own function to the hook.
*
* In this example, since both hooks are attached using the default
priority (10), the first
* one attached (which would be the child theme) will run. We can remove
the parent theme's
* hook only after it is attached, which means we need to wait until
setting up the child theme:
*
* <code>
* add_action( 'after_setup_theme', 'my_child_theme_setup' );
* function my_child_theme_setup() {
* // We are replacing twentyten_setup() with my_child_theme_setup()
* remove_action( 'after_setup_theme', 'twentyten_setup' );
* // We are providing our own filter for excerpt_length (or using the
unfiltered value)
* remove_filter( 'excerpt_length', 'twentyten_excerpt_length' );
* ...
* }
* </code>
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12806#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list