WordPress.org

Forums

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

  1. Ivan Novak
    Member
    Posted 1 year 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 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Default featured image
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.