WordPress.org

Ready to get started?Download WordPress

Forums

Default featured image
[resolved] Allow external access to override plugin filters (2 posts)

  1. Ivan Novak
    Member
    Posted 7 months ago #

    No problem here, just wanted to share a modification that I made to the plugin to make it more malleable and serve my purposes better.

    Line 17

    self::$_this = $this;

    Line 37

    static function this() {
    	return self::$_this;
    }

    This allowed me to remove filters. For example:

    if(class_exists('default_featured_image')) {
    	$default_featured_image_instance = default_featured_image::this();
    	remove_filter( 'get_post_metadata', array( $default_featured_image_instance, 'set_dfi_meta_key'));
    }

    http://wordpress.org/plugins/default-featured-image/

  2. janw.oostendorp
    Member
    Plugin Author

    Posted 7 months ago #

    I see what you did there. Nice shortcut of a singelton.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.