WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

#18541 closed enhancement (wontfix)

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

Reported by: 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 4 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 follow-up: @ocean904 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() )

comment:2 @SergeyBiryukov4 years ago

  • Milestone changed from Awaiting Review to 3.3

comment:3 in reply to: ↑ 1 @philiparthurmoore4 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 4 years ago by philiparthurmoore (previous) (diff)

comment:4 @ocean904 years ago

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

comment:6 @markjaquith3 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.