action

jetpack_widget_top_posts_before_post

Fires before each Top Post result, inside .

Parameters

$post
string

['post_id'] Post ID.

Changelog

How to use this hook

See “How to use actions and filters to customize Jetpack”.

Notes

You can use this action to add data before each post in the widget. In the example below, we’ll insert the post date above each post:
function jetpackme_add_date_top_posts( $post_id ) {
        $post_date = get_post_time(
                get_option( 'date_format' ),
                true,
                $post_id,
                true
        );
        printf( '<div class="top_posts_date">%s</div>', $post_date );
}
add_action( 'jetpack_widget_top_posts_before_post', 'jetpackme_add_date_top_posts' );