Is This A Correct Example Usage Of current_filter()?

Hi @Raj Sekharan: Looks good to me, but is wanting to know the current usage really your question or do you want to understand where current_filter() gets it’s information from? If the latter, here’s basically what happens in all the different hook processing functions, e.g. do_action(), apply_filters(), do_action_ref_array(), apply_filters_ref_array() (greatly simplified, of course): <?php function … Read more

How and why can a hook call itself without causing recursion?

This: apply_filters( ‘image_downsize’, false, $id, $size ) doesn’t call the image_downsize function, it applies any filters hooked to the image_downsize tag, which would be a different function. The only way that would cause recursion is if the filter you hook in turn called that function: add_filter( ‘image_downsize’, ‘wpd_downsize’, 20, 3 ); function wpd_downsize( $return, $id, … Read more

Is there a recover_post hook to go with trash_post hook?

Looking at the code for WP 3.3.2, it seems that trash_post is actually wp_trash_post. From the wp_trash_post() function in /wp-includes/post.php: do_action(‘wp_trash_post’, $post_id); add_post_meta($post_id,’_wp_trash_meta_status’, $post[‘post_status’]); add_post_meta($post_id,’_wp_trash_meta_time’, time()); $post[‘post_status’] = ‘trash’; wp_insert_post($post); wp_trash_post_comments($post_id); do_action(‘trashed_post’, $post_id); So … I’d double check the hook you’re using to set your initial flag. However, there is a hook you can use … Read more

How to use the post_updated hook before and after arguments

First off you are using the function wrong. The function is tied to an action within wordpress whenever you use the add_action function. In this case you have added it to the post_updated action. Basically your check_values function gets added to a queue which will then get called by the action when its time to … Read more

action lifecycle

The order and appearance of actions depend on the page and the loaded files. get_search_form() for example fires an action ‘get_search_form’ and (oddly enough) also a filter ‘get_search_form’. But if no search form is loaded the action will not be available. The only way to really know which actions are available is to look at … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)