add_action( 'admin_notices', function() {
$body = [
'author' => 46,
'author_email' => '[email protected]',
'author_name' => 'First Last',
'author_url' => 'https://www.mysite.com/',
'content' => 'Comment body goes here.',
'date' => current_time( 'mysql' ),
'date_gmt' => current_time( 'mysql', 1 ),
'post' => 1,
'status' => 'publish',
];
$request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
$request->set_body_params( $body );
$response = rest_do_request( $request );
printf( '<pre>%s</pre>', print_r( $response->get_data(), true ) );
} );
We code all of our code snippets directly. Our clients provide most of the ideas and demand for the functionality provided by our code snippets.
There are several sources one can find on Google for code that has inspired or contributed to this open-source library. Here’s some main ones:
All code snippets are licensed GPLv2 (or later) matching WordPress licensing.
Disclaimer of warranty:
Except when otherwise stated in writing the copyright holders and/or other parties provide the program as-is without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose.
Import a comment
One time use to import a comment to a page or post over the REST API.
[ccom_contact_form]
We code all of our code snippets directly. Our clients provide most of the ideas and demand for the functionality provided by our code snippets.
There are several sources one can find on Google for code that has inspired or contributed to this open-source library. Here’s some main ones:
All code snippets are licensed GPLv2 (or later) matching WordPress licensing.
Disclaimer of warranty:
Related products
Append variation attributes onto order’s product titles and emails
Processing status: enable admin editing and customer cancelling
Gutenberg editing full width
Run manual database query