Compare these examples:
<?php // Sets WordPress admin bar hidden. // Old: add_filter('show_admin_bar', '__return_false'); // New: add_filter('show_admin_bar', function() { return false; }); // Activate widgets // Old: add_action('widgets_init', create_function('', 'return register_widget("Your_Widget_Class");') ); // New: add_action('widgets_init', function() { register_widget('Your_Widget_Class'); });
And of course that this can be used everywhere you're using function such
add_action
, add_filter etc.
No comments:
Post a Comment