Skip to content

Commit

Permalink
Merge pull request #1037 from alleyinteractive/issue-1034
Browse files Browse the repository at this point in the history
Fixes #1034
  • Loading branch information
attackant authored Jan 3, 2024
2 parents 7b3d1ec + 87c63ec commit 58c6e81
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions includes/class-apple-news.php
Original file line number Diff line number Diff line change
Expand Up @@ -544,19 +544,19 @@ public function create_default_theme() {
* otherwise the same as the existing value in the database will cause a failure
* during post save.
*
* @see \update_metadata
*
* @param null|bool $check Whether to allow updating metadata for the given type.
* @param int $object_id Object ID.
* @param string $meta_key Meta key.
* @param bool|null $check Whether to allow updating metadata for the given type.
* @param int $object_id Object ID.
* @param string $meta_key Meta key.
* @param mixed $meta_value Meta value. Must be serializable if non-scalar.
* @param mixed $prev_value Optional. If specified, only update existing.
* @return null|bool True if the conditions are ripe for the fix, otherwise the existing value of $check.
*
* @return null|bool True, if the conditions are ripe for the fix, otherwise the existing value of $check.
* @see \update_metadata
*/
public function filter_update_post_metadata( $check, $object_id, $meta_key, $meta_value, $prev_value ) {
if ( empty( $prev_value ) ) {
$old_value = get_metadata( 'post', $object_id, $meta_key );
if ( 1 === count( $old_value ) ) {
if ( false !== $old_value && is_array( $old_value ) && 1 === count( $old_value ) ) {
if ( $old_value[0] === $meta_value ) {
return true;
}
Expand Down

0 comments on commit 58c6e81

Please sign in to comment.