On this page
WP_Ajax_Response::__construct( string|array $args = '' )
Constructor – Passes args to WP_Ajax_Response::add().
Description
See also
Parameters
$argsstring|array Optional-
Will be passed to add() method.
Default:
''
Source
File: wp-includes/class-wp-ajax-response.php. View all references
public function __construct( $args = '' ) {
if ( ! empty( $args ) ) {
$this->add( $args );
}
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Ajax_Response::add() wp-includes/class-wp-ajax-response.php | Appends data to an XML response based on given arguments. |
Used By
| Used By | Description |
|---|---|
| wp_ajax_add_meta() wp-admin/includes/ajax-actions.php | Ajax handler for adding meta. |
| wp_ajax_add_user() wp-admin/includes/ajax-actions.php | Ajax handler for adding a user. |
| _wp_ajax_delete_comment_response() wp-admin/includes/ajax-actions.php | Sends back current comment total and new page links if they need to be updated. |
| _wp_ajax_add_hierarchical_term() wp-admin/includes/ajax-actions.php | Ajax handler for adding a hierarchical term. |
| wp_ajax_dim_comment() wp-admin/includes/ajax-actions.php | Ajax handler to dim a comment. |
| wp_ajax_add_link_category() wp-admin/includes/ajax-actions.php | Ajax handler for adding a link category. |
| wp_ajax_add_tag() wp-admin/includes/ajax-actions.php | Ajax handler to add a tag. |
| wp_ajax_get_comments() wp-admin/includes/ajax-actions.php | Ajax handler for getting comments. |
| wp_ajax_replyto_comment() wp-admin/includes/ajax-actions.php | Ajax handler for replying to a comment. |
| wp_ajax_edit_comment() wp-admin/includes/ajax-actions.php | Ajax handler for editing a comment. |
Changelog
| Version | Description |
|---|---|
| 2.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_ajax_response/__construct