Plugin Directory

Changeset 2008146


Ignore:
Timestamp:
01/08/2019 03:18:33 AM (7 years ago)
Author:
podamibe
Message:

New version 1.0.6 added

Location:
podamibe-custom-user-gravatar/trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • podamibe-custom-user-gravatar/trunk/assets/js/pcg-custom-gravatar.js

    r1516426 r2008146  
    22    $(document).ready(function(){
    33        var frame,
    4             uploadImageBtn = $("#pcg-upload-profile-pic");
     4            uploadImageBtn = $("#pcg-upload-profile-pic"),
     5            removeImageBtn = $('#pcg-remove-img');
    56   
    67        uploadImageBtn.on( 'click', function( event ){
     
    2324           
    2425            frame.on( 'select', function() {
    25               var attachment = frame.state().get('selection').first().toJSON();
    26               console.log(attachment.sizes);
    27               $( "#pcg-custom-gravatar" ).val(attachment.id);
    28               $("#pcg-custom-gravatar-pic img").attr( "src", attachment.sizes.thumbnail.url );
     26                var attachment = frame.state().get('selection').first().toJSON();
     27                $( "#pcg-custom-gravatar" ).val(attachment.id);
     28                $("#pcg-custom-gravatar-pic img").attr( "src", attachment.url );
    2929            });
    3030           
    3131            frame.open();
    32          });
    33          
    34          if( $( "#pcg-use-custom-gravatar" ).is(":checked") ){
     32        });
     33
     34        /**
     35         * Remove Image Btn
     36         */
     37        removeImageBtn.on( 'click', function( event ){
     38            $( "#pcg-custom-gravatar" ).val('');
     39            $("#pcg-custom-gravatar-pic img").attr( "src", '' );
     40        });
     41       
     42        if( $( "#pcg-use-custom-gravatar" ).is(":checked") ){
    3543            $( "#pcg-upload-profile-pic" ).closest("tr").show();
    3644        }
  • podamibe-custom-user-gravatar/trunk/pod-custom-user-gravatar.php

    r1793410 r2008146  
     1
    12<?php
    2 /**
    3 *   Plugin Name:       Podamibe Custom User Gravatar
    4 *   Plugin URI:        http://podamibenepal.com/wordpress-plugins/
    5 *   Description:       Allows users to use pictures in the media gallery as gravatar.
    6 *   Version:           1.0.5
    7 *   Author:            Podamibe Nepal
    8 *   Author URI:        http://podamibenepal.com/
    9 *   License:           GPLv2 or later
    10 *   Text Domain:       pcg
    11 **/
     3/*
     4 * Plugin Name:       Podamibe Custom User Gravatar
     5 * Plugin URI:        http://podamibenepal.com/wordpress-plugins/
     6 * Description:       Allows users to use pictures in the media gallery as gravatar.
     7 * Version:           1.0.6
     8 * Author:            Podamibe Nepal
     9 * Author URI:        http://podamibenepal.com/
     10 * Requires at least: 4.0
     11 * Tested up to:      5.0
     12 * Text Domain:       pcg
     13 * Domain Path:       languages
     14 *
     15 * @package  Podamibe Custom User Gravatar
     16 * @author   Podamibe Nepal
     17 * @category Core
     18 */
    1219
    1320if( ! defined( "ABSPATH" ) ){
     
    120127                        <label for="pcg-upload-profile-pic"><a href="javascript:void(0);" class="button" id="pcg-upload-profile-pic"><?php esc_html_e("Select Picture", PCG_TEXT_DOMAIN ); ?></a></label>
    121128                        <input name="pcg_custom_gravatar" id="pcg-custom-gravatar" value="<?php echo get_user_meta( $user->ID, "pcg_custom_gravatar", true ); ?>" type="hidden" />
     129                        <a href="javascript:void(0)" id="pcg-remove-img" class="pcg-remove-img"><?php echo esc_html__('Remove','pcg'); ?></a>
    122130                    <?php }else{?>
    123131                        <div id="pcg-custom-gravatar-pic"><?php echo get_avatar(NULl); ?></div>
  • podamibe-custom-user-gravatar/trunk/readme.txt

    r1793425 r2008146  
    33Tags: gravatar, custom gravatar, change gravatar, podamibe
    44Requires at least: 3.7.0
    5 Tested up to: 4.9.1
    6 Stable tag: 1.0.5
     5Tested up to: 5.0
     6Stable tag: 1.0.6
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3434
    3535== Changelog ==
     36= 1.0.6 =
     37* add the languages support
     38* add the remove buttom
    3639
    3740= 1.0.5 =
Note: See TracChangeset for help on using the changeset viewer.