Make WordPress Core

Ticket #25514: 25514.diff

File 25514.diff, 20.9 KB (added by DrewAPicture, 11 years ago)

Cleanup + fixed @since versions

  • src/wp-includes/query.php

     
    17131713                $this->query_vars_hash = md5( serialize( $this->query_vars ) );
    17141714                $this->query_vars_changed = false;
    17151715
    1716                 do_action_ref_array('parse_query', array(&$this));
     1716                /**
     1717                 * Fires after the main query vars have been parsed.
     1718                 *
     1719                 * @since 1.5.0
     1720                 *
     1721                 * @param WP_Query &$this The WP_Query instance (passed by reference).
     1722                 */
     1723                do_action_ref_array( 'parse_query', array( &$this ) );
    17171724        }
    17181725
    17191726        /**
     
    19201927
    19211928                $this->tax_query = new WP_Tax_Query( $tax_query );
    19221929
     1930                /**
     1931                 * Fires after taxonomy-related query vars have been parsed.
     1932                 *
     1933                 * @since 3.7.0
     1934                 *
     1935                 * @param WP_Query $this The WP_Query instance.
     1936                 */
    19231937                do_action( 'parse_tax_query', $this );
    19241938        }
    19251939
     
    21552169
    21562170                $this->parse_query();
    21572171
    2158                 do_action_ref_array('pre_get_posts', array(&$this));
     2172                /**
     2173                 * Fires after the query variable object is created, but before the actual query is run.
     2174                 *
     2175                 * Note: If using conditional tags, use the method versions within the passed instance
     2176                 * (e.g. $this->is_main_query() instead of is_main_query()). This is because the functions
     2177                 * like is_main_query() test against the global $wp_query instance, not the passed one.
     2178                 *
     2179                 * @since 2.0.0
     2180                 *
     2181                 * @param WP_Query &$this The WP_Query instance (passed by reference).
     2182                 */
     2183                do_action_ref_array( 'pre_get_posts', array( &$this ) );
    21592184
    21602185                // Shorthand.
    21612186                $q = &$this->query_vars;
     
    27592784                        $where_status = implode( ' OR ', $statuswheres );
    27602785                        if ( ! empty( $where_status ) ) {
    27612786                                $where .= " AND ($where_status)";
    2762                         } 
     2787                        }
    27632788                } elseif ( !$this->is_singular ) {
    27642789                        $where .= " AND ($wpdb->posts.post_status = 'publish'";
    27652790
     
    27942819                        $where .= $clauses['where'];
    27952820                }
    27962821
    2797                 // Apply filters on where and join prior to paging so that any
    2798                 // manipulations to them are reflected in the paging by day queries.
     2822                /*
     2823                 * Apply filters on where and join prior to paging so that any
     2824                 * manipulations to them are reflected in the paging by day queries.
     2825                 */
    27992826                if ( !$q['suppress_filters'] ) {
    2800                         $where = apply_filters_ref_array('posts_where', array( $where, &$this ) );
    2801                         $join = apply_filters_ref_array('posts_join', array( $join, &$this ) );
     2827                        /**
     2828                         * Filter the WHERE clause of the query.
     2829                         *
     2830                         * @since 1.5.0
     2831                         *
     2832                         * @param string   $where The WHERE clause of the query.
     2833                         * @param WP_Query &$this The WP_Query instance (passed by reference).
     2834                         */
     2835                        $where = apply_filters_ref_array( 'posts_where', array( $where, &$this ) );
     2836
     2837                        /**
     2838                         * Filter the JOIN clause of the query.
     2839                         *
     2840                         * @since 1.5.0
     2841                         *
     2842                         * @param string   $where The JOIN clause of the query.
     2843                         * @param WP_Query &$this The WP_Query instance (passed by reference).
     2844                         */
     2845                        $join = apply_filters_ref_array( 'posts_join', array( $join, &$this ) );
    28022846                }
    28032847
    28042848                // Paging
     
    28292873                        }
    28302874
    28312875                        if ( !$q['suppress_filters'] ) {
    2832                                 $cjoin = apply_filters_ref_array('comment_feed_join', array( $cjoin, &$this ) );
    2833                                 $cwhere = apply_filters_ref_array('comment_feed_where', array( $cwhere, &$this ) );
    2834                                 $cgroupby = apply_filters_ref_array('comment_feed_groupby', array( $cgroupby, &$this ) );
    2835                                 $corderby = apply_filters_ref_array('comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );
    2836                                 $climits = apply_filters_ref_array('comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
     2876                                /**
     2877                                 * Filter the JOIN clause of the comments feed query before sending.
     2878                                 *
     2879                                 * @since 2.2.0
     2880                                 *
     2881                                 * @param string   $cjoin The JOIN clause of the query.
     2882                                 * @param WP_Query &$this The WP_Query instance (passed by reference).
     2883                                 */
     2884                                $cjoin = apply_filters_ref_array( 'comment_feed_join', array( $cjoin, &$this ) );
     2885
     2886                                /**
     2887                                 * Filter the WHERE clause of the comments feed query before sending.
     2888                                 *
     2889                                 * @since 2.2.0
     2890                                 *
     2891                                 * @param string   $cwhere The WHERE clause of the query.
     2892                                 * @param WP_Query &$this  The WP_Query instance (passed by reference).
     2893                                 */
     2894                                $cwhere = apply_filters_ref_array( 'comment_feed_where', array( $cwhere, &$this ) );
     2895
     2896                                /**
     2897                                 * Filter the GROUP BY clause of the comments feed query before sending.
     2898                                 *
     2899                                 * @since 2.2.0
     2900                                 *
     2901                                 * @param string   $cgroupby The GROUP BY clause of the query.
     2902                                 * @param WP_Query &$this    The WP_Query instance (passed by reference).
     2903                                 */
     2904                                $cgroupby = apply_filters_ref_array( 'comment_feed_groupby', array( $cgroupby, &$this ) );
     2905
     2906                                /**
     2907                                 * Filter the ORDER BY clause of the comments feed query before sending.
     2908                                 *
     2909                                 * @since 2.8.0
     2910                                 *
     2911                                 * @param string   $corderby The ORDER BY clause of the query.
     2912                                 * @param WP_Query &$this    The WP_Query instance (passed by reference).
     2913                                 */
     2914                                $corderby = apply_filters_ref_array( 'comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );
     2915
     2916                                /**
     2917                                 * Filter the LIMIT clause of the comments feed query before sending.
     2918                                 *
     2919                                 * @since 2.8.0
     2920                                 *
     2921                                 * @param string   $climits The JOIN clause of the query.
     2922                                 * @param WP_Query &$this   The WP_Query instance (passed by reference).
     2923                                 */
     2924                                $climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
    28372925                        }
    28382926                        $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';
    28392927                        $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';
     
    28562944
    28572945                $pieces = array( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' );
    28582946
    2859                 // Apply post-paging filters on where and join. Only plugins that
    2860                 // manipulate paging queries should use these hooks.
     2947                /*
     2948                 * Apply post-paging filters on where and join. Only plugins that
     2949                 * manipulate paging queries should use these hooks.
     2950                 */
    28612951                if ( !$q['suppress_filters'] ) {
     2952                        /**
     2953                         * Filter the WHERE clause of the query.
     2954                         *
     2955                         * Specifically for manipulating paging queries.
     2956                         *
     2957                         * @since 1.5.0
     2958                         *
     2959                         * @param string   $where The WHERE clause of the query.
     2960                         * @param WP_Query &$this The WP_Query instance (passed by reference).
     2961                         */
    28622962                        $where          = apply_filters_ref_array( 'posts_where_paged', array( $where, &$this ) );
     2963
     2964                        /**
     2965                         * Filter the GROUP BY clause of the query.
     2966                         *
     2967                         * @since 2.0.0
     2968                         *
     2969                         * @param string   $groupby The GROUP BY clause of the query.
     2970                         * @param WP_Query &$this   The WP_Query instance (passed by reference).
     2971                         */
    28632972                        $groupby        = apply_filters_ref_array( 'posts_groupby',             array( $groupby, &$this ) );
     2973
     2974                        /**
     2975                         * Filter the JOIN clause of the query.
     2976                         *
     2977                         * Specifically for manipulating paging queries.
     2978                         *
     2979                         * @since 1.5.0
     2980                         *
     2981                         * @param string   $join  The JOIN clause of the query.
     2982                         * @param WP_Query &$this The WP_Query instance (passed by reference).
     2983                         */
    28642984                        $join           = apply_filters_ref_array( 'posts_join_paged',  array( $join, &$this ) );
     2985
     2986                        /**
     2987                         * Filter the ORDER BY clause of the query.
     2988                         *
     2989                         * @since 1.5.1
     2990                         *
     2991                         * @param string   $orderby The ORDER BY clause of the query.
     2992                         * @param WP_Query &$this   The WP_Query instance (passed by reference).
     2993                         */
    28652994                        $orderby        = apply_filters_ref_array( 'posts_orderby',             array( $orderby, &$this ) );
     2995
     2996                        /**
     2997                         * Filter the DISTINCT clause of the query.
     2998                         *
     2999                         * @since 2.1.0
     3000                         *
     3001                         * @param string   $distinct The DISTINCT clause of the query.
     3002                         * @param WP_Query &$this    The WP_Query instance (passed by reference).
     3003                         */
    28663004                        $distinct       = apply_filters_ref_array( 'posts_distinct',    array( $distinct, &$this ) );
     3005
     3006                        /**
     3007                         * Filter the LIMIT clause of the query.
     3008                         *
     3009                         * @since 2.1.0
     3010                         *
     3011                         * @param string   $limits The LIMIT clause of the query.
     3012                         * @param WP_Query &$this  The WP_Query instance (passed by reference).
     3013                         */
    28673014                        $limits         = apply_filters_ref_array( 'post_limits',               array( $limits, &$this ) );
     3015
     3016                        /**
     3017                         * Filter the SELECT clause of the query.
     3018                         *
     3019                         * @since 2.1.0
     3020                         *
     3021                         * @param string   $fields The SELECT clause of the query.
     3022                         * @param WP_Query &$this  The WP_Query instance (passed by reference).
     3023                         */
    28683024                        $fields         = apply_filters_ref_array( 'posts_fields',              array( $fields, &$this ) );
    28693025
    2870                         // Filter all clauses at once, for convenience
     3026                        /**
     3027                         * Filter all query clauses at once, for convenience.
     3028                         *
     3029                         * Covers the WHERE, GROUP BY, JOIN, ORDER BY, DISTINCT,
     3030                         * fields (SELECT), and LIMITS clauses.
     3031                         *
     3032                         * @since 3.1.0
     3033                         *
     3034                         * @param array    $clauses The list of clauses for the query.
     3035                         * @param WP_Query &$this   The WP_Query instance (passed by reference).
     3036                         */
    28713037                        $clauses = (array) apply_filters_ref_array( 'posts_clauses', array( compact( $pieces ), &$this ) );
    2872                         foreach ( $pieces as $piece )
     3038
     3039                        foreach ( $pieces as $piece ) {
    28733040                                $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
     3041                        }
    28743042                }
    28753043
    2876                 // Announce current selection parameters. For use by caching plugins.
     3044                /**
     3045                 * Fires to announce the query's current selection parameters.
     3046                 *
     3047                 * For use by caching plugins.
     3048                 *
     3049                 * @since 2.3.0
     3050                 *
     3051                 * @param string $selection The assembled selection query.
     3052                 */
    28773053                do_action( 'posts_selection', $where . $groupby . $orderby . $limits . $join );
    28783054
    2879                 // Filter again for the benefit of caching plugins. Regular plugins should use the hooks above.
     3055                /*
     3056                 * Filter again for the benefit of caching plugins.
     3057                 * Regular plugins should use the hooks above.
     3058                 */
    28803059                if ( !$q['suppress_filters'] ) {
     3060                        /**
     3061                         * Filter the WHERE clause of the query.
     3062                         *
     3063                         * For use by caching plugins.
     3064                         *
     3065                         * @since 2.5.0
     3066                         *
     3067                         * @param string   $where The WHERE clause of the query.
     3068                         * @param WP_Query &$this The WP_Query instance (passed by reference).
     3069                         */
    28813070                        $where          = apply_filters_ref_array( 'posts_where_request',               array( $where, &$this ) );
     3071
     3072                        /**
     3073                         * Filter the GROUP BY clause of the query.
     3074                         *
     3075                         * For use by caching plugins.
     3076                         *
     3077                         * @since 2.5.0
     3078                         *
     3079                         * @param string   $groupby The GROUP BY clause of the query.
     3080                         * @param WP_Query &$this   The WP_Query instance (passed by reference).
     3081                         */
    28823082                        $groupby        = apply_filters_ref_array( 'posts_groupby_request',             array( $groupby, &$this ) );
     3083
     3084                        /**
     3085                         * Filter the JOIN clause of the query.
     3086                         *
     3087                         * For use by caching plugins.
     3088                         *
     3089                         * @since 2.5.0
     3090                         *
     3091                         * @param string   $join  The JOIN clause of the query.
     3092                         * @param WP_Query &$this The WP_Query instance (passed by reference).
     3093                         */
    28833094                        $join           = apply_filters_ref_array( 'posts_join_request',                array( $join, &$this ) );
     3095
     3096                        /**
     3097                         * Filter the ORDER BY clause of the query.
     3098                         *
     3099                         * For use by caching plugins.
     3100                         *
     3101                         * @since 2.5.0
     3102                         *
     3103                         * @param string   $orderby The ORDER BY clause of the query.
     3104                         * @param WP_Query &$this   The WP_Query instance (passed by reference).
     3105                         */
    28843106                        $orderby        = apply_filters_ref_array( 'posts_orderby_request',             array( $orderby, &$this ) );
     3107
     3108                        /**
     3109                         * Filter the DISTINCT clause of the query.
     3110                         *
     3111                         * For use by caching plugins.
     3112                         *
     3113                         * @since 2.5.0
     3114                         *
     3115                         * @param string   $distinct The DISTINCT clause of the query.
     3116                         * @param WP_Query &$this    The WP_Query instance (passed by reference).
     3117                         */
    28853118                        $distinct       = apply_filters_ref_array( 'posts_distinct_request',    array( $distinct, &$this ) );
     3119
     3120                        /**
     3121                         * Filter the SELECT clause of the query.
     3122                         *
     3123                         * For use by caching plugins.
     3124                         *
     3125                         * @since 2.5.0
     3126                         *
     3127                         * @param string   $fields The SELECT clause of the query.
     3128                         * @param WP_Query &$this  The WP_Query instance (passed by reference).
     3129                         */
    28863130                        $fields         = apply_filters_ref_array( 'posts_fields_request',              array( $fields, &$this ) );
     3131
     3132                        /**
     3133                         * Filter the LIMIT clause of the query.
     3134                         *
     3135                         * For use by caching plugins.
     3136                         *
     3137                         * @since 2.5.0
     3138                         *
     3139                         * @param string   $limits The LIMIT clause of the query.
     3140                         * @param WP_Query &$this  The WP_Query instance (passed by reference).
     3141                         */
    28873142                        $limits         = apply_filters_ref_array( 'post_limits_request',               array( $limits, &$this ) );
    28883143
    2889                         // Filter all clauses at once, for convenience
     3144                        /**
     3145                         * Filter all query clauses at once, for convenience.
     3146                         *
     3147                         * For use by caching plugins.
     3148                         *
     3149                         * Covers the WHERE, GROUP BY, JOIN, ORDER BY, DISTINCT,
     3150                         * fields (SELECT), and LIMITS clauses.
     3151                         *
     3152                         * @since 3.1.0
     3153                         *
     3154                         * @param array    $pieces The pieces of the query.
     3155                         * @param WP_Query &$this  The WP_Query instance (passed by reference).
     3156                         */
    28903157                        $clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( compact( $pieces ), &$this ) );
    28913158                        foreach ( $pieces as $piece )
    28923159                                $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
     
    29043171                $this->request = $old_request = "SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
    29053172
    29063173                if ( !$q['suppress_filters'] ) {
     3174                        /**
     3175                         * Filter the completed SQL query before sending.
     3176                         *
     3177                         * @since 2.0.0
     3178                         *
     3179                         * @param array    $request The complete SQL query.
     3180                         * @param WP_Query &$this   The WP_Query instance (passed by reference).
     3181                         */
    29073182                        $this->request = apply_filters_ref_array( 'posts_request', array( $this->request, &$this ) );
    29083183                }
    29093184
     
    29283203                }
    29293204
    29303205                $split_the_query = ( $old_request == $this->request && "$wpdb->posts.*" == $fields && !empty( $limits ) && $q['posts_per_page'] < 500 );
     3206
     3207                /**
     3208                 * Filter the $split_the_query boolean.
     3209                 *
     3210                 * Splitting the query will cause it to fetch just the IDs of the found posts
     3211                 * (and then individually fetch each post by ID), rather than fetching every
     3212                 * complete row at once. One massive result vs. many small results.
     3213                 *
     3214                 * @since 3.4.0
     3215                 *
     3216                 * @param bool     $split_the_query Whether or not to split the query.
     3217                 * @param WP_Query $this            The WP_Query instance.
     3218                 */
    29313219                $split_the_query = apply_filters( 'split_the_query', $split_the_query, $this );
    29323220
    29333221                if ( $split_the_query ) {
     
    29353223
    29363224                        $this->request = "SELECT $found_rows $distinct $wpdb->posts.ID FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
    29373225
     3226                        /**
     3227                         * Filter the Post IDs SQL request before sending.
     3228                         *
     3229                         * @since 3.4.0
     3230                         *
     3231                         * @param string   $request The post ID request.
     3232                         * @param WP_Query $this    The WP_Query instance.
     3233                         */
    29383234                        $this->request = apply_filters( 'posts_request_ids', $this->request, $this );
    29393235
    29403236                        $ids = $wpdb->get_col( $this->request );
     
    29553251                if ( $this->posts )
    29563252                        $this->posts = array_map( 'get_post', $this->posts );
    29573253
    2958                 // Raw results filter. Prior to status checks.
    2959                 if ( !$q['suppress_filters'] )
    2960                         $this->posts = apply_filters_ref_array('posts_results', array( $this->posts, &$this ) );
     3254                if ( ! $q['suppress_filters'] ) {
     3255                        /**
     3256                         * Filter the raw post results array, prior to status checks.
     3257                         *
     3258                         * @since 2.3.0
     3259                         *
     3260                         * @param array    $posts The post results array.
     3261                         * @param WP_Query &$this The WP_Query instance (passed by reference).
     3262                         */
     3263                        $this->posts = apply_filters_ref_array( 'posts_results', array( $this->posts, &$this ) );
     3264                }
    29613265
    29623266                if ( !empty($this->posts) && $this->is_comment_feed && $this->is_singular ) {
    2963                         $cjoin = apply_filters_ref_array('comment_feed_join', array( '', &$this ) );
    2964                         $cwhere = apply_filters_ref_array('comment_feed_where', array( "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'", &$this ) );
    2965                         $cgroupby = apply_filters_ref_array('comment_feed_groupby', array( '', &$this ) );
     3267                        /** This filter is documented in wp-includes/query.php */
     3268                        $cjoin = apply_filters_ref_array( 'comment_feed_join', array( '', &$this ) );
     3269
     3270                        /** This filter is documented in wp-includes/query.php */
     3271                        $cwhere = apply_filters_ref_array( 'comment_feed_where', array( "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'", &$this ) );
     3272
     3273                        /** This filter is documented in wp-includes/query.php */
     3274                        $cgroupby = apply_filters_ref_array( 'comment_feed_groupby', array( '', &$this ) );
    29663275                        $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';
    2967                         $corderby = apply_filters_ref_array('comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );
     3276
     3277                        /** This filter is documented in wp-includes/query.php */
     3278                        $corderby = apply_filters_ref_array( 'comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );
    29683279                        $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';
    2969                         $climits = apply_filters_ref_array('comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
     3280
     3281                        /** This filter is documented in wp-includes/query.php */
     3282                        $climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
     3283
    29703284                        $comments_request = "SELECT $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits";
    29713285                        $this->comments = $wpdb->get_results($comments_request);
    29723286                        $this->comment_count = count($this->comments);
     
    30003314                                }
    30013315                        }
    30023316
    3003                         if ( $this->is_preview && $this->posts && current_user_can( $edit_cap, $this->posts[0]->ID ) )
     3317                        if ( $this->is_preview && $this->posts && current_user_can( $edit_cap, $this->posts[0]->ID ) ) {
     3318                                /**
     3319                                 * Filter the single post for preview mode.
     3320                                 *
     3321                                 * @since 2.7.0
     3322                                 *
     3323                                 * @param WP_Post  $post_preview  The Post object.
     3324                                 * @param WP_Query &$this         The WP_Query instance (passed by reference).
     3325                                 */
    30043326                                $this->posts[0] = get_post( apply_filters_ref_array( 'the_preview', array( $this->posts[0], &$this ) ) );
     3327                        }
    30053328                }
    30063329
    30073330                // Put sticky posts at the top of the posts array
     
    30453368                        }
    30463369                }
    30473370
    3048                 if ( !$q['suppress_filters'] )
    3049                         $this->posts = apply_filters_ref_array('the_posts', array( $this->posts, &$this ) );
     3371                if ( ! $q['suppress_filters'] ) {
     3372                        /**
     3373                         * Filter the array of retrieved posts after they've been fetched and
     3374                         * internally processed.
     3375                         *
     3376                         * @since 1.5.0
     3377                         *
     3378                         * @param array    $posts The array of retrieved posts.
     3379                         * @param WP_Query &$this The WP_Query instance (passed by reference).
     3380                         */
     3381                        $this->posts = apply_filters_ref_array( 'the_posts', array( $this->posts, &$this ) );
     3382                }
    30503383
    30513384                // Ensure that any posts added/modified via one of the filters above are
    30523385                // of the type WP_Post and are filtered.
     
    30823415                if ( $q['no_found_rows'] || ( is_array( $this->posts ) && ! $this->posts ) )
    30833416                        return;
    30843417
    3085                 if ( ! empty( $limits ) )
     3418                if ( ! empty( $limits ) ) {
     3419                        /**
     3420                         * Filter the query to run for retrieving the found posts.
     3421                         *
     3422                         * @since 2.1.0
     3423                         *
     3424                         * @param string   $found_posts The query to run to find the found posts.
     3425                         * @param WP_Query &$this       The WP_Query instance (passed by reference).
     3426                         */
    30863427                        $this->found_posts = $wpdb->get_var( apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) ) );
    3087                 else
     3428                } else {
    30883429                        $this->found_posts = count( $this->posts );
     3430                }
    30893431
     3432                /**
     3433                 * Filter the number of found posts for the query.
     3434                 *
     3435                 * @since 2.1.0
     3436                 *
     3437                 * @param int      $found_posts The number of posts found.
     3438                 * @param WP_Query &$this       The WP_Query instance (passed by reference).
     3439                 */
    30903440                $this->found_posts = apply_filters_ref_array( 'found_posts', array( $this->found_posts, &$this ) );
    30913441
    30923442                if ( ! empty( $limits ) )
     
    31253475                $this->in_the_loop = true;
    31263476
    31273477                if ( $this->current_post == -1 ) // loop has just started
    3128                         do_action_ref_array('loop_start', array(&$this));
     3478                        /**
     3479                         * Fires once the loop is started.
     3480                         *
     3481                         * @since 2.0.0
     3482                         *
     3483                         * @param WP_Query &$this The WP_Query instance (passed by reference).
     3484                         */
     3485                        do_action_ref_array( 'loop_start', array( &$this ) );
    31293486
    31303487                $post = $this->next_post();
    31313488                setup_postdata($post);
     
    31463503                if ( $this->current_post + 1 < $this->post_count ) {
    31473504                        return true;
    31483505                } elseif ( $this->current_post + 1 == $this->post_count && $this->post_count > 0 ) {
    3149                         do_action_ref_array('loop_end', array(&$this));
     3506                        /**
     3507                         * Fires once the loop has ended.
     3508                         *
     3509                         * @since 2.0.0
     3510                         *
     3511                         * @param WP_Query &$this The WP_Query instance (passed by reference).
     3512                         */
     3513                        do_action_ref_array( 'loop_end', array( &$this ) );
    31503514                        // Do some cleaning up after the loop
    31513515                        $this->rewind_posts();
    31523516                }
     
    31973561                $comment = $this->next_comment();
    31983562
    31993563                if ( $this->current_comment == 0 ) {
    3200                         do_action('comment_loop_start');
     3564                        /**
     3565                         * Fires once the comment loop is started.
     3566                         *
     3567                         * @since 2.2.0
     3568                         */
     3569                        do_action( 'comment_loop_start' );
    32013570                }
    32023571        }
    32033572
     
    39904359                $pages = array( $post->post_content );
    39914360        }
    39924361
    3993         do_action_ref_array('the_post', array(&$post));
     4362        /**
     4363         * Fires once the post data has been setup.
     4364         *
     4365         * @since 2.8.0
     4366         *
     4367         * @param WP_Post &$post The Post object (passed by reference).
     4368         */
     4369        do_action_ref_array( 'the_post', array( &$post ) );
    39944370
    39954371        return true;
    39964372}