Make WordPress Core


Ignore:
Timestamp:
12/10/2015 03:05:34 AM (9 years ago)
Author:
johnbillion
Message:

Comments: The year is 2003. Permalinks are a new thing and everyone's using Blogger. It's a time when opening a modal window in JavaScript to view a section of a website is not a completely weird thing, although many users get annoyed by it. b2 has recently become WordPress, and with it comes a bunch of functionality that will become stale over the next decade, remnants of simpler times.

Twelve years later, after no fewer than three themes have intentionally implemented popup comments in their functionality, before being abandoned for at least the last six years, we've reached a time where we can put this era behind us. A time when we can remove comment popup functionality from WordPress.

If this breaks the internet, I'll eat my hat.

Fixes #28617

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/query.php

    r35690 r35848  
    295295
    296296    return $wp_query->is_tax( $taxonomy, $term );
    297 }
    298 
    299 /**
    300  * Whether the current URL is within the comments popup window.
    301  *
    302  * @since 1.5.0
    303  *
    304  * @global WP_Query $wp_query Global WP_Query instance.
    305  *
    306  * @return bool
    307  */
    308 function is_comments_popup() {
    309     global $wp_query;
    310 
    311     if ( ! isset( $wp_query ) ) {
    312         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    313         return false;
    314     }
    315 
    316     return $wp_query->is_comments_popup();
    317297}
    318298
     
    863843 *
    864844 * @since 1.5.0
     845 * @since 4.5.0 Removed the `$comments_popup` property.
    865846 */
    866847class WP_Query {
     
    12291210     */
    12301211    public $is_embed = false;
    1231 
    1232     /**
    1233      * Set if query is within comments popup window.
    1234      *
    1235      * @since 1.5.0
    1236      * @access public
    1237      * @var bool
    1238      */
    1239     public $is_comments_popup = false;
    12401212
    12411213    /**
     
    13901362        $this->is_home = false;
    13911363        $this->is_404 = false;
    1392         $this->is_comments_popup = false;
    13931364        $this->is_paged = false;
    13941365        $this->is_admin = false;
     
    14421413     *
    14431414     * @since 2.1.0
     1415     * @since 4.4.0 Removed the `comments_popup` public query variable.
    14441416     * @access public
    14451417     *
     
    14771449            , 'tb'
    14781450            , 'paged'
    1479             , 'comments_popup'
    14801451            , 'meta_key'
    14811452            , 'meta_value'
     
    15121483     * @since 4.4.0 Introduced `$post_name__in` and `$title` parameters. `$s` was updated to support excluded
    15131484     *              search terms, by prepending a hyphen.
     1485     * @since 4.5.0 Removed the `$comments_popup` parameter.
    15141486     * @access public
    15151487     *
     
    15301502     *     @type int          $comments_per_page       The number of comments to return per page.
    15311503     *                                                 Default 'comments_per_page' option.
    1532      *     @type int|string   $comments_popup          Whether the query is within the comments popup. Default empty.
    15331504     *     @type array        $date_query              An associative array of WP_Date_Query arguments.
    15341505     *                                                 {@see WP_Date_Query::__construct()}
     
    17921763            $this->is_paged = true;
    17931764
    1794         if ( '' != $qv['comments_popup'] )
    1795             $this->is_comments_popup = true;
    1796 
    17971765        // if we're previewing inside the write screen
    17981766        if ( '' != $qv['preview'] )
     
    18121780            $this->is_comment_feed = true;
    18131781
    1814         if ( !( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) || $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_comments_popup || $this->is_robots ) )
     1782        if ( !( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) || $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_robots ) )
    18151783            $this->is_home = true;
    18161784
     
    27722740        }
    27732741
    2774         if ( intval($q['comments_popup']) )
    2775             $q['p'] = absint($q['comments_popup']);
    2776 
    27772742        // If an attachment is requested by number, let it supersede any post number.
    27782743        if ( $q['attachment_id'] )
     
    43854350     *
    43864351     * @since 3.1.0
     4352     * @deprecated 4.5.0
    43874353     *
    43884354     * @return bool
    43894355     */
    43904356    public function is_comments_popup() {
    4391         return (bool) $this->is_comments_popup;
     4357        _deprecated_function( __FUNCTION__, '4.5' );
     4358
     4359        return false;
    43924360    }
    43934361
Note: See TracChangeset for help on using the changeset viewer.