[wp-trac] [WordPress Trac] #10535: _wp_filter_build_unique_id issues with the first time a filter is hooked by a class
WordPress Trac
wp-trac at lists.automattic.com
Sun Aug 2 13:53:21 UTC 2009
#10535: _wp_filter_build_unique_id issues with the first time a filter is hooked by
a class
---------------------------+------------------------------------------------
Reporter: simonwheatley | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 2.9
Component: Plugins | Version: 2.9
Severity: normal | Keywords: has-patch tested
---------------------------+------------------------------------------------
Comment(by simonwheatley):
Tested 10535.2.diff and this works in my use case(s) where current code
doesn't. Tested with and without the spl_object_hash function.
Thanks DD32 and Hakre.
In brief my use case in code is:
{{{
class Some_Class {
// Blah blah
function widget($args, $instance) {
// Blah blah
// This is the first time anyone has hooked posts_fields
in this app
add_filter( 'posts_fields', array( & $this, 'posts_fields'
) );
$r = new WP_Query( $query_args );
// Blah blah
// This is the remove_filter call which doesn't work with
the current code
remove_filter( 'posts_fields', array( & $this,
'posts_fields' ) );
}
// Blah blah
}
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/10535#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list