Plugin Directory

Changeset 1636266


Ignore:
Timestamp:
04/12/2017 06:26:09 PM (9 years ago)
Author:
wplizer
Message:

v1.1

Location:
admin-private-note-on-users/trunk
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • admin-private-note-on-users/trunk/admin_private_note.php

    r1636258 r1636266  
    88Text Domain: admin-private-note
    99Domain Path: /languages/
    10 Version: 1.0
     10Version: 1.1
    1111*/
    1212
     
    3333            <td>
    3434            <?php wp_editor(
    35             esc_attr( get_the_author_meta( 'rsf_admin_note', $user->ID ) ),
     35            ( get_the_author_meta( 'rsf_admin_note', $user->ID ) ),
    3636            'rsf_admin_note' ,
    3737            array('teeny'=>true,'media_buttons'=>false,'textarea_rows'=>5));
     
    4444
    4545function rsf_save_apn( $user_id ) {
     46   
    4647    if ( !current_user_can( 'edit_user', $user_id ) )
    4748    {
     
    5354    }
    5455}
     56
     57add_filter('manage_users_columns', 'rsf_admin_note_column');
     58function rsf_admin_note_column($columns) {
     59    $columns['rsf_admin_note'] = 'Admin Note';
     60    return $columns;
     61}
     62 
     63add_action('manage_users_custom_column',  'rsf_admin_note_column_content', 10, 3);
     64function rsf_admin_note_column_content($value, $column_name, $user_id) {
     65    $user = get_userdata( $user_id );
     66    if ( 'rsf_admin_note' == $column_name )
     67    {
     68        $note=( get_the_author_meta( 'rsf_admin_note', $user_id ) );
     69        if($note)
     70        {
     71            return "<div style='max-height:60px;overflow:hidden;' class='admin_note_more' title=''>".$note.'</div>';
     72        }
     73        else
     74        {
     75            return '';
     76        }
     77       
     78    }
     79    else{
     80         return $value;
     81    }
     82       
     83   
     84}
     85
     86
     87
     88function pw_load_scripts($hook) {
     89    wp_enqueue_script( 'rsf_readmore',  plugin_dir_url( __FILE__ ). 'assets/readmore.min.js', array('jquery') );
     90    wp_enqueue_script( 'rsf_admin_note_js',  plugin_dir_url( __FILE__ ). 'assets/base.js',array('rsf_readmore')  );
     91   
     92}
     93add_action('admin_enqueue_scripts', 'pw_load_scripts');
    5594?>
  • admin-private-note-on-users/trunk/readme.txt

    r1636258 r1636266  
    22Contributors: wplizer
    33Donate link: http://wplizer.com/donate
    4 Tags: note, hidden, private, invisible, description, users
     4Tags: note, hidden, private, invisible, description, users, admin ,users list
    55Requires at least: 3.0.1
    6 Tested up to: 4.1
    7 Stable tag: 1.0
     6Tested up to: 4.7.3
     7Stable tag: 1.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3030just go to users profile and you will see a text editor for private noting...
    3131
     32= How can I see hidden notes?  =
     33
     34the notes are in the users list page in Admin area...
     35
    3236== Screenshots ==
    33371. Screenshot 1
    3438
    3539== Changelog ==
     40
     41= 1.1 =
     421. Added Admin Note Column to users list page at admin area
     432. Now you can save html notes with editor for your users
     443. load more button in users list to avoid lenghy notes make the page long!
    3645
    3746= 1.0 =
Note: See TracChangeset for help on using the changeset viewer.