Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




edit_post_link [ WordPress Function ]

edit_post_link ( $link = null, $before = '', $after = '', $id = 0 )
Parameters:
  • (string) $link Optional. Anchor text.
  • (string) $before Optional. Display before edit link.
  • (string) $after Optional. Display after edit link.
  • (int) $id Optional. Post ID.
Defined at:



Display edit post link for post.

Source


<?php
function edit_post_link$link null$before ''$after ''$id ) {
    if ( !
$post = &get_post$id ) )
        return;

    if ( !
$url get_edit_post_link$post->ID ) )
        return;

    if ( 
null === $link )
        
$link __('Edit This');

    
$post_type_obj get_post_type_object$post->post_type );
    
$link '<a class="post-edit-link" href="' $url '" title="' esc_attr$post_type_obj->labels->edit_item ) . '">' $link '</a>';
    echo 
$before apply_filters'edit_post_link'$link$post->ID ) . $after;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics