Skip to content

Commit 32c3fc1

Browse files
Fix: Re-add metadata filter after removal to prevent interference with subsequent saves
Co-authored-by: stefan-cotitosu <26867648+stefan-cotitosu@users.noreply.github.com>
1 parent 8efc369 commit 32c3fc1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

includes/admin/feedzy-rss-feeds-admin.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,6 +1733,10 @@ public function validate_category_feeds( $check, $object_id, $meta_key, $meta_va
17331733
remove_filter( current_filter(), array( $this, 'validate_category_feeds' ) );
17341734
$valid = $this->check_source_validity( $meta_value, $object_id, true, true );
17351735
update_post_meta( $object_id, $meta_key, empty( $valid ) ? '' : implode( ', ', $valid ) );
1736+
1737+
// Re-add the filter to ensure subsequent metadata operations work correctly.
1738+
add_filter( current_filter(), array( $this, 'validate_category_feeds' ), 10, 5 );
1739+
17361740
return true;
17371741
}
17381742

@@ -1875,6 +1879,7 @@ public function ajax() {
18751879
if ( ! empty( $valid ) ) {
18761880
remove_filter( 'update_post_metadata', array( $this, 'validate_category_feeds' ) );
18771881
update_post_meta( $post_id, 'feedzy_category_feed', implode( ', ', $valid ) );
1882+
add_filter( 'update_post_metadata', array( $this, 'validate_category_feeds' ), 10, 5 );
18781883
}
18791884
wp_send_json_success( array( 'invalid' => count( $invalid ) ) );
18801885
break;

0 commit comments

Comments
 (0)