You appear to be a bot. Output may be restricted
Description
Usage
Tests_Ajax_AddMeta::test_post_update_meta_empty_is_allowed_ajax();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/ajax/AddMeta.php
Lines:
1 to 30 of 30
public function test_post_update_meta_empty_is_allowed_ajax() { $p = self::factory()->post->create(); $m = add_post_meta( $p, 'testkey', 'hello' ); // Become an administrator. $this->_setRole( 'administrator' ); $_POST = array( '_ajax_nonce-add-meta' => wp_create_nonce( 'add-meta' ), 'post_id' => $p, 'meta' => array( $m => array( 'key' => 'testkey', 'value' => '', ), ), ); // Make the request. try { $this->_handleAjax( 'add-meta' ); } catch ( WPAjaxDieContinueException $e ) { unset( $e ); } $this->assertSame( '', get_post_meta( $p, 'testkey', true ) ); }