get_author_posts_url example

            printf(
                /* translators: %s: Author name. */
                esc_html__( 'By %s', 'twentytwentyone' ),
                get_the_author()
            );
            ?> </h2><!-- .author-title --> <p class="author-description"> <?php the_author_meta( 'description' ); ?></p><!-- .author-description --> <?php             printf(
                '<a class="author-link" href="%1$s" rel="author">%2$s</a>',
                esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
                sprintf(
                    /* translators: %s: Author name. */
                    esc_html__( 'View all of %s\'s posts.', 'twentytwentyone' ),
                    get_the_author()
                )
            );
            ?> </div><!-- .author-bio-content --> </div><!-- .author-bio --> <?php endif;


    if ( empty( $author_id ) ) {
        return '';
    }

    $avatar = ! empty( $attributes['avatarSize'] ) ? get_avatar(
        $author_id,
        $attributes['avatarSize']
    ) : null;

    $link        = get_author_posts_url( $author_id );
    $author_name = get_the_author_meta( 'display_name', $author_id );
    if ( ! empty( $attributes['isLink'] && ! empty( $attributes['linkTarget'] ) ) ) {
        $author_name = sprintf( '<a href="%1$s" target="%2$s">%3$s</a>', esc_url( $link )esc_attr( $attributes['linkTarget'] )$author_name );
    }

    $byline  = ! empty( $attributes['byline'] ) ? $attributes['byline'] : false;
    $classes = array();
    if ( isset( $attributes['itemsJustification'] ) ) {
        $classes[] = 'items-justified-' . $attributes['itemsJustification'];
    }
    if ( isset( $attributes['textAlign'] ) ) {
        
function get_author_feed_link( $author_id$feed = '' ) {
    $author_id           = (int) $author_id;
    $permalink_structure = get_option( 'permalink_structure' );

    if ( empty( $feed ) ) {
        $feed = get_default_feed();
    }

    if ( ! $permalink_structure ) {
        $link = home_url( "?feed=$feed&amp;author=" . $author_id );
    } else {
        $link = get_author_posts_url( $author_id );
        if ( get_default_feed() == $feed ) {
            $feed_link = 'feed';
        } else {
            $feed_link = "feed/$feed";
        }

        $link = trailingslashit( $link ) . user_trailingslashit( $feed_link, 'feed' );
    }

    /** * Filters the feed link for a given author. * * @since 1.5.1 * * @param string $link The author feed link. * @param string $feed Feed type. Possible values include 'rss2', 'atom'. */


        $args          = $this->get_users_query_args();
        $args['paged'] = $page_num;

        $query    = new WP_User_Query( $args );
        $users    = $query->get_results();
        $url_list = array();

        foreach ( $users as $user ) {
            $sitemap_entry = array(
                'loc' => get_author_posts_url( $user->ID ),
            );

            /** * Filters the sitemap entry for an individual user. * * @since 5.5.0 * * @param array $sitemap_entry Sitemap entry for the user. * @param WP_User $user User object. */
            $sitemap_entry = apply_filters( 'wp_sitemaps_users_entry', $sitemap_entry$user );
            
'extra_attr' => $image_styles,
                'class'      => $image_classes,
            )
        );
        if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) {
            $label = '';
            if ( '_blank' === $attributes['linkTarget'] ) {
                // translators: %s is the Author name.                 $label = 'aria-label="' . sprintf( esc_attr__( '(%s author archive, opens in a new tab)' )$author_name ) . '"';
            }
            // translators: %1$s: Author archive link. %2$s: Link target. %3$s Aria label. %4$s Avatar image.             $avatar_block = sprintf( '<a href="%1$s" target="%2$s" %3$s class="wp-block-avatar__link">%4$s</a>', esc_url( get_author_posts_url( $author_id ) )esc_attr( $attributes['linkTarget'] )$label$avatar_block );
        }
        return sprintf( '<div %1s>%2s</div>', $wrapper_attributes$avatar_block );
    }
    $comment = get_comment( $block->context['commentId'] );
    if ( ! $comment ) {
        return '';
    }
    /* translators: %s is the Comment Author name */
    $alt          = sprintf( __( '%s Avatar' )$comment->comment_author );
    $avatar_block = get_avatar(
        $comment,
        

    function twenty_twenty_one_posted_by() {
        if ( ! get_the_author_meta( 'description' ) && post_type_supports( get_post_type(), 'author' ) ) {
            echo '<span class="byline">';
            printf(
                /* translators: %s: Author name. */
                esc_html__( 'By %s', 'twentytwentyone' ),
                '<a href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" rel="author">' . esc_html( get_the_author() ) . '</a>'
            );
            echo '</span>';
        }
    }
}

