How to get a single hook from wp_head()?

wp_head is an essential part of the theme, and there is too many things that might fall apart if it is not there. Hunting and fixing them one by one might be time consuming and the worthiness of the all operation questionable. In you snippet for example you want to remove things that make no … Read more

Why does adding a filter to ‘the_title’ break the server?

Here’s the correct code snippet. Hope it’ll work for you. Helper function namespace Helpers; .. function _s_trim_content( $content=””, $length = null, $delimiter = null ) { $trimmed_content = mb_strimwidth( $content, 0, is_null( $length ) ? BIG_INT : $length, ” // Won’t use, bugs out. ); if ( mb_strlen( $content ) === mb_strlen( $trimmed_content ) || … Read more

Using a filter to modify Genesis wp_nav_menu

This new updated version of Evan’s Code works with Genesis 1.9 and fixes the bug of displaying all navigation items. /* * Add classes to Genesis Navigation * Tested with Genesis 1.9 (Beta) * 29.12.2012 */ add_filter( ‘genesis_do_nav’, ‘override_do_nav’, 10, 3 ); function override_do_nav($nav_output, $nav, $args) { $args[‘menu_id’] = ‘the_id_you_want’; $args[‘menu_class’] = ‘class1 class2’; // … Read more

How to check if a protected hook is hooked?

As noted in my answer to your related question there is a datastructre $wp_filter that stores all information on hooks and filters. You may want to try a var_dump on it just to see what it looks like. There is no built in variable ‘protected’. This leaves you with two options to keep the administration … Read more

Missing Argument 2 for apply_filter

You’re not filtering anything, that’s what’s missing and what the error is complaining about. Filters accept an input value and return something. $original_value=”foo”; $filtered_value = apply_filters( ‘wpd_filter_function’, $original_value ); The function should then accept $original_value as an argument and return some value, which is what you’ll get in $filtered_value. What you have in your code … Read more

Why doesn’t remove_action work in my plugin?

I am not sure about BuddyPress specifics. In general case remove doesn’t work when it is firing before function is actually added to the hook. Between core, plugins, parent and child themes there are a lot of relative combinations of add/remove possible. In such case to make remove fire properly you need to wrap it … Read more