wp_ajax_replyto_comment( string $action )
- Since
- 3.1.0
- Source
wp-admin/includes/ajax-actions.php:1308
Compatibility
- WordPress
- since 3.1.0
- PHP
- 7.4–8.6-dev
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.
Parameters
$actionstring- Action to perform.
Performance profile
How much work a call to wp_ajax_replyto_comment() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.
- Cost class
- Heavy
- Scaling
- Constant
- Instructions
- 163–229
- Plugin surface
- None
- Called by
- 0
Reaches the database via get_post().
No loop in the body: the same number of instructions runs whatever you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 320.
Nothing here hands control to plugin code.
Nothing in core calls this; the cost is only what you spend yourself.
What it touches
- querycontent query
get_post()called directly - hookthird-party callbacks
do_action()one call below wp_ajax_replyto_comment() - optionoption read or write
get_option()one call below wp_ajax_replyto_comment() - cacheobject cache
wp_cache_get()one call below wp_ajax_replyto_comment()
Further down the call graph this can also reach serialize and transient. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 64 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost wp_ajax_replyto_comment() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && empty($value) && !is_wp_error() | 163–178 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), wp_new_comment(), is_wp_error(), get_comment(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !isset($value) && empty($value) && !is_wp_error() | 163–187 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), wp_new_comment(), is_wp_error(), get_comment(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && empty($value) && !is_wp_error() | 166–181 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), wp_new_comment(), is_wp_error(), get_comment(), wp_die(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !isset($value) && empty($value) && !is_wp_error() | 166–190 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), wp_new_comment(), is_wp_error(), get_comment(), wp_die(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && !is_wp_error() | 168–190 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), wp_new_comment(), is_wp_error(), get_comment(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && empty($value) && is_wp_error() | 168–183 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !isset($value) && !empty($value) && !is_wp_error() | 168–199 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), wp_new_comment(), is_wp_error(), get_comment(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !isset($value) && empty($value) && is_wp_error() | 168–192 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && empty($value) && !is_wp_error() | 170–185 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), wp_new_comment(), is_wp_error(), get_comment(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && empty($value) && !is_wp_error() | 170–194 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), wp_new_comment(), is_wp_error(), get_comment(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && !is_wp_error() | 171–193 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), wp_new_comment(), is_wp_error(), get_comment(), wp_die(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && empty($value) && is_wp_error() | 171–186 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), wp_die(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
52 further outcomes, up to 229 instructions
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !isset($value) && !empty($value) && !is_wp_error() | 171–202 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), wp_new_comment(), is_wp_error(), get_comment(), wp_die(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !isset($value) && empty($value) && is_wp_error() | 171–195 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), wp_die(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && empty($value) && !is_wp_error() | 173–188 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), wp_new_comment(), is_wp_error(), get_comment(), wp_die(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && is_wp_error() | 173–195 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && empty($value) && !is_wp_error() | 173–197 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), wp_new_comment(), is_wp_error(), get_comment(), wp_die(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !isset($value) && !empty($value) && is_wp_error() | 173–204 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && !is_wp_error() | 175–197 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), wp_new_comment(), is_wp_error(), get_comment(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && empty($value) && is_wp_error() | 175–190 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && !is_wp_error() | 175–206 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), wp_new_comment(), is_wp_error(), get_comment(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && empty($value) && is_wp_error() | 175–199 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && is_wp_error() | 176–198 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), wp_die(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !isset($value) && !empty($value) && is_wp_error() | 176–207 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), wp_die(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && !is_wp_error() | 178–200 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), wp_new_comment(), is_wp_error(), get_comment(), wp_die(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && empty($value) && is_wp_error() | 178–193 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), wp_die(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && !is_wp_error() | 178–209 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), wp_new_comment(), is_wp_error(), get_comment(), wp_die(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && empty($value) && is_wp_error() | 178–202 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), wp_die(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && is_wp_error() | 180–202 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && is_wp_error() | 180–211 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && is_wp_error() | 183–205 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), wp_die(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && is_wp_error() | 183–214 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), wp_die(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && !is_wp_error() | 187–203 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), current_user_can(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), get_comment(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !isset($value) && !empty($value) && $comment_post_id === false && !is_wp_error() | 187–212 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), current_user_can(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), get_comment(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && !is_wp_error() | 190–206 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), current_user_can(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), get_comment(), wp_die(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && !is_wp_error() | 190–206 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), current_user_can(), wp_die(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), get_comment(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !isset($value) && !empty($value) && $comment_post_id === false && !is_wp_error() | 190–215 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), current_user_can(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), get_comment(), wp_die(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && !empty($post) && !->exists() && $comment_content !== "" && !isset($value) && !empty($value) && $comment_post_id === false && !is_wp_error() | 190–215 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), current_user_can(), wp_die(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), get_comment(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && is_wp_error() | 192–208 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), current_user_can(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !isset($value) && !empty($value) && $comment_post_id === false && is_wp_error() | 192–217 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), current_user_can(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && !is_wp_error() | 193–209 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), current_user_can(), wp_die(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), get_comment(), wp_die(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && !empty($post) && !->exists() && $comment_content !== "" && !isset($value) && !empty($value) && $comment_post_id === false && !is_wp_error() | 193–218 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), current_user_can(), wp_die(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), get_comment(), wp_die(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && !is_wp_error() | 194–210 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), current_user_can(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), get_comment(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && !is_wp_error() | 194–219 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), current_user_can(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), get_comment(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && is_wp_error() | 195–211 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), current_user_can(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), wp_die(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && is_wp_error() | 195–211 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), current_user_can(), wp_die(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !isset($value) && !empty($value) && $comment_post_id === false && is_wp_error() | 195–220 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), current_user_can(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), wp_die(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && !empty($post) && !->exists() && $comment_content !== "" && !isset($value) && !empty($value) && $comment_post_id === false && is_wp_error() | 195–220 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), current_user_can(), wp_die(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && !is_wp_error() | 197–213 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), current_user_can(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), get_comment(), wp_die(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && !is_wp_error() | 197–213 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), current_user_can(), wp_die(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), get_comment(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && !is_wp_error() | 197–222 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), current_user_can(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), get_comment(), wp_die(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && !is_wp_error() | 197–222 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), current_user_can(), wp_die(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), get_comment(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && is_wp_error() | 198–214 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), current_user_can(), wp_die(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), wp_die(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && !empty($post) && !->exists() && $comment_content !== "" && !isset($value) && !empty($value) && $comment_post_id === false && is_wp_error() | 198–223 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), compact(), get_comment(), current_user_can(), wp_die(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), wp_die(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && is_wp_error() | 199–215 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), current_user_can(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && is_wp_error() | 199–224 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), current_user_can(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && !is_wp_error() | 200–216 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), current_user_can(), wp_die(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), get_comment(), wp_die(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && !is_wp_error() | 200–225 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), current_user_can(), wp_die(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), get_comment(), wp_die(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && is_wp_error() | 202–218 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), current_user_can(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), wp_die(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && is_wp_error() | 202–218 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), current_user_can(), wp_die(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && is_wp_error() | 202–227 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), current_user_can(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), wp_die(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && is_wp_error() | 202–227 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), current_user_can(), wp_die(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && is_wp_error() | 205–220 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), current_user_can(), wp_die(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), wp_die(), ob_start(), _wp_dashboard_recent_comments_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
!empty($action) && !empty($post) && !->exists() && $comment_content !== "" && !empty($value) && $comment_post_id === false && is_wp_error() | 205–229 | check_ajax_referer(), get_post(), current_user_can(), wp_get_current_user(), ->exists(), __(), wp_die(), absint(), compact(), get_comment(), current_user_can(), wp_die(), wp_set_comment_status(), wp_new_comment(), is_wp_error(), ->get_error_message(), wp_die(), get_comment(), wp_die(), ob_start(), _get_list_table(), ->single_row(), ob_get_clean(), wp_count_comments(), _n(), number_format_i18n(), sprintf(), _n(), number_format_i18n(), sprintf(), in_moderation(), ->add(), ->send() |
This body has more branch combinations than are worth enumerating, so the table covers the outcomes found first rather than every one that exists.
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 320 | 163–229 | 27 | |
| 8.5 | 320 | 163–229 | 27 | |
| 8.4 | 320 | 163–229 | 27 | 5 fewer instructions than PHP 8.3 |
| 8.3 | 325 | 165–231 | 27 | |
| 8.2 | 325 | 165–231 | 27 | |
| 8.1 | 325 | 165–231 | 27 | 1 fewer instruction than PHP 7.4 |
| 7.4 | 326 | 165–232 | 27 |
An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.
Uses · 23
- check_ajax_referer()Verifies the Ajax request to prevent processing requests external of the blog.
- get_post()Retrieves post data given a post ID or post object.
- wp_die()Kills WordPress execution and displays HTML page with an error message.
- current_user_can()Returns whether the current user has the specified capability.
- __()Retrieves the translation of $text.
- wp_get_current_user()Retrieves the current user object.
- wp_slash()Adds slashes to a string or recursively adds slashes to strings within an array.
- wp_create_nonce()Creates a cryptographic token tied to a specific action, user, user session, and window of time.
- kses_remove_filters()Removes all KSES input form content filters.
- kses_init_filters()Adds all KSES input form content filters.
- remove_filter()Removes a callback function from a filter hook.
- add_filter()Adds a callback function to a filter hook.
Show all 23
- absint()Converts a value to non-negative integer.
- get_comment()Retrieves comment data given a comment ID or comment object.
- wp_set_comment_status()Sets the status of a comment.
- wp_new_comment()Adds a new comment to the database.
- is_wp_error()Checks whether the given variable is a WordPress Error.
- _wp_dashboard_recent_comments_row()Outputs a row for the Recent Comments widget.
- _get_list_table()Fetches an instance of a WP_List_Table class.
- wp_count_comments()Retrieves the total comment counts for the whole site or a single post.
- _n()Translates and retrieves the singular or plural form based on the supplied number.
- number_format_i18n()Converts float number to format based on the locale.
- WP_Ajax_Response::__construct()Constructor - Passes args to WP_Ajax_Response::add().
Source code
function wp_ajax_replyto_comment( $action ) { if ( empty( $action ) ) { $action = 'replyto-comment'; } check_ajax_referer( $action, '_ajax_nonce-replyto-comment' ); $comment_post_id = (int) $_POST['comment_post_ID']; $post = get_post( $comment_post_id ); if ( ! $post ) { wp_die( -1 ); } if ( ! current_user_can( 'edit_post', $comment_post_id ) ) { wp_die( -1 ); } if ( empty( $post->post_status ) ) { wp_die( 1 ); } elseif ( in_array( $post->post_status, array( 'draft', 'pending', 'trash' ), true ) ) { wp_die( __( 'You cannot reply to a comment on a draft post.' ) ); } $user = wp_get_current_user(); if ( $user->exists() ) { $comment_author = wp_slash( $user->display_name ); $comment_author_email = wp_slash( $user->user_email ); $comment_author_url = wp_slash( $user->user_url ); $user_id = $user->ID; if ( current_user_can( 'unfiltered_html' ) ) { if ( ! isset( $_POST['_wp_unfiltered_html_comment'] ) ) { $_POST['_wp_unfiltered_html_comment'] = ''; } if ( wp_create_nonce( 'unfiltered-html-comment' ) !== $_POST['_wp_unfiltered_html_comment'] ) { kses_remove_filters(); // Start with a clean slate. kses_init_filters(); // Set up the filters. remove_filter( 'pre_comment_content', 'wp_filter_post_kses' ); add_filter( 'pre_comment_content', 'wp_filter_kses' ); } } } else { wp_die( __( 'Sorry, you must be logged in to reply to a comment.' ) ); } $comment_content = trim( $_POST['content'] ); if ( '' === $comment_content ) { wp_die( __( 'Please type your comment text.' ) ); } $comment_type = isset( $_POST['comment_type'] ) ? trim( $_POST['comment_type'] ) : 'comment'; $comment_parent = 0; if ( isset( $_POST['comment_ID'] ) ) { $comment_parent = absint( $_POST['comment_ID'] ); } $comment_auto_approved = false; $commentdata = array( 'comment_post_ID' => $comment_post_id, ); $commentdata += compact( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_id' ); // Automatically approve parent comment. if ( ! empty( $_POST['approve_parent'] ) ) {Changelog
Introduced in 3.1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.9.7 tag, from
src/wp-admin/includes/ajax-actions.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.