Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: the_excerpt

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
1552           if ( rest_is_field_included( 'content.protected', $fields ) ) {
1553                $data['content']['protected'] = (bool) $post->post_password;
1554           }
1555           if ( rest_is_field_included( 'content.block_version', $fields ) ) {
1556                $data['content']['block_version'] = block_version( $post->post_content );
1557           }
1558
1559           if ( rest_is_field_included( 'excerpt', $fields ) ) {
1560                /** This filter is documented in wp-includes/post-template.php */
1561                $excerpt         = apply_filters( 'the_excerpt', apply_filters( 'get_the_excerpt', $post->post_excerpt, $post ) );
1562                $data['excerpt'] = array(
1563                     'raw'       => $post->post_excerpt,
1564                     'rendered'  => post_password_required( $post ) ? '' : $excerpt,
1565                     'protected' => (bool) $post->post_password,
1566                );
1567           }
1568
1569           if ( $has_password_filter ) {
1570                // Reset filter.