Make WordPress Core

Changeset 43950


Ignore:
Timestamp:
11/30/2018 01:23:09 PM (6 years ago)
Author:
youknowriad
Message:

Block Editor: Rename the gutenberg_ functions in blocks/latest-comments.php.

This was ported manually from https://github.com/WordPress/gutenberg/pull/12326

Props pento, swissspidy.
See #45145.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-includes/blocks/latest-comments.php

    r43949 r43950  
    2727     * @return string The post title if set; "(no title)" if no title is set.
    2828     */
    29     function gutenberg_draft_or_post_title( $post = 0 ) {
     29    function wp_latest_comments_draft_or_post_title( $post = 0 ) {
    3030        $title = get_the_title( $post );
    3131        if ( empty( $title ) ) {
     
    4343 * @return string Returns the post content with latest comments added.
    4444 */
    45 function gutenberg_render_block_core_latest_comments( $attributes = array() ) {
     45function render_block_core_latest_comments( $attributes = array() ) {
    4646    // This filter is documented in wp-includes/widgets/class-wp-widget-recent-comments.php.
    4747    $comments = get_comments(
     
    9595            // `_draft_or_post_title` calls `esc_html()` so we don't need to wrap that call in
    9696            // `esc_html`.
    97             $post_title = '<a class="wp-block-latest-comments__comment-link" href="' . esc_url( get_comment_link( $comment ) ) . '">' . gutenberg_draft_or_post_title( $comment->comment_post_ID ) . '</a>';
     97            $post_title = '<a class="wp-block-latest-comments__comment-link" href="' . esc_url( get_comment_link( $comment ) ) . '">' . wp_latest_comments_draft_or_post_title( $comment->comment_post_ID ) . '</a>';
    9898
    9999            $list_items_markup .= sprintf(
     
    180180            ),
    181181        ),
    182         'render_callback' => 'gutenberg_render_block_core_latest_comments',
     182        'render_callback' => 'render_block_core_latest_comments',
    183183    )
    184184);
Note: See TracChangeset for help on using the changeset viewer.