WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
39 | * Renders the `core/latest-comments` block on server. |
40 | * |
41 | * @param array $attributes The block attributes. |
42 | * |
43 | * @return string Returns the post content with latest comments added. |
44 | */ |
45 | function gutenberg_render_block_core_latest_comments( $attributes = array() ) { |
46 | // This filter is documented in wp-includes/widgets/class-wp-widget-recent-comments.php. |
47 | $comments = get_comments( |
48 | apply_filters( |
49 | 'widget_comments_args', |
50 | array( |
51 | 'number' => $attributes['commentsToShow'], |
52 | 'status' => 'approve', |
53 | 'post_status' => 'publish', |
54 | ) |
55 | ) |
56 | ); |
57 |
|