Switch language

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




get_edit_post_link [ WordPress Function ]

get_edit_post_link ( $id = 0, $context = 'display' )
Parameters:
  • (int) $id Optional. Post ID.
  • (string) $context Optional, defaults to display. How to write the '&', defaults to '&'.
Returns:
  • (string)
Defined at:



Retrieve edit posts link for post.

Can be used within the WordPress loop or outside of it. Can be used with pages, posts, attachments, and revisions.

Source


<?php
function get_edit_post_link$id 0$context 'display' ) {
    if ( !
$post = &get_post$id ) )
        return;

    if ( 
'display' == $context )
        
$action '&amp;action=edit';
    else
        
$action '&action=edit';

    
$post_type_object get_post_type_object$post->post_type );
    if ( !
$post_type_object )
        return;

    if ( !
current_user_can$post_type_object->cap->edit_post$post->ID ) )
        return;

    return 
apply_filters'get_edit_post_link'admin_urlsprintf($post_type_object->_edit_link $action$post->ID) ), $post->ID$context );
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



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