You could use one of these. It would give you json data.
$data = json_encode( array('status' => 200, 'message' => 'success');
$result = wp_send_json_success( array( 'photo_id' => $photo_id_encode,'upload_msg' => 'Success' ) );
Related Posts:
- Can’t add classes using jQuery from a JSON string with get_body_class()
- how to remove/exclude html coding from json file while export?
- JSON parsing error syntax error unexpected end of input
- data.map is not a function
- Jquery Ajax Posting JSON to webservice
- TypeError: $.ajax(…) is not a function?
- jquery loop on Json data using $.each
- SON Post with Customized HTTPHeader Field
- jQuery posting JSON
- how to loop through JSON array in jQuery?
- Javascript : array.length returns undefined
- $(document).ready(function() is not working
- Can’t get a JSON object in response to an Ajax request with wp_ajax
- How to get the path to current theme, but from a JS file?
- AJAX returns response 0
- How to Use JSON With AJAX?
- Cannot access elements of json object
- Parsing php string in jquery [closed]
- JSON output returns page source code [closed]
- How to get those data using with ajax json?
- Intergrating agile carousel to wordpress: how to write the ajax_callback function
- I want to import my Json file into a custom made display-modal. How do i link my Json file?
- Using WP_Query to grab custom meta values, foreach to json object
- How to get all users by custom current user meta (array)?
- How to retrieve WP_Object that is inside an array of another array
- Parse wordpress blog data using json api and ajax
- Loop through WordPress API response errors
- Orderby post__in Not Working Correctly?
- Uncaught TypeError: Cannot read property ‘ajax’ of undefined
- jQuery AJAX add json2 dependency?
- getJSON on WordPress Page
- How to enable CORS in flask
- Change Placeholder Text using jQuery
- jQuery – how to write ‘if not equal to’ (opposite of ==)
- Get element type with jQuery
- jQuery onclick toggle class name
- How can I create a “Please Wait, Loading…” animation using jQuery?
- I want to enqueue a .js file to my child theme
- Adding jquery and thickbox to WordPress theme
- WooCommerce single product edit flexslider settings
- jquery & ajax getting data to php in wordpress
- WordPress Featured Post Slider
- possible to make sections in theme customizer sortable and saveable at publish button clicked?
- Twitter Bootstrap Use Collapse in Custom Post Type
- How disable checkbox when listbox value changes in tinymce
- Enqueue jQuery in WordPress
- Modify this loop to fit my jQuery slider (slides)
- validate a metabox based on the category that is selected
- wp_mail very slow
- Clicking on disabled ‘add to cart’ button [closed]
- WordPress loads Jquery Automatically – is my idea correct to add it to the footer?
- Pass a php string to a javascript variable
- Unable to uncheck checkbox with jquery in wp admin
- How to use “show more” on a page or post to show and hide content
- Front-end Ajax File Upload
- jQuery ajax call throws an HTTP 302
- Multiple jQuery conflict unsure of why
- Sorting widget control
- Dukapress jQuery(“form.product_update”).livequery is not a function [closed]
- How to wp_enqueue_script jQuery inside a Plugin
- Cannot enqueue jQuery correctly using Google CDN
- How to use jQuery in WordPress 5.7+
- jQuery accordion plugin won’t work once used in WP
- Why use admin-ajax.php when loading pages through AJAX?
- Insertng HTML and jQuery into a page that uses the Defaut template
- WP Rest Api / Ajax POST not working when not logged in
- Admin side jquery is not loaded
- change order of add_action hooks for jquery to be loaded first
- Ajax Validation for reCaptcha
- WordPress jQuery crash [closed]
- oEmbed Video in Modal
- Conditional Tags – Multiple Categories
- Using Jquery submit with ajax request
- Adding Widgets to Masonry Layouts Correctly – jQuery &&|| PHP
- Ajax page load in wordpress the right way?
- How to remove jquery migrate on selected posts
- Theme JQuery inlcusion on WordPress 6.0 always fails
- wp not defined at wp.Uploader.prototype
- How to update WordPress jQuery version?
- Version of jQuery In WordPress Failing Security Audit
- How to use $ with externally loaded javascript
- Getting click on item to open closest relevant element (popup) with jQuery
- jQuery function not working in WordPress but works in jsfiddle
- wordpress ajax upload media not working
- Notify user we would like them to clear their cookie. Provide a working button to clear cookies for user
- Call full image url instead of stylsheet directory url in JS for Infinite Scroll Function
- jQuery.post() calling function with parameter
- Passing variable data from external jQuery file to options.php
- Custom Javascript not working? [closed]
- What to do after a wrong RewriteRule?
- Ajax autocomplete based on usercode
- Jquery script not loading on site Front page
- Get selected value with PHP and jQuery
- Javascript block in Twenty Twelve theme
- jQuery drop down not appearing for autocomplete/autosuggest
- How to combine jQuery in-place editor with $wpdb->update
- Does anyone know how to load jquery in the footer?
- Use WordPress Built In Jquery
- Generate dynamic ID’s for each accordion button
- Impossible to update jQuery version from 3.1.0