Changeset 43811
- Timestamp:
- 10/23/2018 06:55:45 PM (6 years ago)
- Location:
- branches/5.0
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/src/wp-admin/includes/ajax-actions.php
r43807 r43811 1342 1342 if ( '' == trim($key) ) 1343 1343 wp_die( __( 'Please provide a custom field name.' ) ); 1344 if ( '' == trim($value) )1345 wp_die( __( 'Please provide a custom field value.' ) );1346 1344 if ( ! $meta = get_metadata_by_mid( 'post', $mid ) ) 1347 1345 wp_die( 0 ); // if meta doesn't exist -
branches/5.0/src/wp-admin/includes/post.php
r43792 r43811 815 815 $metavalue = trim( $metavalue ); 816 816 817 if ( ( '0' === $metavalue || ! empty ( $metavalue ) ) && ( ( ( '#NONE#' != $metakeyselect ) && !empty ( $metakeyselect) ) || !empty ( $metakeyinput )) ) {817 if ( ( ( '#NONE#' != $metakeyselect ) && ! empty( $metakeyselect ) ) || ! empty( $metakeyinput ) ) { 818 818 /* 819 819 * We have a key/value pair. If both the select and the input -
branches/5.0/tests/phpunit/tests/admin/includesPost.php
r43762 r43811 708 708 $this->assertSame( array( 'icon' => 'text' ), $blocks[ $name ] ); 709 709 } 710 711 /** 712 * @ticket 43559 713 */ 714 public function test_post_add_meta_empty_is_allowed() { 715 $p = self::factory()->post->create(); 716 717 $_POST = array( 718 'metakeyinput' => 'testkey', 719 'metavalue' => '', 720 ); 721 722 wp_set_current_user( self::$admin_id ); 723 724 $this->assertNotFalse( add_meta( $p ) ); 725 $this->assertEquals( '', get_post_meta( $p, 'testkey', true ) ); 726 } 710 727 }
Note: See TracChangeset
for help on using the changeset viewer.