wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



edit_bookmark_link › WordPress Function

Depuis2.7.0
Dépréciéen/a
edit_bookmark_link ( $link = '', $before = '', $after = '', $bookmark = null )
Paramètres: (4)
  • (string) $link Optional. Anchor text. If empty, default is 'Edit This'. Default empty.
    Requis: Non
    Défaut: (vide)
  • (string) $before Optional. Display before edit link. Default empty.
    Requis: Non
    Défaut: (vide)
  • (string) $after Optional. Display after edit link. Default empty.
    Requis: Non
    Défaut: (vide)
  • (int) $bookmark Optional. Bookmark ID. Default is the current bookmark.
    Requis: Non
    Défaut: null
Défini(e) dans:
Codex:

Displays the edit bookmark link anchor content.



Source

function edit_bookmark_link( $link = '', $before = '', $after = '', $bookmark = null ) {
	$bookmark = get_bookmark( $bookmark );

	if ( ! current_user_can( 'manage_links' ) ) {
		return;
	}

	if ( empty( $link ) ) {
		$link = __( 'Edit This' );
	}

	$link = '<a href="' . esc_url( get_edit_bookmark_link( $bookmark ) ) . '">' . $link . '</a>';

	/**
	 * Filters the bookmark edit link anchor tag.
	 *
	 * @since 2.7.0
	 *
	 * @param string $link    Anchor tag for the edit link.
	 * @param int    $link_id Bookmark ID.
	 */
	echo $before . apply_filters( 'edit_bookmark_link', $link, $bookmark->link_id ) . $after;
}