I can’t tell what the $my_page, $my_page, or $shipHelper variables are supposed to do, but you can use an output buffer to capture the output of your DisplayEventInfoBox function. You can try the following:
function myAJAXFn() {
ob_start();
DisplayEventInfoBox($my_page, $shipHelper);
$my_html = ob_get_contents();
ob_end_clean();
wp_send_json_success( array('page'=>$my_html) );
}
Related Posts:
- username_exists() function can’t be access without logging in
- How build a custom login/register form with error handling?
- Is having multiple theme customizers for different pages possible?
- Where to include php files in wordpress and how to refer to them later [closed]
- problem with ajax and the path to the php page
- Admin Media grid view images won’t load
- Passing JSON data from WP Query into AJAX causing NULL errors
- AJAX / Read More: multiple check_ajax_referer() and wp_create_nonce() not working independentely
- Targeting single page with JS
- Handling an Ajax form submit
- Ajax call to my WordPress website from an external application [duplicate]
- Validate a users email address when using gmail to register
- Custom WordPress+PHP+MYSQL+AJAX form, submit event not captured by Javascript, but does POST data to the DB
- Use ajax to update_post_meta
- WooCommerce: update custom fields after checkout validation failure
- How to speed up admin-ajax.php in wordpress
- Can I use HTTP POSTs? Is there a better alternative?
- How to make custom total price reactive in navigation
- How to test nonce with AJAX – Plugin development
- get current custom post ID by WP_Query method
- Ajax not working es expected (Returns 0)
- Creating a Multi-Level Associative Object Using AJAX
- Ajax category filtering products default show all
- Status 400 for AJAX POST Request with admin-ajax.php
- Why ajax doesn’t work on certain wordpress hooks and reload the page instead?
- Why ajax doesn’t work on certain wordpress hooks?
- AJAX pagination, update current page
- adjust section according to country?
- Change “add to cart” button color based on Woocommerce product category [closed]
- Posting and image insertion problems after EasyApache4 and PHP 7 upgrade
- Ajax call return 404
- How to add a do_action on refreshing of WP customizer?
- how to update and display an option without reloading the page
- WordPress admin-ajax.php 400 bad request
- Problem with AJAX in wordpress plugin
- How to keep track of when a vote is cast?
- set post limit at load more ajax wordpress
- AJAX wp_insert_user WORKS but responds with “The site is not enabled”
- Ajax filter button display all posts
- Compare $_POST returned values with term array
- WordPress REST API register_rest_route give a 500 error
- How to use AJAX to call php page with parameter
- admin-ajax GET response bad request
- javascript variable to wordpress php variable
- Post not populating for custom post type based on category selection
- Output votes to div dynamically in wordpress
- Incrementing PHP variable onclick to display posts by month
- Proper way to use WordPress function with AJAX PHP file
- How to use AJAX in WordPress in MYSQL query?
- Live search from database table
- Processing ajax call to php to insert into mysql database
- Ajax URLs without #!, how to prevent falling into single.php on load or reload?
- Search Ajax Call – Use Form Data in Response
- Why does PHP called with Jquery AJAX not allow additional php code to be added?
- Display WordPress search results based on the selected Sub-Category
- Deleting records with AJAX, deleting records as I search
- Using some Loop or repeatable fucntion in AJAX and PHP to reduce repeatability
- Database entry removed on browser refresh, Ajax PHP jQuery
- How do I call a value from the datase using ajax
- Post form – AJAX won’t upload featured image – Plugin development
- Load more posts using AJAX based on posts inside WP_Query
- PHP calling AJAX function that relies on passed PHP function values not working
- Where to add my PHP codes for AJAX Jquery to work?
- Adding ELSE argument to AJAX Live Search for “No results found”
- How can i find wrong word in search box and replace with correct word
- How to use wp_ajax_set_post_thumbnail?
- ajax contact form not submit message
- Can an AJAX callback function access a PHP variable which was defined during initial page load?
- 400 bad request admin-ajax file upload
- Can’t make lazy load for my site, help!
- How to reload a php script, using AJAX and jQuery
- Change WooCommerce currency programmatically on AJAX request
- use with class file into wp_ajax hook
- Top Authors list by highest post views with Ajax pagination
- Offset with ajax load more posts duplicates
- Custom theme admin-ajax.php 400 (Bad Request)
- number of posts with “Load More”
- How to send Ajax Call from frontend without using wp_localize_script in Theme
- wordpress more than one ajax request at the same time issue
- Include search tags and users in my search results system
- Ajax not updating to database
- Ajax Load more CPT via shortcode
- Apply filters when loading post via ajax
- MySQL query in WordPress with AJAX
- Registration form not registering First and Last name
- Result from wp_send_json adds line feed
- Is custom behaviour possible when asynchronously uploading?
- AJAX with Selectbox Plugins (Select2, Chosen, Selectize)
- Fatal error: Uncaught Error: Call to undefined function wp_nav_menu()
- Data inserted in database, but ajax calls error function
- ajax form function error
- Load Meta box value into div AJAX [duplicate]
- Detecting IP Address of someone using ‘copy’ function [closed]
- How to display inputted data in Ajax without button or click event
- AJAX returning blank result
- using AJAX [object Object]
- Ajax – how to use XMLHttpRequest in wordpress
- I got this error POST https://localhost/meraboilerwp/[object%20Object] 404 (Not Found)
- How can I display a Divi content inside a modal based on an AJAX request
- Session seems to break