if ( ! function_exists( 'twenty_twenty_one_entry_meta_footer' ) ) {
    /** * Prints HTML with meta information for the categories, tags and comments. * Footer entry meta is displayed differently in archives and single posts. * * @since Twenty Twenty-One 1.0 * * @return void */

                );
                if ( $avatar ) {
                    $list_items_markup .= $avatar;
                }
            }

            $list_items_markup .= '<article>';
            $list_items_markup .= '<footer class="wp-block-latest-comments__comment-meta">';
            $author_url         = get_comment_author_url( $comment );
            if ( empty( $author_url ) && ! empty( $comment->user_id ) ) {
                $author_url = get_author_posts_url( $comment->user_id );
            }

            $author_markup = '';
            if ( $author_url ) {
                $author_markup .= '<a class="wp-block-latest-comments__comment-author" href="' . esc_url( $author_url ) . '">' . get_comment_author( $comment ) . '</a>';
            } else {
                $author_markup .= '<span class="wp-block-latest-comments__comment-author">' . get_comment_author( $comment ) . '</span>';
            }

            // `_draft_or_post_title` calls `esc_html()` so we don't need to wrap that call in             // `esc_html`.
if ( $redirect_url ) {
                    $redirect['query'] = remove_query_arg( 'year', $redirect['query'] );
                }
            }
        } elseif ( is_author() && ! empty( $_GET['author'] ) && preg_match( '|^[0-9]+$|', $_GET['author'] ) ) {
            $author = get_userdata( get_query_var( 'author' ) );

            if ( false !== $author
                && $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE $wpdb->posts.post_author = %d AND $wpdb->posts.post_status = 'publish' LIMIT 1", $author->ID ) )
            ) {
                $redirect_url = get_author_posts_url( $author->ID, $author->user_nicename );
                $redirect_obj = $author;

                if ( $redirect_url ) {
                    $redirect['query'] = remove_query_arg( 'author', $redirect['query'] );
                }
            }
        } elseif ( is_category() || is_tag() || is_tax() ) { // Terms (tags/categories).             $term_count = 0;

            foreach ( $wp_query->tax_query->queried_terms as $tax_query ) {
                if ( isset( $tax_query['terms'] ) && is_countable( $tax_query['terms'] ) ) {
                    


        if ( in_array( 'url', $fields, true ) ) {
            $data['url'] = $user->user_url;
        }

        if ( in_array( 'description', $fields, true ) ) {
            $data['description'] = $user->description;
        }

        if ( in_array( 'link', $fields, true ) ) {
            $data['link'] = get_author_posts_url( $user->ID, $user->user_nicename );
        }

        if ( in_array( 'locale', $fields, true ) ) {
            $data['locale'] = get_user_locale( $user );
        }

        if ( in_array( 'nickname', $fields, true ) ) {
            $data['nickname'] = $user->nickname;
        }

        if ( in_array( 'slug', $fields, true ) ) {
            
'provider_url'  => get_home_url(),
        'author_name'   => get_bloginfo( 'name' ),
        'author_url'    => get_home_url(),
        'title'         => get_the_title( $post ),
        'type'          => 'link',
    );

    $author = get_userdata( $post->post_author );

    if ( $author ) {
        $data['author_name'] = $author->display_name;
        $data['author_url']  = get_author_posts_url( $author->ID );
    }

    /** * Filters the oEmbed response data. * * @since 4.4.0 * * @param array $data The response data. * @param WP_Post $post The post object. * @param int $width The requested width. * @param int $height The calculated height. */
if ( is_term_publicly_viewable( $tag ) ) {
                $wp_admin_bar->add_node(
                    array(
                        'id'    => 'view',
                        'title' => $tax->labels->view_item,
                        'href'  => get_term_link( $tag ),
                    )
                );
            }
        } elseif ( 'user-edit' === $current_screen->base && isset( $user_id ) ) {
            $user_object = get_userdata( $user_id );
            $view_link   = get_author_posts_url( $user_object->ID );
            if ( $user_object->exists() && $view_link ) {
                $wp_admin_bar->add_node(
                    array(
                        'id'    => 'view',
                        'title' => __( 'View User' ),
                        'href'  => $view_link,
                    )
                );
            }
        }
    } else {
        
 {
                $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "users.php?action=delete&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Delete' ) . '</a>';
            }

            if ( is_multisite()
                && current_user_can( 'remove_user', $user_object->ID )
            ) {
                $actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url( $url . "action=remove&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Remove' ) . '</a>';
            }

            // Add a link to the user's author archive, if not empty.             $author_posts_url = get_author_posts_url( $user_object->ID );
            if ( $author_posts_url ) {
                $actions['view'] = sprintf(
                    '<a href="%s" aria-label="%s">%s</a>',
                    esc_url( $author_posts_url ),
                    /* translators: %s: Author's display name. */
                    esc_attr( sprintf( __( 'View posts by %s' )$user_object->display_name ) ),
                    __( 'View' )
                );
            }

            // Add a link to send the user a reset password link by email.

function get_author_link($display$author_id$author_nicename = '') {
    _deprecated_function( __FUNCTION__, '2.1.0', 'get_author_posts_url()' );

    $link = get_author_posts_url($author_id$author_nicename);

    if ( $display )
        echo $link;
    return $link;
}

/** * Print list of pages based on arguments. * * @since 0.71 * @deprecated 2.1.0 Use wp_link_pages() * @see wp_link_pages() * * @param string $before * @param string $after * @param string $next_or_number * @param string $nextpagelink * @param string $previouspagelink * @param string $pagelink * @param string $more_file * @return string */
if ( ! isset( $block->context['postId'] ) ) {
        return '';
    }

    $author_id = get_post_field( 'post_author', $block->context['postId'] );
    if ( empty( $author_id ) ) {
        return '';
    }

    $author_name = get_the_author_meta( 'display_name', $author_id );
    if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) {
        $author_name = sprintf( '<a href="%1$s" target="%2$s" class="wp-block-post-author-name__link">%3$s</a>', get_author_posts_url( $author_id )esc_attr( $attributes['linkTarget'] )$author_name );
    }

    $classes = array();
    if ( isset( $attributes['textAlign'] ) ) {
        $classes[] = 'has-text-align-' . $attributes['textAlign'];
    }
    if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) {
        $classes[] = 'has-link-color';
    }
    $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) );

    

function get_the_author_posts_link() {
    global $authordata;

    if ( ! is_object( $authordata ) ) {
        return '';
    }

    $link = sprintf(
        '<a href="%1$s" title="%2$s" rel="author">%3$s</a>',
        esc_url( get_author_posts_url( $authordata->ID, $authordata->user_nicename ) ),
        /* translators: %s: Author's display name. */
        esc_attr( sprintf( __( 'Posts by %s' )get_the_author() ) ),
        get_the_author()
    );

    /** * Filters the link to the author page of the author of the current post. * * @since 2.9.0 * * @param string $link HTML link. */
Home | Imprint | This part of the site doesn't use cookies.