Plugin Prevents Updating Media
-
I am responding to a topic in my plugin’s support forum:
I installed and tested Cannonical Attachments and discovered this problem on lines 80-88 of
canonical-attachments.php
:// This processes the post back from the media pages function can_attach_update_media_canonical($post, $attachment){ if( isset( $attachment['canonical-url'] ) ) { $canonical = $attachment['canonical-url']; $id = $post['ID']; can_attach_update_single_canonical($id, $canonical); } } add_filter( 'attachment_fields_to_save', 'can_attach_update_media_canonical', 10, 2 );
All WordPress filters must return a value corresponding to their first input parameter, in this case,
$post
. Failure to do so causes all sorts of problems. In this case failure to return$post
makes it impossible to make any updates on the Media/Edit Media screen.It looks like there are a number of filters in this file that do not return the proper values.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Plugin Prevents Updating Media’ is closed to new replies.