関数 get_edit_post_link()
2015/01/14
関数 get_edit_post_link()
定義ファイル :/blog/wp-includes/link-template.php 3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | function get_edit_post_link( $id = 0, $context = 'display' ) { if ( ! $post = get_post( $id ) ) return; if ( 'revision' === $post->post_type ) $action = ''; elseif ( 'display' == $context ) $action = '&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( 'edit_post', $post->ID ) ) return; return apply_filters( 'get_edit_post_link', admin_url( sprintf( $post_type_object->_edit_link . $action, $post->ID ) ), $post->ID, $context ); } |