Plugin Directory

Changeset 2148712


Ignore:
Timestamp:
08/30/2019 09:23:24 PM (7 years ago)
Author:
kbjohnson90
Message:

Release v2.0.2 with Autocomplete for the Block Editor.

Location:
user-shortcodes-plus
Files:
23 added
3 edited

Legend:

Unmodified
Added
Removed
  • user-shortcodes-plus/trunk/includes/Shortcodes/UserAvatar.php

    r1638256 r2148712  
    1313        $atts = shortcode_atts( array(
    1414            'id' => get_current_user_id(),
     15            'size' => 96
    1516        ), $atts );
    1617
    1718        $userdata = get_userdata( $atts[ 'id' ] );
    1819
    19         return get_avatar( $userdata->user_email );
     20        return get_avatar( $userdata->user_email, $atts[ 'size' ] );
    2021    }
    2122
  • user-shortcodes-plus/trunk/readme.txt

    r1638256 r2148712  
    44Donate link: http://kylebjohnson.me/plugins
    55Requires at least: 4.5
    6 Tested up to: 4.7.3
    7 Stable tag: 2.0.1
     6Tested up to: 5.2.2
     7Stable tag: 2.0.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7171== Changelog ==
    7272
     73= 2.0.2 =
     74* Add autocomplete support for the Block Editor (Gutenberg).
     75
    7376= 2.0.1 =
    7477* Fixed a bug with showing the TinyMCE Button on new posts/pages.
     
    8891== Upgrade Notice ==
    8992
    90 = 2.0.0 =
    91 Added new shortcodes for the user's website and bio. Also added a TinyMCE button.
    92 
    93 = 1.0.1 =
    94 Added new shortcodes for the user's avatar.
     93= 2.0.2 =
     94* Add autocomplete support for the Block Editor (Gutenberg).
  • user-shortcodes-plus/trunk/user-shortcodes-plus.php

    r1638256 r2148712  
    3030        add_action( 'admin_init', array( $this, 'admin_init' ) );
    3131        add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
     32        add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_editor_assets' ) );
    3233    }
    3334
     
    5152        wp_register_script( 'kbj_user_shortcodes_plus_admin_js', self::url( 'assets/js/admin.js' ), array( 'jquery' ), self::VERSION );
    5253        wp_enqueue_script( 'kbj_user_shortcodes_plus_admin_js' );
     54    }
     55
     56    public function enqueue_block_editor_assets()
     57    {
     58        wp_enqueue_script( 'kbj_user_shortcodes_plus_block_editor_js', self::url( 'assets/js/editor.js' ), array( 'wp-blocks', 'wp-dom-ready', 'wp-edit-post' ) );
     59        wp_localize_script( 'kbj_user_shortcodes_plus_block_editor_js', 'userShortcodesPlus', array_values( KBJ_UserShortcodesPlus::config( 'Shortcodes' ) ) );
    5360    }
    5461
Note: See TracChangeset for help on using the changeset viewer.