Switch language

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




_admin_notice_post_locked [ WordPress Function ]

_admin_notice_post_locked ( No parameters )
Returns:
  • (none)
Defined at:



Outputs the notice message to say that someone else is editing this post at the moment.

Source


<?php
function _admin_notice_post_locked() {
    global 
$post;

    
$lock explode':'get_post_meta$post->ID'_edit_lock'true ) );
    
$user = isset( $lock[1] ) ? $lock[1] : get_post_meta$post->ID'_edit_last'true );
    
$last_user get_userdata$user );
    
$last_user_name $last_user $last_user->display_name __('Somebody');

    switch (
$post->post_type) {
        case 
'post':
            
$message __'Warning: %s is currently editing this post' );
            break;
        case 
'page':
            
$message __'Warning: %s is currently editing this page' );
            break;
        default:
            
$message __'Warning: %s is currently editing this.' );
    }

    
$message sprintf$messageesc_html$last_user_name ) );
    echo 
"<div class='error'><p>$message</p></div>";
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



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