WordPress.org

Plugin Directory

Changeset 665708


Ignore:
Timestamp:
02/09/13 20:54:50 (15 months ago)
Author:
wpmuguru
Message:

fix warnings

Location:
document-repository/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • document-repository/trunk/document-repository.php

    r659405 r665708  
    208208    } 
    209209    function media_upload_tabs( $tabs ) { 
     210        if ( ! isset( $_GET['post_id'] ) ) 
     211            return $tabs; 
     212 
    210213        $post = get_post( $_GET['post_id'] ); 
    211         if( $post->post_type == $this->post_type_name ) 
     214        if ( ! empty( $post->post_type ) && $post->post_type == $this->post_type_name ) 
    212215            return array( 'type' => $tabs['type'] ); 
    213216 
     
    460463    */ 
    461464    function post_updated_messages( $messages ) { 
     465 
     466        global $post, $post_ID; 
     467 
     468        if ( empty( $post ) || empty( $post_ID ) ) 
     469            return $messages; 
     470 
    462471        $messages['umw_document'] = array( 
    463472             1 => sprintf( __( 'Document updated. <a href="%s">View document</a>', 'document-repository' ), esc_url( get_permalink($post_ID) ) ), 
     
    471480            10 => sprintf( __( 'Document draft updated. <a target="_blank" href="%s">Preview document</a>', 'document-repository' ), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ), 
    472481        ); 
     482 
    473483        return $messages; 
     484 
    474485    } 
    475486    /* 
  • document-repository/trunk/extras.php

    r660422 r665708  
    7474     
    7575        $user = get_current_user(); 
    76         if( !$user->doc_role && ( !defined( 'RA_DOCUMENT_REPO_BLOG_ID' ) || !current_user_can_for_blog( 'manage_options', RA_DOCUMENT_REPO_BLOG_ID ) ) && !current_user_can( 'manage_options' ) ) 
     76        if( empty( $user->doc_role ) && ( ! defined( 'RA_DOCUMENT_REPO_BLOG_ID' ) || ! current_user_can_for_blog( 'manage_options', RA_DOCUMENT_REPO_BLOG_ID ) ) && ! current_user_can( 'manage_options' ) ) 
    7777            return; 
    7878 
  • document-repository/trunk/user-roles.php

    r482888 r665708  
    146146            $role = (int)$_POST['doc_role']; 
    147147            if( $role ) 
    148                 update_usermeta( $user_id, 'doc_role', $role ); 
     148                update_user_meta( $user_id, 'doc_role', $role ); 
    149149            else 
    150                 delete_usermeta( $user_id, 'doc_role' ); 
     150                delete_user_meta( $user_id, 'doc_role' ); 
    151151        } 
    152152    }    
Note: See TracChangeset for help on using the changeset viewer.