Changeset 27206 for trunk/src/wp-includes/query.php
- Timestamp:
- 02/20/2014 05:33:16 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/query.php
r27067 r27206 2760 2760 if ( ! empty( $where_status ) ) { 2761 2761 $where .= " AND ($where_status)"; 2762 } 2762 } 2763 2763 } elseif ( !$this->is_singular ) { 2764 2764 $where .= " AND ($wpdb->posts.post_status = 'publish'"; … … 2795 2795 } 2796 2796 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. 2797 /* 2798 * Apply filters on where and join prior to paging so that any 2799 * manipulations to them are reflected in the paging by day queries. 2800 */ 2799 2801 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 ) ); 2802 /** 2803 * Filter the WHERE clause of the query. 2804 * 2805 * @since 1.5.0 2806 * 2807 * @param string $where The WHERE clause of the query. 2808 * @param WP_Query &$this The WP_Query instance (passed by reference). 2809 */ 2810 $where = apply_filters_ref_array( 'posts_where', array( $where, &$this ) ); 2811 2812 /** 2813 * Filter the JOIN clause of the query. 2814 * 2815 * @since 1.5.0 2816 * 2817 * @param string $where The JOIN clause of the query. 2818 * @param WP_Query &$this The WP_Query instance (passed by reference). 2819 */ 2820 $join = apply_filters_ref_array( 'posts_join', array( $join, &$this ) ); 2802 2821 } 2803 2822 … … 2857 2876 $pieces = array( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' ); 2858 2877 2859 // Apply post-paging filters on where and join. Only plugins that 2860 // manipulate paging queries should use these hooks. 2878 /* 2879 * Apply post-paging filters on where and join. Only plugins that 2880 * manipulate paging queries should use these hooks. 2881 */ 2861 2882 if ( !$q['suppress_filters'] ) { 2883 /** 2884 * Filter the WHERE clause of the query. 2885 * 2886 * Specifically for manipulating paging queries. 2887 * 2888 * @since 1.5.0 2889 * 2890 * @param string $where The WHERE clause of the query. 2891 * @param WP_Query &$this The WP_Query instance (passed by reference). 2892 */ 2862 2893 $where = apply_filters_ref_array( 'posts_where_paged', array( $where, &$this ) ); 2894 2895 /** 2896 * Filter the GROUP BY clause of the query. 2897 * 2898 * @since 2.0.0 2899 * 2900 * @param string $groupby The GROUP BY clause of the query. 2901 * @param WP_Query &$this The WP_Query instance (passed by reference). 2902 */ 2863 2903 $groupby = apply_filters_ref_array( 'posts_groupby', array( $groupby, &$this ) ); 2904 2905 /** 2906 * Filter the JOIN clause of the query. 2907 * 2908 * Specifically for manipulating paging queries. 2909 * 2910 * @since 1.5.0 2911 * 2912 * @param string $join The JOIN clause of the query. 2913 * @param WP_Query &$this The WP_Query instance (passed by reference). 2914 */ 2864 2915 $join = apply_filters_ref_array( 'posts_join_paged', array( $join, &$this ) ); 2916 2917 /** 2918 * Filter the ORDER BY clause of the query. 2919 * 2920 * @since 1.5.1 2921 * 2922 * @param string $orderby The ORDER BY clause of the query. 2923 * @param WP_Query &$this The WP_Query instance (passed by reference). 2924 */ 2865 2925 $orderby = apply_filters_ref_array( 'posts_orderby', array( $orderby, &$this ) ); 2926 2927 /** 2928 * Filter the DISTINCT clause of the query. 2929 * 2930 * @since 2.1.0 2931 * 2932 * @param string $distinct The DISTINCT clause of the query. 2933 * @param WP_Query &$this The WP_Query instance (passed by reference). 2934 */ 2866 2935 $distinct = apply_filters_ref_array( 'posts_distinct', array( $distinct, &$this ) ); 2936 2937 /** 2938 * Filter the LIMIT clause of the query. 2939 * 2940 * @since 2.1.0 2941 * 2942 * @param string $limits The LIMIT clause of the query. 2943 * @param WP_Query &$this The WP_Query instance (passed by reference). 2944 */ 2867 2945 $limits = apply_filters_ref_array( 'post_limits', array( $limits, &$this ) ); 2946 2947 /** 2948 * Filter the SELECT clause of the query. 2949 * 2950 * @since 2.1.0 2951 * 2952 * @param string $fields The SELECT clause of the query. 2953 * @param WP_Query &$this The WP_Query instance (passed by reference). 2954 */ 2868 2955 $fields = apply_filters_ref_array( 'posts_fields', array( $fields, &$this ) ); 2869 2956 2870 // Filter all clauses at once, for convenience 2957 /** 2958 * Filter all query clauses at once, for convenience. 2959 * 2960 * Covers the WHERE, GROUP BY, JOIN, ORDER BY, DISTINCT, 2961 * fields (SELECT), and LIMITS clauses. 2962 * 2963 * @since 3.1.0 2964 * 2965 * @param array $clauses The list of clauses for the query. 2966 * @param WP_Query &$this The WP_Query instance (passed by reference). 2967 */ 2871 2968 $clauses = (array) apply_filters_ref_array( 'posts_clauses', array( compact( $pieces ), &$this ) ); 2872 foreach ( $pieces as $piece ) 2969 2970 foreach ( $pieces as $piece ) { 2873 2971 $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : ''; 2972 } 2874 2973 } 2875 2974
Note: See TracChangeset
for help on using the changeset viewer.