Plugin Directory

Changeset 842809


Ignore:
Timestamp:
01/22/2014 02:14:01 AM (12 years ago)
Author:
bangbay
Message:

Update readme.txt.

Location:
wp-user-avatar
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-user-avatar/tags/1.7.2/readme.txt

    r841199 r842809  
    261261Then, to add WP User Avatar to that hook and remove it from the other hooks outside of the administration panel, you would add this code to the <code>functions.php</code> file of your theme:
    262262
    263 `if(!is_admin()){
     263`function my_avatar_filter(){
    264264  // Remove from show_user_profile hook
    265265  remove_action('show_user_profile', array('wp_user_avatar', 'wpua_action_show_user_profile'));
     
    273273  add_action('edit_user_avatar', array('wp_user_avatar', 'wpua_action_show_user_profile'));
    274274  add_action('edit_user_avatar', array('wp_user_avatar', 'wpua_media_upload_scripts'));
     275}
     276// Loads only outside of administration panel
     277if(!is_admin()){
     278  add_action('plugins_loaded','my_avatar_filter');`
    275279}`
    276280
  • wp-user-avatar/tags/1.7.2/wp-user-avatar.php

    r841199 r842809  
    367367    }
    368368    // Add to edit user profile
    369     function wpua_action_show_user_profile($user){
     369    public static function wpua_action_show_user_profile($user){
    370370      global $blog_id, $current_user, $post, $show_avatars, $wpdb, $wpua_allow_upload, $wpua_edit_avatar, $wpua_upload_size_limit_with_units;
    371371      // Get WPUA attachment ID
     
    555555
    556556    // Media uploader
    557     function wpua_media_upload_scripts($user=""){
     557    public static function wpua_media_upload_scripts($user=""){
    558558      global $mustache_admin, $pagenow, $show_avatars, $wpua_upload_size_limit;
    559559      wp_enqueue_script('jquery');
     
    561561        wp_enqueue_script('admin-bar');
    562562        wp_enqueue_media();
    563         wp_enqueue_script('wp-user-avatar', WPUA_URLPATH.'js/wp-user-avatar.js', array('jquery'), WPUA_VERSION, true);
     563        wp_enqueue_script('wp-user-avatar', WPUA_URLPATH.'js/wp-user-avatar.js', array('jquery','media-editor'), WPUA_VERSION, true);
    564564      } else {
    565565        wp_enqueue_script('wp-user-avatar', WPUA_URLPATH.'js/wp-user-avatar-user.js', array('jquery'), WPUA_VERSION, true);
  • wp-user-avatar/trunk/wp-user-avatar.php

    r841199 r842809  
    367367    }
    368368    // Add to edit user profile
    369     function wpua_action_show_user_profile($user){
     369    public static function wpua_action_show_user_profile($user){
    370370      global $blog_id, $current_user, $post, $show_avatars, $wpdb, $wpua_allow_upload, $wpua_edit_avatar, $wpua_upload_size_limit_with_units;
    371371      // Get WPUA attachment ID
     
    555555
    556556    // Media uploader
    557     function wpua_media_upload_scripts($user=""){
     557    public static function wpua_media_upload_scripts($user=""){
    558558      global $mustache_admin, $pagenow, $show_avatars, $wpua_upload_size_limit;
    559559      wp_enqueue_script('jquery');
     
    561561        wp_enqueue_script('admin-bar');
    562562        wp_enqueue_media();
    563         wp_enqueue_script('wp-user-avatar', WPUA_URLPATH.'js/wp-user-avatar.js', array('jquery'), WPUA_VERSION, true);
     563        wp_enqueue_script('wp-user-avatar', WPUA_URLPATH.'js/wp-user-avatar.js', array('jquery','media-editor'), WPUA_VERSION, true);
    564564      } else {
    565565        wp_enqueue_script('wp-user-avatar', WPUA_URLPATH.'js/wp-user-avatar-user.js', array('jquery'), WPUA_VERSION, true);
Note: See TracChangeset for help on using the changeset viewer.