Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: rest_revision_query

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
236                     }
237                }
238
239                // For backward-compatibility, 'date' needs to resolve to 'date ID'.
240                if ( isset( $args['orderby'] ) && 'date' === $args['orderby'] ) {
241                     $args['orderby'] = 'date ID';
242                }
243
244                /** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */
245                $args       = apply_filters( 'rest_revision_query', $args, $request );
246                $query_args = $this->prepare_items_query( $args, $request );
247
248                $revisions_query = new WP_Query();
249                $revisions       = $revisions_query->query( $query_args );
250                $offset          = isset( $query_args['offset'] ) ? (int) $query_args['offset'] : 0;
251                $page            = (int) $query_args['paged'];
252                $total_revisions = $revisions_query->found_posts;
253
254                if ( $total_revisions < 1 ) {