Make WordPress Core

Ticket #25552: 25552.diff

File 25552.diff, 4.9 KB (added by DrewAPicture, 12 years ago)

First pass

  • src/wp-includes/date.php

     
    7474        public $compare = '=';
    7575
    7676        /**
    77          * Constructor
     77         * Constructor.
    7878         *
    79          * @param array $date_query A date query parameter array, see class descriptor for further details.
    80          * @param array (optional) $default_column What column name to query against. Defaults to "post_date".
     79         * @param array $date_query {
     80         *     One or more associative arrays of date query parameters.
     81         *
     82         *     @type array {
     83         *         @type string 'column'   Optional. The column to query against.
     84         *                                 Default 'post_date'. Accepts 'post_date', 'post_date_gmt', 'post_modified',
     85         *                                 'post_modified_gmt', 'comment_date', 'comment_date_gmt'.
     86         *         @type string 'compare'  Optional. The comparison operator.
     87         *                                 Default '='. Accepts '=', '!=', '>', '>=', '<', '<=', 'IN', 'NOT IN',
     88         *                                 'BETWEEN', 'NOT BETWEEN'.
     89         *         @type string 'relation' Optional. The boolean relationship between the date queryies.
     90         *                                 Default 'OR'. Accepts 'OR', 'AND'.
     91         *         @type array {
     92         *             @type string|array 'before' {
     93         *                 Optional. Date to retrieve posts before.
     94         *                 Accepts strtotime()-compatible string, or array of 'year', 'month', 'day' values.
     95         *
     96         *                 @type string 'year'  The four-digit year.
     97         *                                      Default empty. Accepts any four-digit year.
     98         *                 @type string 'month' The month of the year.
     99         *                                      Default empty. Accepts numbers 1-12.
     100         *                 @type string 'day'   The day of the month.
     101         *                                      Default empty. Accepts numbers 1-31.
     102         *             }
     103         *             @type string|array 'after' {
     104         *                 Optional. Date to retrieve posts after.
     105         *                 Accepts strtotime()-compatible string, or array of 'year', 'month', 'day' values.
     106         *
     107         *                 @type string 'year'  The four-digit year.
     108         *                                      Default empty. Accepts any four-digit year.
     109         *                 @type string 'month' The month of the year.
     110         *                                      Default empty. Accepts numbers 1-12.
     111         *                 @type string 'day'   The day of the month.
     112         *                                      Default empty. Accepts numbers 1-31.
     113         *             }
     114         *             @type string       'column'    Optional. The column to query against.
     115         *                                            Default 'post_date'. Accepts 'post_date', 'post_date_gmt', 'post_modified',
     116         *                                            'post_modified_gmt', 'comment_date', 'comment_date_gmt'.
     117         *             @type string       'compare'   Optional. The comparison operator.
     118         *                                            Default '='. Accepts '=', '!=', '>', '>=', '<', '<=', 'IN', 'NOT IN',
     119         *                                            'BETWEEN', 'NOT BETWEEN'.
     120         *             @type bool         'inclusive' Optional. Whether the exact difference between the 'before' and 'after' dates should be matched or not.
     121         *                                            Default. Accepts.
     122         *             @type int          'year'      Optional. The four-digit near number.
     123         *                                            Default empty. Accepts any four-digit year.
     124         *             @type int          'month'     Optional. The two-digit month number.
     125         *                                            Default empty. Accepts numbers 1-12.
     126         *             @type int          'week'      Optional. The week number of the year.
     127         *                                            Default empty. Accepts numbers 0-53.
     128         *             @type int          'day'       Optional. The day of the month.
     129         *                                            Default empty. Accepts numbers 1-31.
     130         *             @type int          'hour'      Optional. The hour of the day.
     131         *                                            Default empty. Accepts numbers 0-23.
     132         *             @type int          'minute'    Optional. The minute of the hour.
     133         *                                            Default empty. Accepts numbers 0-60.
     134         *             @type int          'second'    Optional. The second of the minute.
     135         *                                            Default empty. Accepts numbers 0-60.
     136         *         }
     137         *     }
     138         * }
     139         * @param array $default_column Optional. What column name to query against.
     140         *                              Defaults 'post_date'. Accepts.
    81141         */
    82142        function __construct( $date_query, $default_column = 'post_date' ) {
    83143                if ( empty( $date_query ) || ! is_array( $date_query ) )