Ticket #25514: WP_Query-hook-docs-rev1.diff
File WP_Query-hook-docs-rev1.diff, 22.4 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 actions to be run after parse_query is complete. 1714 * 1715 * @since 1.5.2 1716 * 1717 * @param array $args { 1718 * The variables passed to the callback. 1719 * 1720 * @type WP_Query &$this The WP_Query object (passed by reference). 1721 * } 1722 */ 1723 do_action_ref_array( 'parse_query', array( &$this ) ); 1713 1724 } 1714 1725 1715 1726 /* … … 1903 1914 1904 1915 $this->tax_query = new WP_Tax_Query( $tax_query ); 1905 1916 1917 /** 1918 * Fires actions to be run after parse_tax_query is complete. 1919 * 1920 * @since 3.7.0 1921 * 1922 * @param WP_Query $this The WP_Query object. 1923 */ 1906 1924 do_action( 'parse_tax_query', $this ); 1907 1925 } 1908 1926 … … 1963 1981 * 1964 1982 * @since 3.0.0 1965 1983 * 1966 * @param string $search Search SQL for WHERE clause. 1967 * @param WP_Query $this The current WP_Query object. 1984 * @param array $args { 1985 * The variables passed to the callback. 1986 * 1987 * @type string $search Search SQL for WHERE clause. 1988 * @type WP_Query $this The current WP_Query object. 1989 * } 1968 1990 */ 1969 1991 return apply_filters_ref_array( 'posts_search', array( $search, &$this ) ); 1970 1992 } … … 2144 2166 2145 2167 $this->parse_query(); 2146 2168 2147 do_action_ref_array('pre_get_posts', array(&$this)); 2169 /** 2170 * Fires actions to run after parse_query and before get_posts actually begins. 2171 * 2172 * @since 2.0.0 2173 * 2174 * @param array $args { 2175 * The variables passed to the callback. 2176 * 2177 * @type WP_Query $this The current WP_Query object. 2178 * } 2179 */ 2180 do_action_ref_array( 'pre_get_posts', array( &$this ) ); 2148 2181 2149 2182 // Shorthand. 2150 2183 $q = &$this->query_vars; … … 2774 2807 // Apply filters on where and join prior to paging so that any 2775 2808 // manipulations to them are reflected in the paging by day queries. 2776 2809 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 ) ); 2810 /** 2811 * Filter the WHERE portion of the posts query before sending. 2812 * 2813 * @since 1.5.2 2814 * 2815 * @param array $args { 2816 * The variables passed to the callback. 2817 * 2818 * @type string $where The WHERE portion of the query. 2819 * @type WP_Query $this The current WP_Query object. 2820 * } 2821 */ 2822 $where = apply_filters_ref_array( 'posts_where', array( $where, &$this ) ); 2823 2824 /** 2825 * Filter the JOIN portion of the posts query before sending. 2826 * 2827 * @since 1.5.2 2828 * 2829 * @param array $args { 2830 * The variables passed to the callback. 2831 * 2832 * @type $join $where The JOIN portion of the query. 2833 * @type WP_Query $this The current WP_Query object. 2834 * } 2835 */ 2836 $join = apply_filters_ref_array( 'posts_join', array( $join, &$this ) ); 2779 2837 } 2780 2838 2781 2839 // Paging … … 2806 2864 } 2807 2865 2808 2866 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 ) ); 2867 /** 2868 * Filter the JOIN portion of the comments feed query before sending. 2869 * 2870 * @since 1.5.2 2871 * 2872 * @param array $args { 2873 * The variables passed to the callback. 2874 * 2875 * @type string $cjoin The JOIN portion of the query. 2876 * @type WP_Query &$this The WP_Query object (passed by refrence). 2877 * } 2878 */ 2879 $cjoin = apply_filters_ref_array( 'comment_feed_join', array( $cjoin, &$this ) ); 2880 2881 /** 2882 * Filter the WHERE portion of the comments feed query before sending. 2883 * 2884 * @since 1.5.2 2885 * 2886 * @param array $args { 2887 * The variables passed to the callback. 2888 * 2889 * @type string $cwhere The WHERE portion of the query. 2890 * @type WP_Query &$this The WP_Query object (passed by refrence). 2891 * } 2892 */ 2893 */ 2894 $cwhere = apply_filters_ref_array( 'comment_feed_where', array( $cwhere, &$this ) ); 2895 2896 /** 2897 * Filter the GROUP BY portion of the comments feed query before sending. 2898 * 2899 * @since 1.5.2 2900 * 2901 * @param array $args { 2902 * The variables passed to the callback. 2903 * 2904 * @type string $cgroupby The GROUP BY portion of the query. 2905 * @type WP_Query &$this The WP_Query object (passed by refrence). 2906 * } 2907 */ 2908 $cgroupby = apply_filters_ref_array( 'comment_feed_groupby', array( $cgroupby, &$this ) ); 2909 2910 /** 2911 * Filter the ORDER BY portion of the comments feed query before sending. 2912 * 2913 * @since 1.5.2 2914 * 2915 * @param array $args { 2916 * The variables passed to the callback. 2917 * 2918 * @type string $corderby The ORDER BY portion of the query. 2919 * @type WP_Query &$this The WP_Query object (passed by refrence). 2920 * } 2921 */ 2922 $corderby = apply_filters_ref_array( 'comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) ); 2923 2924 /** 2925 * Filter the LIMIT portion of the comments feed query before sending. 2926 * 2927 * @since 1.5.2 2928 * 2929 * @param array $args { 2930 * The variables passed to the callback. 2931 * 2932 * @type string $climits The JOIN portion of the query. 2933 * @type WP_Query &$this The WP_Query object (passed by refrence). 2934 * } 2935 */ 2936 $climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) ); 2814 2937 } 2815 2938 $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : ''; 2816 2939 $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : ''; … … 2836 2959 // Apply post-paging filters on where and join. Only plugins that 2837 2960 // manipulate paging queries should use these hooks. 2838 2961 if ( !$q['suppress_filters'] ) { 2962 /** 2963 * Filter the WHERE portion of the posts query before sending. 2964 * 2965 * @since 1.5.2 2966 * 2967 * @param array $args { 2968 * The variables passed to the callback. 2969 * 2970 * @type string $where The WHERE portion of the query. 2971 * @type WP_Query &$this The WP_Query object (passed by refrence). 2972 * } 2973 */ 2839 2974 $where = apply_filters_ref_array( 'posts_where_paged', array( $where, &$this ) ); 2975 2976 /** 2977 * Filter the GROUP BY portion of the posts query before sending. 2978 * 2979 * @since 2.0.0 2980 * 2981 * @param array $args { 2982 * The variables passed to the callback. 2983 * 2984 * @type string $groupby The GROUP BY portion of the query. 2985 * @type WP_Query &$this The WP_Query object (passed by refrence). 2986 * } 2987 */ 2840 2988 $groupby = apply_filters_ref_array( 'posts_groupby', array( $groupby, &$this ) ); 2989 2990 /** 2991 * Filter the JOIN portion of the posts query before sending. 2992 * 2993 * @since 1.5.2 2994 * 2995 * @param array $args { 2996 * The variables passed to the callback. 2997 * 2998 * @type string $join The JOIN portion of the query. 2999 * @type WP_Query &$this The WP_Query object (passed by refrence). 3000 * } 3001 */ 2841 3002 $join = apply_filters_ref_array( 'posts_join_paged', array( $join, &$this ) ); 3003 3004 /** 3005 * Filter the ORDER BY portion of the posts query before sending. 3006 * 3007 * @since 1.5.2 3008 * 3009 * @param array $args { 3010 * The variables passed to the callback. 3011 * 3012 * @type string $orderby The ORDER BY portion of the query. 3013 * @type WP_Query &$this The WP_Query object (passed by refrence). 3014 * } 3015 */ 2842 3016 $orderby = apply_filters_ref_array( 'posts_orderby', array( $orderby, &$this ) ); 3017 3018 /** 3019 * Filter the DISTINCT portion of the posts query before sending. 3020 * 3021 * @since 2.1.0 3022 * 3023 * @param array $args { 3024 * The variables passed to the callback. 3025 * 3026 * @type string $distinct The DISTINCT portion of the query. 3027 * @type WP_Query &$this The WP_Query object (passed by refrence). 3028 * } 3029 */ 2843 3030 $distinct = apply_filters_ref_array( 'posts_distinct', array( $distinct, &$this ) ); 3031 3032 /** 3033 * Filter the LIMIT portion of the posts query before sending. 3034 * 3035 * @since 2.1.0 3036 * 3037 * @param array $args { 3038 * The variables passed to the callback. 3039 * 3040 * @type string $limits The LIMIT portion of the query. 3041 * @type WP_Query &$this The WP_Query object (passed by refrence). 3042 * } 3043 */ 2844 3044 $limits = apply_filters_ref_array( 'post_limits', array( $limits, &$this ) ); 3045 3046 /** 3047 * Filter the SELECT portion of the posts query before sending. 3048 * 3049 * @since 2.1.0 3050 * 3051 * @param array $args { 3052 * The variables passed to the callback. 3053 * 3054 * @type string $fields The SELECT portion of the query. 3055 * @type WP_Query &$this The WP_Query object (passed by refrence). 3056 * } 3057 */ 2845 3058 $fields = apply_filters_ref_array( 'posts_fields', array( $fields, &$this ) ); 2846 3059 2847 // Filter all clauses at once, for convenience 3060 /** 3061 * Filter all clauses at once, for convenience. 3062 * 3063 * @since 3.1.0 3064 * 3065 * @param array $args { 3066 * The variables passed to the callback. 3067 * 3068 * @type string $pieces The pieces of the query. 3069 * @type WP_Query &$this The WP_Query object (passed by refrence). 3070 * } 3071 */ 2848 3072 $clauses = (array) apply_filters_ref_array( 'posts_clauses', array( compact( $pieces ), &$this ) ); 3073 2849 3074 foreach ( $pieces as $piece ) 2850 3075 $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : ''; 2851 3076 } 2852 3077 2853 3078 // Announce current selection parameters. For use by caching plugins. 3079 /** 3080 * Fires actions to be run once post selection preperation has been completed. 3081 * 3082 * Largely for use by caching plugins. 3083 * 3084 * @since 2.3.0 3085 * 3086 * @param array $args { 3087 * The variables passed to the callback. 3088 * 3089 * @type string $selection The assembled selection query. 3090 * @type WP_Query &$this The WP_Query object (passed by refrence). 3091 * } 3092 */ 2854 3093 do_action( 'posts_selection', $where . $groupby . $orderby . $limits . $join ); 2855 3094 2856 3095 // Filter again for the benefit of caching plugins. Regular plugins should use the hooks above. 2857 3096 if ( !$q['suppress_filters'] ) { 3097 /** 3098 * Filter the WHERE portion of the posts query before sending. 3099 * 3100 * @since 2.5.0 3101 * 3102 * @param array $args { 3103 * The variables passed to the callback. 3104 * 3105 * @type string $where The WHERE portion of the query. 3106 * @type WP_Query &$this The WP_Query object (passed by refrence). 3107 * } 3108 */ 2858 3109 $where = apply_filters_ref_array( 'posts_where_request', array( $where, &$this ) ); 3110 3111 /** 3112 * Filter the GROUP BY portion of the posts query before sending. 3113 * 3114 * @since 2.5.0 3115 * 3116 * @param array $args { 3117 * The variables passed to the callback. 3118 * 3119 * @type string $groupby The GROUP BY portion of the query. 3120 * @type WP_Query &$this The WP_Query object (passed by refrence). 3121 * } 3122 */ 2859 3123 $groupby = apply_filters_ref_array( 'posts_groupby_request', array( $groupby, &$this ) ); 3124 3125 /** 3126 * Filter the JOIN portion of the posts query before sending. 3127 * 3128 * @since 2.5.0 3129 * 3130 * @param array $args { 3131 * The variables passed to the callback. 3132 * 3133 * @type string $join The JOIN portion of the query. 3134 * @type WP_Query &$this The WP_Query object (passed by refrence). 3135 * } 3136 */ 2860 3137 $join = apply_filters_ref_array( 'posts_join_request', array( $join, &$this ) ); 3138 3139 /** 3140 * Filter the ORDER BY portion of the posts query before sending. 3141 * 3142 * @since 2.5.0 3143 * 3144 * @param array $args { 3145 * The variables passed to the callback. 3146 * 3147 * @type string $orderby The ORDER BY portion of the query. 3148 * @type WP_Query &$this The WP_Query object (passed by refrence). 3149 * } 3150 */ 2861 3151 $orderby = apply_filters_ref_array( 'posts_orderby_request', array( $orderby, &$this ) ); 3152 3153 /** 3154 * Filter the DISTINCT portion of the posts query before sending. 3155 * 3156 * @since 2.5.0 3157 * 3158 * @param array $args { 3159 * The variables passed to the callback. 3160 * 3161 * @type string $distinct The DISTINCT portion of the query. 3162 * @type WP_Query &$this The WP_Query object (passed by refrence). 3163 * } 3164 */ 2862 3165 $distinct = apply_filters_ref_array( 'posts_distinct_request', array( $distinct, &$this ) ); 3166 3167 /** 3168 * Filter the SELECT portion of the posts query before sending. 3169 * 3170 * @since 2.5.0 3171 * 3172 * @param array $args { 3173 * The variables passed to the callback. 3174 * 3175 * @type string $fields The SELECT portion of the query. 3176 * @type WP_Query &$this The WP_Query object (passed by refrence). 3177 * } 3178 */ 2863 3179 $fields = apply_filters_ref_array( 'posts_fields_request', array( $fields, &$this ) ); 3180 3181 /** 3182 * Filter the LIMIT portion of the posts query before sending. 3183 * 3184 * @since 2.5.0 3185 * 3186 * @param array $args { 3187 * The variables passed to the callback. 3188 * 3189 * @type string $limits The LIMIT portion of the query. 3190 * @type WP_Query &$this The WP_Query object (passed by refrence). 3191 * } 3192 */ 2864 3193 $limits = apply_filters_ref_array( 'post_limits_request', array( $limits, &$this ) ); 2865 3194 2866 // Filter all clauses at once, for convenience 3195 /** 3196 * Filter all clauses at once, for convenience. 3197 * 3198 * @since 3.1.0 3199 * 3200 * @param array $args { 3201 * The variables passed to the callback. 3202 * 3203 * @type string $pieces The pieces of the query. 3204 * @type WP_Query &$this The WP_Query object (passed by refrence). 3205 * } 3206 */ 2867 3207 $clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( compact( $pieces ), &$this ) ); 2868 3208 foreach ( $pieces as $piece ) 2869 3209 $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : ''; … … 2881 3221 $this->request = $old_request = "SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits"; 2882 3222 2883 3223 if ( !$q['suppress_filters'] ) { 3224 /** 3225 * Filter the completed SQL query before sending. 3226 * 3227 * @since 2.0.0 3228 * 3229 * @param array $args { 3230 * The variables passed to the callback. 3231 * 3232 * @type string $request The complete SQL query. 3233 * @type WP_Query &$this The WP_Query object (passed by refrence). 3234 * } 3235 */ 2884 3236 $this->request = apply_filters_ref_array( 'posts_request', array( $this->request, &$this ) ); 2885 3237 } 2886 3238 … … 2905 3257 } 2906 3258 2907 3259 $split_the_query = ( $old_request == $this->request && "$wpdb->posts.*" == $fields && !empty( $limits ) && $q['posts_per_page'] < 500 ); 3260 3261 /** 3262 * Filter the $split_the_query boolean. 3263 * 3264 * @since 3.4.0 3265 * 3266 * @param array $args { 3267 * The variables passed to the callback. 3268 * 3269 * @type string $split_the_query Whether or not to split the query. 3270 * @type WP_Query $this The WP_Query object. 3271 * } 3272 */ 2908 3273 $split_the_query = apply_filters( 'split_the_query', $split_the_query, $this ); 2909 3274 2910 3275 if ( $split_the_query ) { … … 2912 3277 2913 3278 $this->request = "SELECT $found_rows $distinct $wpdb->posts.ID FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits"; 2914 3279 3280 /** 3281 * Filter the Post ID request before sending. 3282 * 3283 * @since 3.4.0 3284 * 3285 * @param array $args { 3286 * The variables passed to the callback. 3287 * 3288 * @type string $request The post ID request. 3289 * @type WP_Query $this The WP_Query object. 3290 * } 3291 */ 2915 3292 $this->request = apply_filters( 'posts_request_ids', $this->request, $this ); 2916 3293 2917 3294 $ids = $wpdb->get_col( $this->request ); … … 2932 3309 if ( $this->posts ) 2933 3310 $this->posts = array_map( 'get_post', $this->posts ); 2934 3311 2935 // Raw results filter. Prior to status checks.2936 3312 if ( !$q['suppress_filters'] ) 2937 $this->posts = apply_filters_ref_array('posts_results', array( $this->posts, &$this ) ); 3313 /** 3314 * Filter the raw post results array, prior to status checks. 3315 * 3316 * @since 2.3.0 3317 * 3318 * @param array $args { 3319 * The variables passed to the callback. 3320 * 3321 * @type string $posts The post results array. 3322 * @type WP_Query &$this The WP_Query object (passed by reference). 3323 * } 3324 */ 3325 $this->posts = apply_filters_ref_array( 'posts_results', array( $this->posts, &$this ) ); 2938 3326 2939 3327 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 ) ); 3328 // duplicate_hook 3329 $cjoin = apply_filters_ref_array( 'comment_feed_join', array( '', &$this ) ); 3330 3331 // duplicate_hook 3332 $cwhere = apply_filters_ref_array( 'comment_feed_where', array( "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'", &$this ) ); 3333 3334 // duplicate_hook 3335 $cgroupby = apply_filters_ref_array( 'comment_feed_groupby', array( '', &$this ) ); 2943 3336 $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : ''; 2944 $corderby = apply_filters_ref_array('comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) ); 3337 3338 // duplicate_hook 3339 $corderby = apply_filters_ref_array( 'comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) ); 2945 3340 $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : ''; 2946 $climits = apply_filters_ref_array('comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) ); 3341 3342 // duplicate_hook 3343 $climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) ); 3344 2947 3345 $comments_request = "SELECT $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits"; 2948 3346 $this->comments = $wpdb->get_results($comments_request); 2949 3347 $this->comment_count = count($this->comments); … … 2978 3376 } 2979 3377 2980 3378 if ( $this->is_preview && $this->posts && current_user_can( $edit_cap, $this->posts[0]->ID ) ) 3379 /** 3380 * Filter the single post for preview mode. 3381 * 3382 * @since 2.7.0 3383 * 3384 * @param array $args { 3385 * The variables passed to the callback. 3386 * 3387 * @type string $post The Post object. 3388 * @type WP_Query &$this The WP_Query object (passed by reference). 3389 * } 3390 */ 2981 3391 $this->posts[0] = get_post( apply_filters_ref_array( 'the_preview', array( $this->posts[0], &$this ) ) ); 2982 3392 } 2983 3393 … … 3023 3433 } 3024 3434 3025 3435 if ( !$q['suppress_filters'] ) 3026 $this->posts = apply_filters_ref_array('the_posts', array( $this->posts, &$this ) ); 3436 /** 3437 * Filter the array of retreived posts after they've been fetched and 3438 * internally processed. 3439 * 3440 * @since 1.5.2 3441 * 3442 * @param array $args { 3443 * The variables passed to the callback. 3444 * 3445 * @type string $posts The array of retrieved posts. 3446 * @type WP_Query &$this The WP_Query object (passed by reference). 3447 * } 3448 */ 3449 $this->posts = apply_filters_ref_array( 'the_posts', array( $this->posts, &$this ) ); 3027 3450 3028 3451 // Ensure that any posts added/modified via one of the filters above are 3029 3452 // of the type WP_Post and are filtered. … … 3060 3483 return; 3061 3484 3062 3485 if ( ! empty( $limits ) ) 3486 /** 3487 * Filter the query to run for retrieving the found posts. 3488 * 3489 * @since 2.1.0 3490 * 3491 * @param array $args { 3492 * The variables passed to the callback. 3493 * 3494 * @type string $query The query to run to find the found posts. 3495 * @type WP_Query &$this The WP_Query object (passed by reference). 3496 * } 3497 */ 3063 3498 $this->found_posts = $wpdb->get_var( apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) ) ); 3064 3499 else 3065 3500 $this->found_posts = count( $this->posts ); 3066 3501 3502 /** 3503 * Filter the number of found posts. 3504 * 3505 * @since 2.1.0 3506 * 3507 * @param array $args { 3508 * The variables passed to the callback. 3509 * 3510 * @type string $found_posts The number of posts found. 3511 * @type WP_Query &$this The WP_Query object (passed by reference). 3512 * } 3513 */ 3067 3514 $this->found_posts = apply_filters_ref_array( 'found_posts', array( $this->found_posts, &$this ) ); 3068 3515 3069 3516 if ( ! empty( $limits ) ) … … 3102 3549 $this->in_the_loop = true; 3103 3550 3104 3551 if ( $this->current_post == -1 ) // loop has just started 3105 do_action_ref_array('loop_start', array(&$this)); 3552 /** 3553 * Fires actions to be run once the loop is started. 3554 * 3555 * @since 2.0.0 3556 * 3557 * @param array $args { 3558 * The variables passed to the callback. 3559 * 3560 * @type WP_Query &$this The WP_Query object (passed by reference). 3561 * } 3562 */ 3563 do_action_ref_array( 'loop_start', array( &$this ) ); 3106 3564 3107 3565 $post = $this->next_post(); 3108 3566 setup_postdata($post); … … 3123 3581 if ( $this->current_post + 1 < $this->post_count ) { 3124 3582 return true; 3125 3583 } elseif ( $this->current_post + 1 == $this->post_count && $this->post_count > 0 ) { 3126 do_action_ref_array('loop_end', array(&$this)); 3584 /** 3585 * Fires actions to be run once the loop has ended. 3586 * 3587 * @since 2.0.0 3588 * 3589 * @param array $args { 3590 * The variables passed to the callback. 3591 * 3592 * @type WP_Query &$this The WP_Query object (passed by reference). 3593 * } 3594 */ 3595 do_action_ref_array( 'loop_end', array( &$this ) ); 3127 3596 // Do some cleaning up after the loop 3128 3597 $this->rewind_posts(); 3129 3598 } … … 3174 3643 $comment = $this->next_comment(); 3175 3644 3176 3645 if ( $this->current_comment == 0 ) { 3177 do_action('comment_loop_start'); 3646 /** 3647 * Fires actions to be run once the comment loop is started. 3648 * 3649 * @since 2.2.0 3650 */ 3651 do_action( 'comment_loop_start' ); 3178 3652 } 3179 3653 } 3180 3654 … … 3935 4409 $pages = array( $post->post_content ); 3936 4410 } 3937 4411 3938 do_action_ref_array('the_post', array(&$post)); 4412 /** 4413 * Fires actions to be run once the post data has been setup. 4414 * 4415 * @since 2.8.0 4416 * 4417 * @param array $args { 4418 * The variables passed to the callback. 4419 * 4420 * @type WP_Post &$post The Post object (passed by reference). 4421 * } 4422 */ 4423 do_action_ref_array( 'the_post', array( &$post ) ); 3939 4424 3940 4425 return true; 3941 4426 }