WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Difference between revisions of "Function Reference/wp send json success"

(Include more information about the function)
m (Usage)
Line 5: Line 5:
 
== Usage ==
 
== Usage ==
   
%%% <?php wp_send_json_success( $data ) ?> %%%
+
<?php wp_send_json_success( $data ) ?>
   
 
== Parameters ==
 
== Parameters ==

Revision as of 07:17, 14 December 2012

Description

Send a JSON response back to an Ajax request, indicating success.

Usage

<?php wp_send_json_success( $data ) ?>

Parameters

$data
(mixed) (optional) Data to encode as JSON, then print and die.
Default: null

Examples

Default Usage

Notes

Uses wp_send_json() to send response.

Change Log

Source File

wp_send_json_success() is located in wp-includes/functions.php

Related

wp_send_json(), wp_send_json_error()