[wp-trac] [WordPress Trac] #18541: Add comments_open() conditional to Twenty Eleven's comment-reply.js call
WordPress Trac
wp-trac at lists.automattic.com
Mon Aug 29 16:06:28 UTC 2011
#18541: Add comments_open() conditional to Twenty Eleven's comment-reply.js call
-------------------------------+-----------------------------
Reporter: philiparthurmoore | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version: 3.3
Severity: minor | Keywords:
-------------------------------+-----------------------------
The current code used to include `comment-reply.js` in Twenty Eleven's
`header.php` is as follows:
{{{
if ( is_singular() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
}}}
If a singular page is being displayed and comments are closed, the script
is still loaded. The code should be adjusted as follows:
{{{
if ( is_singular() && get_option( 'thread_comments' ) &&
comments_open() )
wp_enqueue_script( 'comment-reply' );
}}}
The expected output of this code is for `comment-reply.js` to only be
loaded on singular pages that have commenting currently open.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18541>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list