create 2 custom columns in page edit in Admin panel

functions attached to manage_pages_custom_column get fired for every custom column, you have to check the name of the column within the function to only output data for that specific column: add_action( ‘manage_pages_custom_column’, ‘AddColumnValue’, 10, 2 ); function AddColumnValue( $column_name, $post_id ) { if( ‘thumbnail’ == $column_name ): echo ‘Header Image data here’; elseif( ‘cssColor’ == … Read more

Declaring arguments for taxonomy

The third argument of add_action is the priority, or order in which functions hooked to an action will be executed. from add_action in codex: (optional) Used to specify the order in which the functions associated with a particular action are executed. Lower numbers correspond with earlier execution, and functions with the same priority are executed … Read more

stumped on add_action hook to delete_comment – any ideas?

Unless you’re passing $force_delete as true when calling wp_delete_comment(), the delete_comment hook doesn’t fire. This is because WordPress calls wp_trash_comment() at the beginning of wp_delete_comment() if $force_delete isn’t set true. Try hooking into the trash_comment action hook: function _dbdb_delete_comment( $comment_id ){ $filter = current_filter(); var_dump( $filter ); var_dump( $comment_id ); wp_die( __FUNCTION__ ); } add_action(‘delete_comment’, … Read more

Dynamic wp_enqueue_scripts?

You could use anonymous functions in PHP 5.3+ to do this. <?php function addThemeJS($enqueueThemeJS, $handle, $src, $deps, $ver, $in_footer) { add_action(‘wp_enqueue_scripts’, function() use ($handle, $src, $deps, $ver, $in_footer) { wp_enqueue_script($handle, $src, $deps, $ver, $in_footer); }); } If you’re using this a personal project where you know the server has 5.3+ you would be okay if … Read more

Finding actual functions added to hooks and filters

This is more of PHP programming question, rather than WordPress one. 🙂 If you are interested in exploring function of WordPress core alone, there is number of ways dedicated to that: Codex has function reference that is human maintained – so it’s not comprehensive but can include additional information for important functions; xref is code … Read more

Is there a author_update action?

There’s the edit_user_profile_update and personal_options_update actions that runs after a user is updated, with access to the user object. There’s also a variable update_{$meta_type}_meta action that runs when meta of type user is updated.