Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
Issue #17 : Use $content passed to filter, instead of $post->post_con…
Browse files Browse the repository at this point in the history
…tent.

Also, wp_unslash() the $content.
Otherwise, the json_decode function will return null.
  • Loading branch information
Ryan Kienstra committed Sep 3, 2016
1 parent 92f14c0 commit f76b4a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion php/class-post-type.php
Expand Up @@ -719,7 +719,7 @@ public function filter_out_settings_if_removed_in_metabox( $content ) {
}

$setting_ids_to_unset = $_REQUEST[ $key_for_settings ];
$data = json_decode( $post->post_content, true );
$data = json_decode( wp_unslash( $content ), true );
foreach ( $setting_ids_to_unset as $setting_id ) {
unset( $data[ $setting_id ] );
}
Expand Down

0 comments on commit f76b4a6

Please sign in to comment.