Changeset 44153
- Timestamp:
- 12/14/2018 03:16:56 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/5.0 merged: 43811
- Property svn:mergeinfo changed
-
trunk/src/wp-admin/includes/ajax-actions.php
r43598 r44153 1444 1444 wp_die( __( 'Please provide a custom field name.' ) ); 1445 1445 } 1446 if ( '' == trim( $value ) ) {1447 wp_die( __( 'Please provide a custom field value.' ) );1448 }1449 1446 if ( ! $meta = get_metadata_by_mid( 'post', $mid ) ) { 1450 1447 wp_die( 0 ); // if meta doesn't exist -
trunk/src/wp-admin/includes/post.php
r44141 r44153 868 868 } 869 869 870 if ( ( '0' === $metavalue || ! empty( $metavalue ) ) && ( ( ( '#NONE#' != $metakeyselect ) && ! empty( $metakeyselect ) ) || ! empty( $metakeyinput )) ) {870 if ( ( ( '#NONE#' != $metakeyselect ) && ! empty( $metakeyselect ) ) || ! empty( $metakeyinput ) ) { 871 871 /* 872 872 * We have a key/value pair. If both the select and the input -
trunk/tests/phpunit/tests/admin/includesPost.php
r44122 r44153 800 800 $this->assertSame( array( 'icon' => 'text' ), $blocks[ $name ] ); 801 801 } 802 803 /** 804 * @ticket 43559 805 */ 806 public function test_post_add_meta_empty_is_allowed() { 807 $p = self::factory()->post->create(); 808 809 $_POST = array( 810 'metakeyinput' => 'testkey', 811 'metavalue' => '', 812 ); 813 814 wp_set_current_user( self::$admin_id ); 815 816 $this->assertNotFalse( add_meta( $p ) ); 817 $this->assertEquals( '', get_post_meta( $p, 'testkey', true ) ); 818 } 802 819 } -
trunk/tests/phpunit/tests/ajax/AddMeta.php
r43811 r44153 22 22 23 23 $_POST = array( 24 'post_id' => $p,25 'metakeyinput' => 'testkey',26 'metavalue' => '',24 'post_id' => $p, 25 'metakeyinput' => 'testkey', 26 'metavalue' => '', 27 27 '_ajax_nonce-add-meta' => wp_create_nonce( 'add-meta' ), 28 28 ); … … 51 51 $_POST = array( 52 52 '_ajax_nonce-add-meta' => wp_create_nonce( 'add-meta' ), 53 'post_id' => $p,54 'meta' => array(53 'post_id' => $p, 54 'meta' => array( 55 55 $m => array( 56 56 'key' => 'testkey',
Note: See TracChangeset
for help on using the changeset viewer.