Ticket #25514: WP_Query-hook-docs.5.diff
File WP_Query-hook-docs.5.diff, 20.9 KB (added by , 10 years ago) |
---|
-
wp-includes/query.php
1709 1709 $this->query_vars_hash = md5( serialize( $this->query_vars ) ); 1710 1710 $this->query_vars_changed = false; 1711 1711 1712 do_action_ref_array('parse_query', array(&$this)); 1712 /** 1713 * Fires after parse_query() is complete. 1714 * 1715 * @since 1.5.2 1716 * 1717 * @param WP_Query &$this The WP_Query instance (passed by reference). 1718 */ 1719 do_action_ref_array( 'parse_query', array( &$this ) ); 1713 1720 } 1714 1721 1715 1722 /* … … 1903 1910 1904 1911 $this->tax_query = new WP_Tax_Query( $tax_query ); 1905 1912 1913 /** 1914 * Fires after parse_tax_query() is complete. 1915 * 1916 * @since 3.7.0 1917 * 1918 * @param WP_Query $this The WP_Query instance. 1919 */ 1906 1920 do_action( 'parse_tax_query', $this ); 1907 1921 } 1908 1922 … … 2144 2158 2145 2159 $this->parse_query(); 2146 2160 2147 do_action_ref_array('pre_get_posts', array(&$this)); 2161 /** 2162 * Fires after the query variable object is created, but before the actual query is run. 2163 * 2164 * Note: many of the conditional tags aren't yet available at this point (e.g. is_main_query()). 2165 * 2166 * @since 2.0.0 2167 * 2168 * @param WP_Query &$this The WP_Query instance (passed by reference). 2169 */ 2170 do_action_ref_array( 'pre_get_posts', array( &$this ) ); 2148 2171 2149 2172 // Shorthand. 2150 2173 $q = &$this->query_vars; … … 2774 2797 // Apply filters on where and join prior to paging so that any 2775 2798 // manipulations to them are reflected in the paging by day queries. 2776 2799 if ( !$q['suppress_filters'] ) { 2777 $where = apply_filters_ref_array('posts_where', array( $where, &$this ) ); 2778 $join = apply_filters_ref_array('posts_join', array( $join, &$this ) ); 2800 /** 2801 * Filter the WHERE clause of the query. 2802 * 2803 * @since 1.5.2 2804 * 2805 * @param string $where The WHERE clause of the query. 2806 * @param WP_Query &$this The WP_Query instance (passed by reference). 2807 */ 2808 $where = apply_filters_ref_array( 'posts_where', array( $where, &$this ) ); 2809 2810 /** 2811 * Filter the JOIN clause of the query. 2812 * 2813 * @since 1.5.2 2814 * 2815 * @param string $where The JOIN clause of the query. 2816 * @param WP_Query &$this The WP_Query instance (passed by reference). 2817 */ 2818 $join = apply_filters_ref_array( 'posts_join', array( $join, &$this ) ); 2779 2819 } 2780 2820 2781 2821 // Paging … … 2806 2846 } 2807 2847 2808 2848 if ( !$q['suppress_filters'] ) { 2809 $cjoin = apply_filters_ref_array('comment_feed_join', array( $cjoin, &$this ) ); 2810 $cwhere = apply_filters_ref_array('comment_feed_where', array( $cwhere, &$this ) ); 2811 $cgroupby = apply_filters_ref_array('comment_feed_groupby', array( $cgroupby, &$this ) ); 2812 $corderby = apply_filters_ref_array('comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) ); 2813 $climits = apply_filters_ref_array('comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) ); 2849 /** 2850 * Filter the JOIN clause of the comments feed query before sending. 2851 * 2852 * @since 1.5.2 2853 * 2854 * @param string $cjoin The JOIN clause of the query. 2855 * @param WP_Query &$this The WP_Query instance (passed by reference). 2856 */ 2857 $cjoin = apply_filters_ref_array( 'comment_feed_join', array( $cjoin, &$this ) ); 2858 2859 /** 2860 * Filter the WHERE clause of the comments feed query before sending. 2861 * 2862 * @since 1.5.2 2863 * 2864 * @param string $cwhere The WHERE clause of the query. 2865 * @param WP_Query &$this The WP_Query instance (passed by reference). 2866 */ 2867 $cwhere = apply_filters_ref_array( 'comment_feed_where', array( $cwhere, &$this ) ); 2868 2869 /** 2870 * Filter the GROUP BY clause of the comments feed query before sending. 2871 * 2872 * @since 1.5.2 2873 * 2874 * @param string $cgroupby The GROUP BY clause of the query. 2875 * @param WP_Query &$this The WP_Query instance (passed by reference). 2876 */ 2877 $cgroupby = apply_filters_ref_array( 'comment_feed_groupby', array( $cgroupby, &$this ) ); 2878 2879 /** 2880 * Filter the ORDER BY clause of the comments feed query before sending. 2881 * 2882 * @since 1.5.2 2883 * 2884 * @param string $corderby The ORDER BY clause of the query. 2885 * @param WP_Query &$this The WP_Query instance (passed by reference). 2886 */ 2887 $corderby = apply_filters_ref_array( 'comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) ); 2888 2889 /** 2890 * Filter the LIMIT clause of the comments feed query before sending. 2891 * 2892 * @since 1.5.2 2893 * 2894 * @param string $climits The JOIN clause of the query. 2895 * @param WP_Query &$this The WP_Query instance (passed by reference). 2896 */ 2897 $climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) ); 2814 2898 } 2815 2899 $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : ''; 2816 2900 $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : ''; … … 2833 2917 2834 2918 $pieces = array( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' ); 2835 2919 2836 // Apply post-paging filters on where and join. Only plugins that2837 // manipulate paging queries should use these hooks.2838 2920 if ( !$q['suppress_filters'] ) { 2921 /** 2922 * Filter the WHERE clause of the query. 2923 * 2924 * Specifically for manipulating paging queries. 2925 * 2926 * @since 1.5.2 2927 * 2928 * @param string $where The WHERE clause of the query. 2929 * @param WP_Query &$this The WP_Query instance (passed by reference). 2930 */ 2839 2931 $where = apply_filters_ref_array( 'posts_where_paged', array( $where, &$this ) ); 2932 2933 /** 2934 * Filter the GROUP BY clause of the query. 2935 * 2936 * @since 2.0.0 2937 * 2938 * @param string $groupby The GROUP BY clause of the query. 2939 * @param WP_Query &$this The WP_Query instance (passed by reference). 2940 */ 2840 2941 $groupby = apply_filters_ref_array( 'posts_groupby', array( $groupby, &$this ) ); 2942 2943 /** 2944 * Filter the JOIN clause of the query. 2945 * 2946 * Specifically for manipulating paging queries. 2947 * 2948 * @since 1.5.2 2949 * 2950 * @param string $join The JOIN clause of the query. 2951 * @param WP_Query &$this The WP_Query instance (passed by reference). 2952 */ 2841 2953 $join = apply_filters_ref_array( 'posts_join_paged', array( $join, &$this ) ); 2954 2955 /** 2956 * Filter the ORDER BY clause of the query. 2957 * 2958 * @since 1.5.2 2959 * 2960 * @param string $orderby The ORDER BY clause of the query. 2961 * @param WP_Query &$this The WP_Query instance (passed by reference). 2962 */ 2842 2963 $orderby = apply_filters_ref_array( 'posts_orderby', array( $orderby, &$this ) ); 2964 2965 /** 2966 * Filter the DISTINCT clause of the query. 2967 * 2968 * @since 2.1.0 2969 * 2970 * @param string $distinct The DISTINCT clause of the query. 2971 * @param WP_Query &$this The WP_Query instance (passed by reference). 2972 */ 2843 2973 $distinct = apply_filters_ref_array( 'posts_distinct', array( $distinct, &$this ) ); 2974 2975 /** 2976 * Filter the LIMIT clause of the query. 2977 * 2978 * @since 2.1.0 2979 * 2980 * @param string $limits The LIMIT clause of the query. 2981 * @param WP_Query &$this The WP_Query instance (passed by reference). 2982 */ 2844 2983 $limits = apply_filters_ref_array( 'post_limits', array( $limits, &$this ) ); 2984 2985 /** 2986 * Filter the SELECT clause of the query. 2987 * 2988 * @since 2.1.0 2989 * 2990 * @param string $fields The SELECT clause of the query. 2991 * @param WP_Query &$this The WP_Query instance (passed by reference). 2992 */ 2845 2993 $fields = apply_filters_ref_array( 'posts_fields', array( $fields, &$this ) ); 2846 2994 2847 // Filter all clauses at once, for convenience 2848 $clauses = (array) apply_filters_ref_array( 'posts_clauses', array( compact( $pieces ), &$this ) ); 2995 $clauses = compact( $pieces ); 2996 /** 2997 * Filter all clauses at once, for convenience. 2998 * 2999 * Covers the WHERE, GROUP BY, JOIN, ORDER BY, DISTINCT, 3000 * fields (SELECT), and LIMITS clauses. 3001 * 3002 * @since 3.1.0 3003 * 3004 * @param array $clauses The list of clauses for the query. 3005 * @param WP_Query &$this The WP_Query instance (passed by reference). 3006 */ 3007 $clauses = (array) apply_filters_ref_array( 'posts_clauses', array( $clauses, &$this ) ); 3008 2849 3009 foreach ( $pieces as $piece ) 2850 3010 $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : ''; 2851 3011 } 2852 3012 2853 // Announce current selection parameters. For use by caching plugins. 2854 do_action( 'posts_selection', $where . $groupby . $orderby . $limits . $join ); 3013 $selection = $where . $groupby . $orderby . $limits . $join; 3014 /** 3015 * Fires to announce current selection parameters. 3016 * 3017 * For use by caching plugins. 3018 * 3019 * @since 2.3.0 3020 * 3021 * @param string $selection The assembled selection query. 3022 */ 3023 do_action( 'posts_selection', $selection ); 2855 3024 2856 3025 // Filter again for the benefit of caching plugins. Regular plugins should use the hooks above. 2857 3026 if ( !$q['suppress_filters'] ) { 3027 /** 3028 * Filter the WHERE clause of the query. 3029 * 3030 * For use by caching plugins. 3031 * 3032 * @since 2.5.0 3033 * 3034 * @param string $where The WHERE clause of the query. 3035 * @param WP_Query &$this The WP_Query instance (passed by reference). 3036 */ 2858 3037 $where = apply_filters_ref_array( 'posts_where_request', array( $where, &$this ) ); 3038 3039 /** 3040 * Filter the GROUP BY clause of the query. 3041 * 3042 * For use by caching plugins. 3043 * 3044 * @since 2.5.0 3045 * 3046 * @param string $groupby The GROUP BY clause of the query. 3047 * @param WP_Query &$this The WP_Query instance (passed by reference). 3048 */ 2859 3049 $groupby = apply_filters_ref_array( 'posts_groupby_request', array( $groupby, &$this ) ); 3050 3051 /** 3052 * Filter the JOIN clause of the query. 3053 * 3054 * For use by caching plugins. 3055 * 3056 * @since 2.5.0 3057 * 3058 * @param string $join The JOIN clause of the query. 3059 * @param WP_Query &$this The WP_Query instance (passed by reference). 3060 */ 2860 3061 $join = apply_filters_ref_array( 'posts_join_request', array( $join, &$this ) ); 3062 3063 /** 3064 * Filter the ORDER BY clause of the query. 3065 * 3066 * For use by caching plugins. 3067 * 3068 * @since 2.5.0 3069 * 3070 * @param string $orderby The ORDER BY clause of the query. 3071 * @param WP_Query &$this The WP_Query instance (passed by reference). 3072 */ 2861 3073 $orderby = apply_filters_ref_array( 'posts_orderby_request', array( $orderby, &$this ) ); 3074 3075 /** 3076 * Filter the DISTINCT clause of the query. 3077 * 3078 * For use by caching plugins. 3079 * 3080 * @since 2.5.0 3081 * 3082 * @param string $distinct The DISTINCT clause of the query. 3083 * @param WP_Query &$this The WP_Query instance (passed by reference). 3084 */ 2862 3085 $distinct = apply_filters_ref_array( 'posts_distinct_request', array( $distinct, &$this ) ); 3086 3087 /** 3088 * Filter the SELECT clause of the query. 3089 * 3090 * For use by caching plugins. 3091 * 3092 * @since 2.5.0 3093 * 3094 * @param string $fields The SELECT clause of the query. 3095 * @param WP_Query &$this The WP_Query instance (passed by reference). 3096 */ 2863 3097 $fields = apply_filters_ref_array( 'posts_fields_request', array( $fields, &$this ) ); 3098 3099 /** 3100 * Filter the LIMIT clause of the query. 3101 * 3102 * For use by caching plugins. 3103 * 3104 * @since 2.5.0 3105 * 3106 * @param string $limits The LIMIT clause of the query. 3107 * @param WP_Query &$this The WP_Query instance (passed by reference). 3108 */ 2864 3109 $limits = apply_filters_ref_array( 'post_limits_request', array( $limits, &$this ) ); 2865 3110 2866 // Filter all clauses at once, for convenience 2867 $clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( compact( $pieces ), &$this ) ); 3111 $clauses = compact( $pieces ); 3112 /** 3113 * Filter all clauses at once, for convenience. 3114 * 3115 * For use by caching plugins. 3116 * 3117 * Covers the WHERE, GROUP BY, JOIN, ORDER BY, DISTINCT, 3118 * fields (SELECT), and LIMITS clauses. 3119 * 3120 * @since 3.1.0 3121 * 3122 * @param array $pieces The pieces of the query. 3123 * @param WP_Query &$this The WP_Query instance (passed by reference). 3124 */ 3125 $clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( $clauses, &$this ) ); 2868 3126 foreach ( $pieces as $piece ) 2869 3127 $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : ''; 2870 3128 } … … 2881 3139 $this->request = $old_request = "SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits"; 2882 3140 2883 3141 if ( !$q['suppress_filters'] ) { 2884 $this->request = apply_filters_ref_array( 'posts_request', array( $this->request, &$this ) ); 3142 $request = $this->request; 3143 /** 3144 * Filter the completed SQL query before sending. 3145 * 3146 * @since 2.0.0 3147 * 3148 * @param array $request The complete SQL query. 3149 * @param WP_Query &$this The WP_Query instance (passed by reference). 3150 */ 3151 $this->request = apply_filters_ref_array( 'posts_request', array( $request, &$this ) ); 2885 3152 } 2886 3153 2887 3154 if ( 'ids' == $q['fields'] ) { … … 2905 3172 } 2906 3173 2907 3174 $split_the_query = ( $old_request == $this->request && "$wpdb->posts.*" == $fields && !empty( $limits ) && $q['posts_per_page'] < 500 ); 3175 3176 /** 3177 * Filter the $split_the_query boolean. 3178 * 3179 * Splitting the query will cause it to fetch just the IDs of the found posts 3180 * (and then individually fetch each post by ID), rather than fetching every 3181 * complete row at once. One massive result vs. many small results. 3182 * 3183 * @since 3.4.0 3184 * 3185 * @param bool $split_the_query Whether or not to split the query. 3186 * @param WP_Query $this The WP_Query instance. 3187 */ 2908 3188 $split_the_query = apply_filters( 'split_the_query', $split_the_query, $this ); 2909 3189 2910 3190 if ( $split_the_query ) { … … 2912 3192 2913 3193 $this->request = "SELECT $found_rows $distinct $wpdb->posts.ID FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits"; 2914 3194 2915 $this->request = apply_filters( 'posts_request_ids', $this->request, $this ); 3195 $request = $this->request; 3196 /** 3197 * Filter the Post IDs SQL request before sending. 3198 * 3199 * @since 3.4.0 3200 * 3201 * @param string $request The post ID request. 3202 * @param WP_Query $this The WP_Query instance. 3203 */ 3204 $this->request = apply_filters( 'posts_request_ids', $request, $this ); 2916 3205 2917 3206 $ids = $wpdb->get_col( $this->request ); 2918 3207 … … 2932 3221 if ( $this->posts ) 2933 3222 $this->posts = array_map( 'get_post', $this->posts ); 2934 3223 2935 // Raw results filter. Prior to status checks. 2936 if ( !$q['suppress_filters'] ) 2937 $this->posts = apply_filters_ref_array('posts_results', array( $this->posts, &$this ) ); 3224 if ( !$q['suppress_filters'] ){ 3225 $posts = $this->posts; 3226 /** 3227 * Filter the raw post results array, prior to status checks. 3228 * 3229 * @since 2.3.0 3230 * 3231 * @param array $posts The post results array. 3232 * @param WP_Query &$this The WP_Query instance (passed by reference). 3233 */ 3234 $this->posts = apply_filters_ref_array( 'posts_results', array( $posts, &$this ) ); 3235 } 2938 3236 2939 3237 if ( !empty($this->posts) && $this->is_comment_feed && $this->is_singular ) { 2940 $cjoin = apply_filters_ref_array('comment_feed_join', array( '', &$this ) ); 2941 $cwhere = apply_filters_ref_array('comment_feed_where', array( "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'", &$this ) ); 2942 $cgroupby = apply_filters_ref_array('comment_feed_groupby', array( '', &$this ) ); 3238 // duplicate_hook 3239 $cjoin = apply_filters_ref_array( 'comment_feed_join', array( '', &$this ) ); 3240 3241 // duplicate_hook 3242 $cwhere = apply_filters_ref_array( 'comment_feed_where', array( "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'", &$this ) ); 3243 3244 // duplicate_hook 3245 $cgroupby = apply_filters_ref_array( 'comment_feed_groupby', array( '', &$this ) ); 2943 3246 $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : ''; 2944 $corderby = apply_filters_ref_array('comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) ); 3247 3248 // duplicate_hook 3249 $corderby = apply_filters_ref_array( 'comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) ); 2945 3250 $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : ''; 2946 $climits = apply_filters_ref_array('comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) ); 3251 3252 // duplicate_hook 3253 $climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) ); 3254 2947 3255 $comments_request = "SELECT $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits"; 2948 3256 $this->comments = $wpdb->get_results($comments_request); 2949 3257 $this->comment_count = count($this->comments); … … 2977 3285 } 2978 3286 } 2979 3287 2980 if ( $this->is_preview && $this->posts && current_user_can( $edit_cap, $this->posts[0]->ID ) ) 2981 $this->posts[0] = get_post( apply_filters_ref_array( 'the_preview', array( $this->posts[0], &$this ) ) ); 3288 if ( $this->is_preview && $this->posts && current_user_can( $edit_cap, $this->posts[0]->ID ) ){ 3289 $post_preview = $this->posts[0]; 3290 /** 3291 * Filter the single post for preview mode. 3292 * 3293 * @since 2.7.0 3294 * 3295 * @param WP_Post $post_preview The Post object. 3296 * @param WP_Query &$this The WP_Query instance (passed by reference). 3297 */ 3298 $this->posts[0] = get_post( apply_filters_ref_array( 'the_preview', array( $post_preview, &$this ) ) ); 3299 } 2982 3300 } 2983 3301 2984 3302 // Put sticky posts at the top of the posts array … … 3022 3340 } 3023 3341 } 3024 3342 3025 if ( !$q['suppress_filters'] ) 3026 $this->posts = apply_filters_ref_array('the_posts', array( $this->posts, &$this ) ); 3343 if ( !$q['suppress_filters'] ){ 3344 $posts = $this->posts; 3345 /** 3346 * Filter the array of retreived posts after they've been fetched and 3347 * internally processed. 3348 * 3349 * @since 1.5.2 3350 * 3351 * @param array $posts The array of retrieved posts. 3352 * @param WP_Query &$this The WP_Query instance (passed by reference). 3353 */ 3354 $this->posts = apply_filters_ref_array( 'the_posts', array( $posts, &$this ) ); 3355 } 3027 3356 3028 3357 // Ensure that any posts added/modified via one of the filters above are 3029 3358 // of the type WP_Post and are filtered. … … 3059 3388 if ( $q['no_found_rows'] || ( is_array( $this->posts ) && ! $this->posts ) ) 3060 3389 return; 3061 3390 3062 if ( ! empty( $limits ) ) 3063 $this->found_posts = $wpdb->get_var( apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) ) ); 3064 else 3391 if ( ! empty( $limits ) ){ 3392 $found_posts = 'SELECT FOUND_ROWS()'; 3393 /** 3394 * Filter the query to run for retrieving the found posts. 3395 * 3396 * @since 2.1.0 3397 * 3398 * @param string $found_posts The query to run to find the found posts. 3399 * @param WP_Query &$this The WP_Query instance (passed by reference). 3400 */ 3401 $this->found_posts = $wpdb->get_var( apply_filters_ref_array( 'found_posts_query', array( $found_posts, &$this ) ) ); 3402 } 3403 else{ 3065 3404 $this->found_posts = count( $this->posts ); 3405 } 3066 3406 3067 $this->found_posts = apply_filters_ref_array( 'found_posts', array( $this->found_posts, &$this ) ); 3407 $found_posts = $this->found_posts; 3408 /** 3409 * Filter the number of found posts. 3410 * 3411 * @since 2.1.0 3412 * 3413 * @param int $found_posts The number of posts found. 3414 * @param WP_Query &$this The WP_Query instance (passed by reference). 3415 */ 3416 $this->found_posts = apply_filters_ref_array( 'found_posts', array( $found_posts, &$this ) ); 3068 3417 3069 3418 if ( ! empty( $limits ) ) 3070 3419 $this->max_num_pages = ceil( $this->found_posts / $q['posts_per_page'] ); … … 3102 3451 $this->in_the_loop = true; 3103 3452 3104 3453 if ( $this->current_post == -1 ) // loop has just started 3105 do_action_ref_array('loop_start', array(&$this)); 3454 /** 3455 * Fires once the loop is started. 3456 * 3457 * @since 2.0.0 3458 * 3459 * @param WP_Query &$this The WP_Query instance (passed by reference). 3460 */ 3461 do_action_ref_array( 'loop_start', array( &$this ) ); 3106 3462 3107 3463 $post = $this->next_post(); 3108 3464 setup_postdata($post); … … 3123 3479 if ( $this->current_post + 1 < $this->post_count ) { 3124 3480 return true; 3125 3481 } elseif ( $this->current_post + 1 == $this->post_count && $this->post_count > 0 ) { 3126 do_action_ref_array('loop_end', array(&$this)); 3482 /** 3483 * Fires once the loop has ended. 3484 * 3485 * @since 2.0.0 3486 * 3487 * @param WP_Query &$this The WP_Query instance (passed by reference). 3488 */ 3489 do_action_ref_array( 'loop_end', array( &$this ) ); 3127 3490 // Do some cleaning up after the loop 3128 3491 $this->rewind_posts(); 3129 3492 } … … 3174 3537 $comment = $this->next_comment(); 3175 3538 3176 3539 if ( $this->current_comment == 0 ) { 3177 do_action('comment_loop_start'); 3540 /** 3541 * Fires once the comment loop is started. 3542 * 3543 * @since 2.2.0 3544 */ 3545 do_action( 'comment_loop_start' ); 3178 3546 } 3179 3547 } 3180 3548 … … 3935 4303 $pages = array( $post->post_content ); 3936 4304 } 3937 4305 3938 do_action_ref_array('the_post', array(&$post)); 4306 /** 4307 * Fires once the post data has been setup. 4308 * 4309 * @since 2.8.0 4310 * 4311 * @param WP_Post &$post The Post object (passed by reference). 4312 */ 4313 do_action_ref_array( 'the_post', array( &$post ) ); 3939 4314 3940 4315 return true; 3941 4316 }