It appears you can get max_depth
from the options via get_option('thread_comments_depth')
:
function prefix_submit_ajax_comment(){
$comment = wp_handle_comment_submission( wp_unslash( $_POST ) );
...handle errors and get $comment_depth...
$GLOBALS['comment'] = $comment;
$GLOBALS['comment_depth'] = $comment_depth;
$args['max_depth'] = get_option( 'thread_comments_depth' ); // solution
op_format_comment($comment, $args, $comment_depth);
}
Related Posts:
- edit-comments.php comment_row_actions ajax problem
- Loading comments in ajax – comment-reply function missing $args
- Ajax comment form submit on frontpage alerts success but no insertion
- How to update Comment post meta through an Ajax call
- Full Front End, AJAX comment system and comment reply script
- wordpress admin ajax trash_comment
- How modify comments metabox on post edit screen in WordPress?
- Turn a URL into content preview
- Ajax Comment: Page reloads whenever the comment submission form is reloaded
- get_comments() returns empty array if called through AJAX
- How to load wp_editor() through AJAX/jQuery
- How to get a unique nonce for each Ajax request?
- Open a Thickbox with content trough AJAX
- Is there a JavaScript API? How to access public and private data in JS?
- Are ‘wp_ajax’ and ‘wp_ajax_nopriv’ exclusive to authenticated and non-authenticated users?
- Get posts with ajax
- Ajax requests without JQuery
- WordPress AJAX Login Screen
- Custom PHP endpoint for a plugin’s AJAX call
- How to link WordPress heartbeat to ajax form
- How can I get logged in user’s session data from admin-ajax?
- AJAX only works when I’m logged as Admin
- When using javascript to dynamically add a textarea, how can I render it as a tinyMCE editor (in wordpress)?
- Drag and drop multiple file upload using Ajax WordPress
- Is there a way to optimize function that is used for returning data in an ajax-call?
- Ajax returning correct data BUT at wrong place
- get_posts empty when called via Ajax
- admin-ajax.php mixed content
- WP-API and Basic Auth returning 403 on POST but not GET
- Is there a hook to process a backbone restful PUT request inside wordpress?
- Check if username exist with AJAX
- How to localized one js file for different actions?
- Call javascript function when category was added via ajax
- json encode not work in wordpress
- wordpress and add actions to button by coding
- Get Author Post on author.php with AJAX
- Ajax in plugin settings page returns 400 Bad Request
- Admin-Ajax Error
- WordPress Ajaxify Problem with Scroll-to [closed]
- Stop ajax listener from sending empty parameter to function
- Can’t trigger an AJAX function with a submit button in the dashboard
- AJAX and -1 response
- How to make registration form ajax?
- Specify ABSPATH in jQuery url
- WordPress action – Pass arguments into action in an AJAX call?
- 403 error When i send ajax request on WordPress website
- Ajax Call 400 Bad Request error with POST request but not with GET request
- While Ajax is working well, media upload isn’t showing the imagines
- How can I call an api before user login
- Problems with wordpress nonces in Ajax call
- Get post content and show it in a div
- why does not work ajax that add_action registered in wordpress
- How to get post from pure frontend AJAX (using only post ID)?
- Auto load subcategories content with ajax
- Multiple AJAX requests using the same ajax_object.ajaxurl
- Is there a better way to access transients using javascript
- Filter custom post types by custom field using AJAX
- How to perform a frontend HTTP call with AJAX when plugin save the new settings?
- Refresh loop of custom posts (div) after new post is published
- Use ajax request to load sidebar
- How to change request URL?
- Why the wp_localize_script() does not work correct in my case? ( /wp-admin/admin-ajax.php 400 (Bad Request) )
- Updating failed. The response is not a valid JSON response. specific to my browser when I include javascript in my html
- Zip Files from custom fields
- Prevent AJAX caching from plugin
- Should wordpress nonce be placed in html form or in javascript file
- Ajax call returning 0 in page template
- If I leave out the wp_die() in the testiframe function I get the ‘0’ appended to my output. If I put it in, the page w/ iframe linked to it crashes
- how to make sure js is enabled before executing php function
- ERROR while passing data from JS to PHP via AJAX
- ajax load more instead of pagination
- jQuery AJAX url wit variable
- How to pass array from jQuery to PHP with AJAX in WordPress?
- Using existing ajax data that is loaded into page
- How to force the admin-ajax.php file to load over HTTPS?
- Unable to ajax request with meta_query
- get_body_class() in ajax envrionment
- Ajax WordPress pass post URLs
- How To Pass Theme Path In Javascript Ajax to Pass Id On another Page in WordPress Custom Page Template?
- AJAX action returning empty posts array?
- Infinite Scroll
- Cannot add multiple single images at once
- WordPress Ajax JSON success return no being recognized
- Session variables lost during Ajax calls – WordPress – Sage Starter Theme
- WordPress page content only in fancybox except direct click
- Ajax takes 10x as long as it should/could
- While doing ajax, WordPress returning internal server error 500 and stating that my theme functions are undefined
- SHORTINIT and sessions
- How to use AJAX to check if user is still logged-in?
- Ajax navigation and scripts loaded only on certain pages
- Closing ajax function file with die() causes error and empty page
- How to load wordpress sidebar using AJAX [duplicate]
- using Ajax: call to undefined function get_option
- WordPress Pagination with ajax – Dots
- Bad Request when adding new post via ajax form
- How To Pass Ajax Value to PHP Query?
- Ajax load more posts button
- ajax for visitors wordpress
- PHP cookie not set within AJAX call
- WordPress Ajax send response on every iteration of a loop