get_the_title example

 else {
    $admin_title = get_bloginfo( 'name' );
}

if ( $admin_title === $title ) {
    /* translators: Admin screen title. %s: Admin screen name. */
    $admin_title = sprintf( __( '%s — WordPress' )$title );
} else {
    $screen_title = $title;

    if ( 'post' === $current_screen->base && 'add' !== $current_screen->action ) {
        $post_title = get_the_title();
        if ( ! empty( $post_title ) ) {
            $post_type_obj = get_post_type_object( $typenow );
            $screen_title  = sprintf(
                /* translators: Editor admin screen title. 1: "Edit item" text for the post type, 2: Post title. */
                __( '%1$s “%2$s”' ),
                $post_type_obj->labels->edit_item,
                $post_title
            );
        }
    }

    
if ( post_password_required() ) {
        return;
    }

    $align_class_name    = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}";
    $show_post_title     = ! empty( $attributes['showPostTitle'] ) && $attributes['showPostTitle'];
    $show_comments_count = ! empty( $attributes['showCommentsCount'] ) && $attributes['showCommentsCount'];
    $wrapper_attributes  = get_block_wrapper_attributes( array( 'class' => $align_class_name ) );
    $comments_count      = get_comments_number();
    /* translators: %s: Post title. */
    $post_title = sprintf( __( '“%s”' )get_the_title() );
    $tag_name   = 'h2';
    if ( isset( $attributes['level'] ) ) {
        $tag_name = 'h' . $attributes['level'];
    }

    if ( '0' === $comments_count ) {
        return;
    }

    if ( $show_comments_count ) {
        if ( $show_post_title ) {
            
if ( 'markup' === $response_format ) {
                    echo walk_nav_menu_tree(
                        array_map( 'wp_setup_nav_menu_item', array( get_post( $object_id ) ) ),
                        0,
                        (object) $args
                    );
                } elseif ( 'json' === $response_format ) {
                    echo wp_json_encode(
                        array(
                            'ID'         => $object_id,
                            'post_title' => get_the_title( $object_id ),
                            'post_type'  => get_post_type( $object_id ),
                        )
                    );
                    echo "\n";
                }
            }
        } elseif ( taxonomy_exists( $object_type ) ) {
            if ( isset( $request['ID'] ) ) {
                $object_id = (int) $request['ID'];

                if ( 'markup' === $response_format ) {
                    
echo '<p><a href="' . esc_url( get_permalink() ) . '">' . twenty_twenty_one_continue_reading_text() . '</a></p>'; // phpcs:ignore WordPress.Security.EscapeOutput             }

            // Posted on.             twenty_twenty_one_posted_on();

            // Edit post link.             edit_post_link(
                sprintf(
                    /* translators: %s: Post title. Only visible to screen readers. */
                    esc_html__( 'Edit %s', 'twentytwentyone' ),
                    '<span class="screen-reader-text">' . get_the_title() . '</span>'
                ),
                '<span class="edit-link">',
                '</span><br>'
            );

            if ( has_category() || has_tag() ) {

                echo '<div class="post-taxonomies">';

                $categories_list = get_the_category_list( wp_get_list_item_separator() );
                if ( $categories_list ) {
                    
if ( is_array( $comments ) && $comments ) {
            // Prime cache for associated posts. (Prime post term cache if we need it for permalinks.)             $post_ids = array_unique( wp_list_pluck( $comments, 'comment_post_ID' ) );
            _prime_post_caches( $post_idsstrpos( get_option( 'permalink_structure' ), '%category%' ), false );

            foreach ( (array) $comments as $comment ) {
                $output .= '<li class="recentcomments">';
                $output .= sprintf(
                    /* translators: Comments widget. 1: Comment author, 2: Post link. */
                    _x( '%1$s on %2$s', 'widgets' ),
                    '<span class="comment-author-link">' . get_comment_author_link( $comment ) . '</span>',
                    '<a href="' . esc_url( get_comment_link( $comment ) ) . '">' . get_the_title( $comment->comment_post_ID ) . '</a>'
                );
                $output .= '</li>';
            }
        }
        $output .= '</ul>';

        if ( 'html5' === $format ) {
            $output .= '</nav>';
        }

        $output .= $args['after_widget'];

        
global $action;

touch_time( ( 'editcomment' === $action ), 0 );
?> </fieldset> </div> <?php $post_id = $comment->comment_post_ID;
if ( current_user_can( 'edit_post', $post_id ) ) {
    $post_link  = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>";
    $post_link .= esc_html( get_the_title( $post_id ) ) . '</a>';
} else {
    $post_link = esc_html( get_the_title( $post_id ) );
}
?> <div class="misc-pub-section misc-pub-response-to"> <?php     printf(
        /* translators: %s: Post link. */
        __( 'In response to: %s' ),
        '<b>' . $post_link . '</b>'
    );

function render_block_core_read_more( $attributes$content$block ) {
    if ( ! isset( $block->context['postId'] ) ) {
        return '';
    }

    $post_ID    = $block->context['postId'];
    $post_title = get_the_title( $post_ID );
    if ( '' === $post_title ) {
        $post_title = sprintf(
            /* translators: %s is post ID to describe the link for screen readers. */
            __( 'untitled post %s' ),
            $post_ID
        );
    }
    $screen_reader_text = sprintf(
        /* translators: %s is either the post title or post ID to describe the link for screen readers. */
        __( ': %s' ),
        $post_title
    );
do_action( 'commentsrss2_head' );

    while ( have_comments() ) :
        the_comment();
        $comment_post    = get_post( $comment->comment_post_ID );
        $GLOBALS['post'] = $comment_post;
        ?> <item> <title> <?php         if ( ! is_singular() ) {
            $title = get_the_title( $comment_post->ID );
            /** This filter is documented in wp-includes/feed.php */
            $title = apply_filters( 'the_title_rss', $title );
            /* translators: Individual comment title. 1: Post title, 2: Comment author name. */
            printf( ent2ncr( __( 'Comment on %1$s by %2$s' ) )$titleget_comment_author_rss() );
        } else {
            /* translators: Comment author title. %s: Comment author name. */
            printf( ent2ncr( __( 'By: %s' ) )get_comment_author_rss() );
        }
        ?> </title> <link><?php comment_link(); ?></link> <dc:creator><![CDATA[
echo apply_filters( 'wp_title_rss', get_wp_title_rss()$deprecated );
}

/** * Retrieves the current post title for the feed. * * @since 2.0.0 * * @return string Current post title. */
function get_the_title_rss() {
    $title = get_the_title();

    /** * Filters the post title for use in a feed. * * @since 1.2.0 * * @param string $title The current post title. */
    return apply_filters( 'the_title_rss', $title );
}

$comment_status = $comment->comment_approved;
        }
        $_comment = array(
            'date_created_gmt' => $comment_date_gmt,
            'user_id'          => $comment->user_id,
            'comment_id'       => $comment->comment_ID,
            'parent'           => $comment->comment_parent,
            'status'           => $comment_status,
            'content'          => $comment->comment_content,
            'link'             => get_comment_link( $comment ),
            'post_id'          => $comment->comment_post_ID,
            'post_title'       => get_the_title( $comment->comment_post_ID ),
            'author'           => $comment->comment_author,
            'author_url'       => $comment->comment_author_url,
            'author_email'     => $comment->comment_author_email,
            'author_ip'        => $comment->comment_author_IP,
            'type'             => $comment->comment_type,
        );

        /** * Filters XML-RPC-prepared data for the given comment. * * @since 3.4.0 * * @param array $_comment An array of prepared comment data. * @param WP_Comment $comment Comment object. */

function _draft_or_post_title( $post = 0 ) {
    $title = get_the_title( $post );
    if ( empty( $title ) ) {
        $title = __( '(no title)' );
    }
    return esc_html( $title );
}

/** * Displays the search query. * * A simple wrapper to display the "s" parameter in a `GET` URI. This function * should only be used when the_search_query() cannot. * * @since 2.7.0 */

    }

    $output        = '';
    $attachment_id = 0;

    if ( $attachments ) {
        $k = $prev ? $k - 1 : $k + 1;

        if ( isset( $attachments[ $k ] ) ) {
            $attachment_id = $attachments[ $k ]->ID;
            $attr          = array( 'alt' => get_the_title( $attachment_id ) );
            $output        = wp_get_attachment_link( $attachment_id$size, true, false, $text$attr );
        }
    }

    $adjacent = $prev ? 'previous' : 'next';

    /** * Filters the adjacent image link. * * The dynamic portion of the hook name, `$adjacent`, refers to the type of adjacency, * either 'next', or 'previous'. * * Possible hook names include: * * - `next_image_link` * - `previous_image_link` * * @since 3.5.0 * * @param string $output Adjacent image HTML markup. * @param int $attachment_id Attachment ID * @param string|int[] $size Requested image size. Can be any registered image size name, or * an array of width and height values in pixels (in that order). * @param string $text Link text. */
if ( isset( $this->pending_count[ $post->ID ] ) ) {
            $pending_comments = $this->pending_count[ $post->ID ];
        } else {
            $_pending_count_temp              = get_pending_comments_num( array( $post->ID ) );
            $pending_comments                 = $_pending_count_temp[ $post->ID ];
            $this->pending_count[ $post->ID ] = $pending_comments;
        }

        if ( current_user_can( 'edit_post', $post->ID ) ) {
            $post_link  = "<a href='" . get_edit_post_link( $post->ID ) . "' class='comments-edit-item-link'>";
            $post_link .= esc_html( get_the_title( $post->ID ) ) . '</a>';
        } else {
            $post_link = esc_html( get_the_title( $post->ID ) );
        }

        echo '<div class="response-links">';

        if ( 'attachment' === $post->post_type ) {
            $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true );
            if ( $thumb ) {
                echo $thumb;
            }
        }

function wp_latest_comments_draft_or_post_title( $post = 0 ) {
    $title = get_the_title( $post );
    if ( empty( $title ) ) {
        $title = __( '(no title)' );
    }
    return $title;
}

/** * Renders the `core/latest-comments` block on server. * * @param array $attributes The block attributes. * * @return string Returns the post content with latest comments added. */
// Build results.         $results = array();
        foreach ( $posts as $post ) {
            if ( 'post' === $post->post_type ) {
                $info = mysql2date( __( 'Y/m/d' )$post->post_date );
            } else {
                $info = $pts[ $post->post_type ]->labels->singular_name;
            }

            $results[] = array(
                'ID'        => $post->ID,
                'title'     => trim( esc_html( strip_tags( get_the_title( $post ) ) ) ),
                'permalink' => get_permalink( $post->ID ),
                'info'      => $info,
            );
        }

        /** * Filters the link query results. * * Allows modification of the returned link query results. * * @since 3.7.0 * * @see 'wp_link_query_args' filter * * @param array $results { * An array of associative arrays of query results. * * @type array ...$0 { * @type int $ID Post ID. * @type string $title The trimmed, escaped post title. * @type string $permalink Post permalink. * @type string $info A 'Y/m/d'-formatted date for 'post' post type, * the 'singular_name' post type label otherwise. * } * } * @param array $query An array of WP_Query arguments. */
Home | Imprint | This part of the site doesn't use cookies.