`authenticate` filter never gets called

I can think of a few possibilities, though there certainly could be more. On successful login there is a redirect to the dashboard meaning that if you expect to see something output by that function, you won’t. Try this: add_filter(‘authenticate’, ‘my_authenticate’, 1000, 2); function my_authenticate($user, $username){ var_dump($user, $username); die; // We never arrive in this … Read more

Adding html banner to posts

rss_use_excerpt is the option people can use to change the blog from Full Text to Summary. With a combination of is_front_page and that setting you can determine if you’re blog page is showing the summary — in your case — when you don’t want to show the banner on the blog page. function display_banner($content) { … Read more

when use function the_content break

Because you only return $content from inside your if – you should always return it: function beschreibung_kriterien( $content ) { if ( is_page_template( ‘template-test.php’ ) ) { $content .= ‘<h2>Test</h2>’; } return $content; } add_filter( ‘the_content’, ‘beschreibung_kriterien’, 5 ); This just goes to the show the importance of proper indentation!

Filter authors on meta value

Is there a specific reason you aren’t using WP_User_Query? It would make it easier to do what you want to. You can read up on it here. Something along these lines would solve your problem, as far as I understand it: $args = array( “meta_key” => “ArtistCategory”, “meta_value” => “X” //or “Z” ); $authors = … Read more

Use has_filter on comment_post

You’re adding the action on comment_form_before_fields in comment_form_logged_in_after. The latter is called only when the user is logged in, and the former is only called when the user is not logged in. You can add WordPress actions and filters at any time after WordPress is initialized. If you’re adding the action in a plugin, add … Read more

How to filter Sidebar Content

There is no clean way to filter whole sidebar and such, but then that’s not what you really need. The calendar widget (assuming you mean native one) uses get_calendar() function, which passes result through get_calendar filter. It would be preferable to filter its queries, but from quick look at the code they seem highly messy … Read more