How to remove a filter that is an anonymous object?

That’s a very good question. It goes down to the dark heart of the plugin API and best programming practices. For the following answer I created a simple plugin to illustrate the problem with easy to read code. <?php # -*- coding: utf-8 -*- /* Plugin Name: Anonymous OOP Action */ if ( ! class_exists( … Read more

Post Type Upload Directory – {post_type}_upload_dir filter

‘apply_filters’ runs the value through all of the other hooks / functions attached to it. Try an experiment: print_r( $type ); print_r( apply_filters(“{$type}_upload_directory”, $type) ); While you might, in your case, get the same thing – the apply_filters makes sure that any other plugins that try to influence this upload directory will still work.

Filter for wp_embed_handler_youtube not working

a little late, but it might be because this is a filter, and you’re adding it as an action, try add_filter( ‘wp_embed_handler_youtube’, ‘bigger_youtube_embeds’, 10, 4); function bigger_youtube_embeds($embed, $attr, $url, $rawattr) { // alter the $embed string… return $embed; }

How to filter posts in admin by before date or by post status ‘future’?

The question pretty much got covered in another thread here. In case anyone else need anything like this I ended up using following code to hide all the posts that are over a week in the future. function hide_future_posts($where, $q) { if(is_admin() && $q->is_main_query() && !filter_input(INPUT_GET, ‘post_status’) && ( $screen = get_current_screen() ) instanceof \WP_Screen … Read more

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