wppaste
WordPress

wp_ajax_replyto_comment( string $action )

Since
3.1.0
Source
wp-admin/includes/ajax-actions.php:1327
Handles replying to a comment via AJAX.

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

Reaches the database via get_post().

Scaling
Constant

No loop in the body: the same number of instructions runs whatever you pass in.

Instructions
163–229

Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 320.

Plugin surface
None

Nothing here hands control to plugin code.

Called by
0

Nothing in core calls this; the cost is only what you spend yourself.

What it touches

  • querycontent queryget_post()called directly
  • hookthird-party callbacksdo_action()one call below wp_ajax_replyto_comment()
  • optionoption read or writeget_option()one call below wp_ajax_replyto_comment()
  • cacheobject cachewp_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.

WhenInstructionsCalls it makes
!empty($action) && current_user_can() && !empty($post) && !->exists() && $comment_content !== "" && empty($value) && !is_wp_error()163–178check_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–187check_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–181check_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–190check_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–190check_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–183check_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–199check_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–192check_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–185check_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–194check_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–193check_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–186check_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–202check_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–195check_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–188check_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–195check_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–197check_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–204check_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–197check_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–190check_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–206check_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–199check_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–198check_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–207check_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–200check_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–193check_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–209check_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–202check_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–202check_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–211check_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–205check_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–214check_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–203check_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–212check_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–206check_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–206check_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–215check_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–215check_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–208check_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–217check_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–209check_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–218check_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–210check_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–219check_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–211check_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–211check_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–220check_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–220check_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–213check_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–213check_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–222check_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–222check_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–214check_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–223check_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–215check_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–224check_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–216check_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–225check_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–218check_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–218check_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–227check_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–227check_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–220check_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–229check_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

PHPCompiledExecutedBranchesNotes
8.6-dev320163–22927
8.5320163–22927
8.4320163–229275 fewer instructions than PHP 8.3
8.3325165–23127
8.2325165–23127
8.1325165–231271 fewer instruction than PHP 7.4
7.4326165–23227

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

Show all 23

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.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 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.