mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Code is Poetry.
WordPress' code just... wasn't. This is now dealt with. Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS. Fixes #41057. git-svn-id: https://develop.svn.wordpress.org/trunk@42343 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
+251
-137
@@ -13,29 +13,58 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
public static function wpSetUpBeforeClass( $factory ) {
|
||||
self::$user_id = $factory->user->create( array(
|
||||
'role' => 'author',
|
||||
'user_login' => 'test_wp_user_get',
|
||||
'user_pass' => 'password',
|
||||
'user_email' => 'test@test.com',
|
||||
) );
|
||||
self::$user_id = $factory->user->create(
|
||||
array(
|
||||
'role' => 'author',
|
||||
'user_login' => 'test_wp_user_get',
|
||||
'user_pass' => 'password',
|
||||
'user_email' => 'test@test.com',
|
||||
)
|
||||
);
|
||||
|
||||
self::$post_id = $factory->post->create( array(
|
||||
'post_author' => self::$user_id
|
||||
) );
|
||||
self::$post_id = $factory->post->create(
|
||||
array(
|
||||
'post_author' => self::$user_id,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function test_wp_update_comment() {
|
||||
$post = self::factory()->post->create_and_get( array( 'post_title' => 'some-post', 'post_type' => 'post' ) );
|
||||
$post2 = self::factory()->post->create_and_get( array( 'post_title' => 'some-post-2', 'post_type' => 'post' ) );
|
||||
$post = self::factory()->post->create_and_get(
|
||||
array(
|
||||
'post_title' => 'some-post',
|
||||
'post_type' => 'post',
|
||||
)
|
||||
);
|
||||
$post2 = self::factory()->post->create_and_get(
|
||||
array(
|
||||
'post_title' => 'some-post-2',
|
||||
'post_type' => 'post',
|
||||
)
|
||||
);
|
||||
$comments = self::factory()->comment->create_post_comments( $post->ID, 5 );
|
||||
$result = wp_update_comment( array( 'comment_ID' => $comments[0], 'comment_parent' => $comments[1] ) );
|
||||
$result = wp_update_comment(
|
||||
array(
|
||||
'comment_ID' => $comments[0],
|
||||
'comment_parent' => $comments[1],
|
||||
)
|
||||
);
|
||||
$this->assertEquals( 1, $result );
|
||||
$comment = get_comment( $comments[0] );
|
||||
$this->assertEquals( $comments[1], $comment->comment_parent );
|
||||
$result = wp_update_comment( array( 'comment_ID' => $comments[0], 'comment_parent' => $comments[1] ) );
|
||||
$result = wp_update_comment(
|
||||
array(
|
||||
'comment_ID' => $comments[0],
|
||||
'comment_parent' => $comments[1],
|
||||
)
|
||||
);
|
||||
$this->assertEquals( 0, $result );
|
||||
$result = wp_update_comment( array( 'comment_ID' => $comments[0], 'comment_post_ID' => $post2->ID ) );
|
||||
$result = wp_update_comment(
|
||||
array(
|
||||
'comment_ID' => $comments[0],
|
||||
'comment_post_ID' => $post2->ID,
|
||||
)
|
||||
);
|
||||
$comment = get_comment( $comments[0] );
|
||||
$this->assertEquals( $post2->ID, $comment->comment_post_ID );
|
||||
}
|
||||
@@ -46,7 +75,12 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
function test_wp_update_comment_updates_comment_type() {
|
||||
$comment_id = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id ) );
|
||||
|
||||
wp_update_comment( array( 'comment_ID' => $comment_id, 'comment_type' => 'pingback' ) );
|
||||
wp_update_comment(
|
||||
array(
|
||||
'comment_ID' => $comment_id,
|
||||
'comment_type' => 'pingback',
|
||||
)
|
||||
);
|
||||
|
||||
$comment = get_comment( $comment_id );
|
||||
$this->assertEquals( 'pingback', $comment->comment_type );
|
||||
@@ -57,13 +91,15 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
*/
|
||||
function test_wp_update_comment_updates_comment_meta() {
|
||||
$comment_id = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id ) );
|
||||
wp_update_comment( array(
|
||||
'comment_ID' => $comment_id,
|
||||
'comment_meta' => array(
|
||||
'food' => 'taco',
|
||||
'sauce' => 'fire',
|
||||
),
|
||||
) );
|
||||
wp_update_comment(
|
||||
array(
|
||||
'comment_ID' => $comment_id,
|
||||
'comment_meta' => array(
|
||||
'food' => 'taco',
|
||||
'sauce' => 'fire',
|
||||
),
|
||||
)
|
||||
);
|
||||
$this->assertEquals( 'fire', get_comment_meta( $comment_id, 'sauce', true ) );
|
||||
}
|
||||
|
||||
@@ -73,7 +109,12 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
function test_wp_update_comment_updates_user_id() {
|
||||
$comment_id = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id ) );
|
||||
|
||||
wp_update_comment( array( 'comment_ID' => $comment_id, 'user_id' => 1 ) );
|
||||
wp_update_comment(
|
||||
array(
|
||||
'comment_ID' => $comment_id,
|
||||
'user_id' => 1,
|
||||
)
|
||||
);
|
||||
|
||||
$comment = get_comment( $comment_id );
|
||||
$this->assertEquals( 1, $comment->user_id );
|
||||
@@ -87,7 +128,13 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
|
||||
$updated_comment_text = 'I should be able to update a comment with a Post ID of zero';
|
||||
|
||||
$update = wp_update_comment( array( 'comment_ID' => $comment_id, 'comment_content' => $updated_comment_text, 'comment_post_ID' => 0 ) );
|
||||
$update = wp_update_comment(
|
||||
array(
|
||||
'comment_ID' => $comment_id,
|
||||
'comment_content' => $updated_comment_text,
|
||||
'comment_post_ID' => 0,
|
||||
)
|
||||
);
|
||||
$this->assertSame( 1, $update );
|
||||
|
||||
$comment = get_comment( $comment_id );
|
||||
@@ -95,27 +142,52 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
public function test_get_approved_comments() {
|
||||
$ca1 = self::factory()->comment->create( array(
|
||||
'comment_post_ID' => self::$post_id, 'comment_approved' => '1'
|
||||
) );
|
||||
$ca2 = self::factory()->comment->create( array(
|
||||
'comment_post_ID' => self::$post_id, 'comment_approved' => '1'
|
||||
) );
|
||||
$ca3 = self::factory()->comment->create( array(
|
||||
'comment_post_ID' => self::$post_id, 'comment_approved' => '0'
|
||||
) );
|
||||
$c2 = self::factory()->comment->create( array(
|
||||
'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback'
|
||||
) );
|
||||
$c3 = self::factory()->comment->create( array(
|
||||
'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback'
|
||||
) );
|
||||
$c4 = self::factory()->comment->create( array(
|
||||
'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario'
|
||||
) );
|
||||
$c5 = self::factory()->comment->create( array(
|
||||
'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'luigi'
|
||||
) );
|
||||
$ca1 = self::factory()->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '1',
|
||||
)
|
||||
);
|
||||
$ca2 = self::factory()->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '1',
|
||||
)
|
||||
);
|
||||
$ca3 = self::factory()->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '0',
|
||||
)
|
||||
);
|
||||
$c2 = self::factory()->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '1',
|
||||
'comment_type' => 'pingback',
|
||||
)
|
||||
);
|
||||
$c3 = self::factory()->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '1',
|
||||
'comment_type' => 'trackback',
|
||||
)
|
||||
);
|
||||
$c4 = self::factory()->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '1',
|
||||
'comment_type' => 'mario',
|
||||
)
|
||||
);
|
||||
$c5 = self::factory()->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '1',
|
||||
'comment_type' => 'luigi',
|
||||
)
|
||||
);
|
||||
|
||||
$found = get_approved_comments( self::$post_id );
|
||||
|
||||
@@ -127,9 +199,12 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
* @ticket 30412
|
||||
*/
|
||||
public function test_get_approved_comments_with_post_id_0_should_return_empty_array() {
|
||||
$ca1 = self::factory()->comment->create( array(
|
||||
'comment_post_ID' => self::$post_id, 'comment_approved' => '1'
|
||||
) );
|
||||
$ca1 = self::factory()->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '1',
|
||||
)
|
||||
);
|
||||
|
||||
$found = get_approved_comments( 0 );
|
||||
|
||||
@@ -141,14 +216,14 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
*/
|
||||
public function test_wp_new_comment_respects_dates() {
|
||||
$data = array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_author' => 'Comment Author',
|
||||
'comment_author_url' => '',
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_author' => 'Comment Author',
|
||||
'comment_author_url' => '',
|
||||
'comment_author_email' => '',
|
||||
'comment_type' => '',
|
||||
'comment_content' => 'Comment',
|
||||
'comment_date' => '2011-01-01 10:00:00',
|
||||
'comment_date_gmt' => '2011-01-01 10:00:00',
|
||||
'comment_type' => '',
|
||||
'comment_content' => 'Comment',
|
||||
'comment_date' => '2011-01-01 10:00:00',
|
||||
'comment_date_gmt' => '2011-01-01 10:00:00',
|
||||
);
|
||||
|
||||
$id = wp_new_comment( $data );
|
||||
@@ -270,14 +345,14 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
|
||||
public function test_comment_field_lengths() {
|
||||
$data = array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_author' => 'Comment Author',
|
||||
'comment_author_url' => '',
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_author' => 'Comment Author',
|
||||
'comment_author_url' => '',
|
||||
'comment_author_email' => '',
|
||||
'comment_type' => '',
|
||||
'comment_content' => str_repeat( 'A', 65536 ),
|
||||
'comment_date' => '2011-01-01 10:00:00',
|
||||
'comment_date_gmt' => '2011-01-01 10:00:00',
|
||||
'comment_type' => '',
|
||||
'comment_content' => str_repeat( 'A', 65536 ),
|
||||
'comment_date' => '2011-01-01 10:00:00',
|
||||
'comment_date_gmt' => '2011-01-01 10:00:00',
|
||||
);
|
||||
|
||||
$id = wp_new_comment( $data );
|
||||
@@ -291,31 +366,39 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
* @ticket 32566
|
||||
*/
|
||||
public function test_wp_notify_moderator_should_not_throw_notice_when_post_author_is_0() {
|
||||
$p = self::factory()->post->create( array(
|
||||
'post_author' => 0,
|
||||
) );
|
||||
$p = self::factory()->post->create(
|
||||
array(
|
||||
'post_author' => 0,
|
||||
)
|
||||
);
|
||||
|
||||
$c = self::factory()->comment->create( array(
|
||||
'comment_post_ID' => $p,
|
||||
) );
|
||||
$c = self::factory()->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => $p,
|
||||
)
|
||||
);
|
||||
|
||||
$this->assertTrue( wp_notify_moderator( $c ) );
|
||||
}
|
||||
|
||||
public function test_wp_new_comment_notify_postauthor_should_send_email_when_comment_is_approved() {
|
||||
$c = self::factory()->comment->create( array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
) );
|
||||
$c = self::factory()->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
)
|
||||
);
|
||||
|
||||
$sent = wp_new_comment_notify_postauthor( $c );
|
||||
$this->assertTrue( $sent );
|
||||
}
|
||||
|
||||
public function test_wp_new_comment_notify_postauthor_should_not_send_email_when_comment_is_unapproved() {
|
||||
$c = self::factory()->comment->create( array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '0',
|
||||
) );
|
||||
$c = self::factory()->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '0',
|
||||
)
|
||||
);
|
||||
|
||||
$sent = wp_new_comment_notify_postauthor( $c );
|
||||
$this->assertFalse( $sent );
|
||||
@@ -325,10 +408,12 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
* @ticket 33587
|
||||
*/
|
||||
public function test_wp_new_comment_notify_postauthor_should_not_send_email_when_comment_has_been_marked_as_spam() {
|
||||
$c = self::factory()->comment->create( array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => 'spam',
|
||||
) );
|
||||
$c = self::factory()->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => 'spam',
|
||||
)
|
||||
);
|
||||
|
||||
$sent = wp_new_comment_notify_postauthor( $c );
|
||||
$this->assertFalse( $sent );
|
||||
@@ -338,10 +423,12 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
* @ticket 35006
|
||||
*/
|
||||
public function test_wp_new_comment_notify_postauthor_should_not_send_email_when_comment_has_been_trashed() {
|
||||
$c = self::factory()->comment->create( array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => 'trash',
|
||||
) );
|
||||
$c = self::factory()->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => 'trash',
|
||||
)
|
||||
);
|
||||
|
||||
$sent = wp_new_comment_notify_postauthor( $c );
|
||||
$this->assertFalse( $sent );
|
||||
@@ -351,13 +438,15 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
* @ticket 12431
|
||||
*/
|
||||
public function test_wp_new_comment_with_meta() {
|
||||
$c = self::factory()->comment->create( array(
|
||||
'comment_approved' => '1',
|
||||
'comment_meta' => array(
|
||||
'food' => 'taco',
|
||||
'sauce' => 'fire'
|
||||
$c = self::factory()->comment->create(
|
||||
array(
|
||||
'comment_approved' => '1',
|
||||
'comment_meta' => array(
|
||||
'food' => 'taco',
|
||||
'sauce' => 'fire',
|
||||
),
|
||||
)
|
||||
) );
|
||||
);
|
||||
|
||||
$this->assertEquals( 'fire', get_comment_meta( $c, 'sauce', true ) );
|
||||
}
|
||||
@@ -366,41 +455,53 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
* @ticket 8071
|
||||
*/
|
||||
public function test_wp_comment_get_children_should_fill_children() {
|
||||
$c1 = self::factory()->comment->create( array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '1',
|
||||
) );
|
||||
$c1 = self::factory()->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '1',
|
||||
)
|
||||
);
|
||||
|
||||
$c2 = self::factory()->comment->create( array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '1',
|
||||
'comment_parent' => $c1,
|
||||
) );
|
||||
$c2 = self::factory()->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '1',
|
||||
'comment_parent' => $c1,
|
||||
)
|
||||
);
|
||||
|
||||
$c3 = self::factory()->comment->create( array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '1',
|
||||
'comment_parent' => $c2,
|
||||
) );
|
||||
$c3 = self::factory()->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '1',
|
||||
'comment_parent' => $c2,
|
||||
)
|
||||
);
|
||||
|
||||
$c4 = self::factory()->comment->create( array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '1',
|
||||
'comment_parent' => $c1,
|
||||
) );
|
||||
$c4 = self::factory()->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '1',
|
||||
'comment_parent' => $c1,
|
||||
)
|
||||
);
|
||||
|
||||
$c5 = self::factory()->comment->create( array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '1',
|
||||
) );
|
||||
$c5 = self::factory()->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '1',
|
||||
)
|
||||
);
|
||||
|
||||
$c6 = self::factory()->comment->create( array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '1',
|
||||
'comment_parent' => $c5,
|
||||
) );
|
||||
$c6 = self::factory()->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => self::$post_id,
|
||||
'comment_approved' => '1',
|
||||
'comment_parent' => $c5,
|
||||
)
|
||||
);
|
||||
|
||||
$comment = get_comment( $c1 );
|
||||
$comment = get_comment( $c1 );
|
||||
$children = $comment->get_children();
|
||||
|
||||
// Direct descendants of $c1.
|
||||
@@ -416,7 +517,7 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
public function test_post_properties_should_be_lazyloaded() {
|
||||
$c = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id ) );
|
||||
|
||||
$post = get_post( self::$post_id );
|
||||
$post = get_post( self::$post_id );
|
||||
$comment = get_comment( $c );
|
||||
|
||||
$post_fields = array( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'comment_status', 'ping_status', 'post_name', 'to_ping', 'pinged', 'post_modified', 'post_modified_gmt', 'post_content_filtered', 'post_parent', 'guid', 'menu_order', 'post_type', 'post_mime_type', 'comment_count' );
|
||||
@@ -434,7 +535,7 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*/
|
||||
public function setup_notify_comment(){
|
||||
public function setup_notify_comment() {
|
||||
/**
|
||||
* Prevent flood alert from firing.
|
||||
*/
|
||||
@@ -443,13 +544,17 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
/**
|
||||
* Set up a comment for testing.
|
||||
*/
|
||||
$post = $this->factory->post->create( array(
|
||||
'post_author' => self::$user_id,
|
||||
) );
|
||||
$post = $this->factory->post->create(
|
||||
array(
|
||||
'post_author' => self::$user_id,
|
||||
)
|
||||
);
|
||||
|
||||
$comment = $this->factory->comment->create( array(
|
||||
'comment_post_ID' => $post,
|
||||
) );
|
||||
$comment = $this->factory->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => $post,
|
||||
)
|
||||
);
|
||||
|
||||
return array(
|
||||
'post' => $post,
|
||||
@@ -632,7 +737,7 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
// Close comments more than one day old.
|
||||
update_option( 'close_comments_days_old', 1 );
|
||||
|
||||
$old_date = strtotime( '-25 hours' );
|
||||
$old_date = strtotime( '-25 hours' );
|
||||
$old_post_id = self::factory()->post->create( array( 'post_date' => strftime( '%Y-%m-%d %H:%M:%S', $old_date ) ) );
|
||||
|
||||
$old_post_comment_status = _close_comments_for_old_post( true, $old_post_id );
|
||||
@@ -643,7 +748,12 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
public function test_close_comments_for_old_post_undated_draft() {
|
||||
$draft_id = self::factory()->post->create( array( 'post_status' => 'draft', 'post_type' => 'post' ) );
|
||||
$draft_id = self::factory()->post->create(
|
||||
array(
|
||||
'post_status' => 'draft',
|
||||
'post_type' => 'post',
|
||||
)
|
||||
);
|
||||
$draft_comment_status = _close_comments_for_old_post( true, $draft_id );
|
||||
|
||||
$this->assertTrue( $draft_comment_status );
|
||||
@@ -673,11 +783,13 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
$this->assertSame( $default_data['comment_agent'], $save->comment_agent );
|
||||
|
||||
// Update the comment.
|
||||
wp_update_comment( array(
|
||||
'comment_ID' => $comment_id,
|
||||
'comment_author_IP' => '111.111.1.1',
|
||||
'comment_agent' => 'SHIELD_AGENT',
|
||||
) );
|
||||
wp_update_comment(
|
||||
array(
|
||||
'comment_ID' => $comment_id,
|
||||
'comment_author_IP' => '111.111.1.1',
|
||||
'comment_agent' => 'SHIELD_AGENT',
|
||||
)
|
||||
);
|
||||
|
||||
// Retrieve and check the new values.
|
||||
$updated = get_comment( $comment_id );
|
||||
@@ -708,10 +820,12 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
$comment = get_comment( $c );
|
||||
$this->assertSame( 'Foo', $comment->comment_author );
|
||||
|
||||
wp_update_comment( array(
|
||||
'comment_ID' => $c,
|
||||
'comment_author' => 'Bar',
|
||||
) );
|
||||
wp_update_comment(
|
||||
array(
|
||||
'comment_ID' => $c,
|
||||
'comment_author' => 'Bar',
|
||||
)
|
||||
);
|
||||
|
||||
$comment = get_comment( $c );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user