Proper indentation of code generated inside hooks

I don’t think correct global indentation is possible without massive (and inefficient) output buffering to change it. Since you are primarily interested in this for debug purposes I suggest using some tool that will format and color-code output (of any page btw, not just those that you control). Firebug and View Source Chart work nicely … Read more

how to determine how many and what kind of arguments are passed to hooks

When calling an action hook using add_action(‘some_action_tag’,’callback_function’,$priority,$number_of_arguments); The callback function is called when a do_action() call is fired with the corresponding tag for example: do_action(‘some_action_tag’,$argument1,$argument2,$argument3….); And when calling a filter hook using: add_filter(‘some_filter_tag’,’callback_function’,$priority,$number_of_arguments); The callback function is called when a apply_filters() call is fired with the corresponding tag for example: $value = apply_filters(‘some_filter_tag’,$argument1,$argument2,$argument3…); Now as … Read more

Does update_comment_meta hook exists?

Well, it’s a little bit complicated 😉 If you will search update_comment_meta hook, you won’t find it. But it exists 🙂 There is update_comment_meta function and it calls update_metadata function with first param set to comment. This update_metadata function does something like this (meta.php line 149): do_action( “update_{$meta_type}_meta”, $meta_id, $object_id, $meta_key, $_meta_value ); where $meta_type … Read more

How to alter the query using pre_get_posts hook and is_post_type_archive

You should be using methods of the $query instance instead of the is_* template tags. And are the categories you are trying to filter a custom taxonomy? cat only works on the default category taxonomy: function wpse_178500_event_type_filter( $wp_query ) { if ( ! empty( $_GET[‘event_term’] ) && $wp_query->is_main_query() && $wp_query->get( ‘post_type’ ) === ‘event’ ) … Read more

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