Make WordPress Core

Opened 13 years ago

Closed 12 years ago

#18541 closed enhancement (wontfix)

Add comments_open() conditional to Twenty Eleven's comment-reply.js call

Reported by: philiparthurmoore's profile philiparthurmoore Owned by:
Milestone: Priority: normal
Severity: minor Version: 3.2
Component: Bundled Theme Keywords: has-patch
Focuses: Cc:

Description

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.

Attachments (1)

twenty-eleven-comment-reply-js.patch (572 bytes) - added by philiparthurmoore 13 years ago.

Download all attachments as: .zip

Change History (7)

#1 follow-up: @ocean90
13 years ago

  • Component changed from Themes to Bundled Theme
  • Keywords has-patch added
  • Version changed from 3.3 to 3.2

You could also reply to a ping. Maybe

&& ( comments_open() || pings_open() )

#2 @SergeyBiryukov
13 years ago

  • Milestone changed from Awaiting Review to 3.3

#3 in reply to: ↑ 1 @philiparthurmoore
13 years ago

Replying to ocean90:

You could also reply to a ping. Maybe

&& ( comments_open() || pings_open() )

Isn't comment-reply.js just used for the threaded comments feature? I don't think pings_open() is important in this conditional.

Edit: Never mind. I see what you're saying. Sorry about that!

Last edited 13 years ago by philiparthurmoore (previous) (diff)

#4 @ocean90
13 years ago

Just ignore my comment too. In Twenty Eleven a reply to a ping isn't supported.

#6 @markjaquith
12 years ago

  • Milestone 3.3 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Not worth a query, IMO. Agree with Nacin's comment that zeo linked.

Note: See TracTickets for help on using tickets.