Passing variable from filter

Try to define $count4footer outside the function wpa_filter_nav_menu_objects. $count4footer = array( ); function wpa_filter_nav_menu_objects( $items){ global $count4footer; foreach( $items as $item ){ $count = countPosts($item->ID); if($count!==false){ $item->title = $item->title.” ($count)”; $count4footer[$item->ID]=$count; } } return $items; } add_filter( ‘wp_nav_menu_objects’, ‘wpa_filter_nav_menu_objects’ );

How do I remove certain HTML elements with specific classes from the feed?

Use the filter the_content_feed. He is explizit for change content, before sending in feed. A small example. Include a regex or replacement function to get your goal on content. add_filter( “the_content_feed”, “fb_example_change_content_feed” ); function fb_example_change_content_feed( $content ) { $content .= ‘Total ‘ . str_word_count( $content ) . ‘ words’; return $content; }

remove_filter excerpt_more from a plugin class

The priority value has to match on remove_filter. I am guessing that it does not. Try: remove_filter( ‘excerpt_more’, ‘twentyten_auto_excerpt_more’ ); Or find add_filter( ‘excerpt_more’, ‘twentyten_auto_excerpt_more’ and check the priority, then make it match.

Wrapping Featured Image on Add/Edit Page in div?

When you post this question @PontusAbrahamsson answered you with a good function: function wpse_111428_change_feature_image_admin( $content ) { global $post; $size = 100; $id = get_post_meta( $post->ID, ‘_thumbnail_id’, true ); if( $id ) { return wp_get_attachment_link( $id, array( $size, $size ) ); } } add_filter( ‘admin_post_thumbnail_html’, ‘wpse_111428_change_feature_image_admin’ ); just replace it with a modded version that … Read more