Forums

Trying to replace comment template (2 posts)

  1. ipave
    Member
    Posted 3 months ago #

    Hey

    I'm writing a custom comment system plugin that will allow user authentication through several Oauth providers. I't current prototype which is embedded to my theme works perfectly. I'm now trying to move it to a separate plugin, but I can't get comments_template() replaced.

    function k_comments_template($comment_template) {
    	return "I't works!";
    }
    add_filter('comments_template', 'k_comments_template');

    Any ideas?

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 months ago #

    try and check the original code:

    /wp-includes/comment-template.php from line 822:

    * The $file path is passed through a filter hook called, 'comments_template'
     * which includes the TEMPLATEPATH and $file combined.

    ...

    $include = apply_filters('comments_template', STYLESHEETPATH . $file );

Reply

You must log in to post.

About this Topic