WordPress.org

Make WordPress Core

Ticket #18561: comment-template.diff

File comment-template.diff, 759 bytes (added by trepmal, 3 years ago)

pre/post_comments_template action hook idea

  • wp-includes/comment-template.php

     
    908908        if ( !defined('COMMENTS_TEMPLATE') || !COMMENTS_TEMPLATE) 
    909909                define('COMMENTS_TEMPLATE', true); 
    910910 
     911        do_action( 'pre_comments_template', $post ); 
     912 
    911913        $include = apply_filters('comments_template', STYLESHEETPATH . $file ); 
    912914        if ( file_exists( $include ) ) 
    913915                require( $include ); 
     
    915917                require( TEMPLATEPATH .  $file ); 
    916918        else // Backward compat code will be removed in a future release 
    917919                require( ABSPATH . WPINC . '/theme-compat/comments.php'); 
     920 
     921        do_action( 'post_comments_template', $post ); 
    918922} 
    919923 
    920924/**