WordPress.org

Ready to get started?Download WordPress

Forums

WPBook
[resolved] Allow 3rd party plugins to edit the attachment (5 posts)

  1. sebaxtian
    Member
    Posted 3 years ago #

    Hi.

    Thanks for all the effort you put in this pluggin.

    I want to allow mudslideshow (a plugin of mine) to edit the 'attachment' after WPBook sends it to Facebook. The reason: thumbnails in MudSlideShow comes from picasa, and WPBook can't get them.

    To solve this, I want you to add this line before each api call where WPBook send the attachment:

    $attachment = apply_filters('wpbook_attachment', $attachment, $my_post->ID);

    This way I can add the filter inside Mudslideshow and allow the plugin to define the thumbnail.

    Thanks in advance.

    http://wordpress.org/extend/plugins/wpbook/

  2. Brooke Dukes
    Member
    Plugin Contributor

    Posted 3 years ago #

    Do you know if there are other plugins that would use the attachment feature. Personally this seems like it's a customization that very few users would benifit from so I don't think it needs to be in core. It also seems simple enough for you to be able to modify the code for your own need.

  3. sebaxtian
    Member
    Posted 3 years ago #

    Thanks for your quick answer.

    Let me use the WP core as an example. Imagine how hard would it be to create new plugins without WP's filters, and pay attention to the fact that there are filters everywhere in the core, even in the strangest functions, although the core developers didn't know if someone would use them. They do it to allow us -3rd party plugin developers- to interact with the core.

    Add the filter at this moment would help only one developer, but you don't know how would it help others in the future. And it only requires to add the line I suggest just before call the api with the attachment.

    I searched through the WP core trying to figure how to do it inside MudSlideShow without having to ask for your help, but the 'thumbnail' functions requieres the image to be in the local server, and MudSlideShow uses the images in Picasa or Flickr. As you have suggested I can modify the code inside WPBook, but this would require me to modify it on every new release.

    Add this filter would help me at this mommnent, but would come handdy when other users ask you how to interact with WPBook.

  4. johneckman
    Member
    Plugin Author

    Posted 3 years ago #

    I'm open to the concept - thanks for the suggestion.

    In general I'd like lots of other plugins to be able to modify what WPBook does, and adding a filter will be a nice way to handle it.

  5. sebaxtian
    Member
    Posted 3 years ago #

    Thanks for add the filter. The next release of mudslideshow would use it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags