WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] multiple use of attachment_fields_to_save (2 posts)

  1. shaktidevi
    Member
    Posted 3 years ago #

    Hello,

    Can the filter attachment_fields_to_save be used in more than one plugin simultaneously? I have one plugin using it which is working, and I tried to add another but the second instance of it is not saving the fields (though it is showing them). The code in the second plugin is, in brief:

    function __construct() {
      //... some other stuff
      add_filter( 'attachment_fields_to_save', array( &$this, 'attachment_save_post'), 10, 2 );
      }
    
      function attachment_save_post($post, $attachment) {
            error_log("in attachment save post");
        $this->save_post($post['ID'], $attachment);
      }

    The attachment_save_post function is not getting hit - the error log line is not appearing in the error log.

  2. shaktidevi
    Member
    Posted 3 years ago #

    nevermind, i think i am using attachment_fields_to_edit incorrectly!

Topic Closed

This topic has been closed to new replies.

About this Topic