Plugin Directory

Changeset 2275781


Ignore:
Timestamp:
04/04/2020 11:34:47 AM (6 years ago)
Author:
sortabrilliant
Message:

Update to version 1.2.0 from GitHub

Location:
post-script
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • post-script/tags/1.2.0/postscript.php

    r2235133 r2275781  
    66 * Author:      sorta brilliant
    77 * Author URI:  https://sortabrilliant.com/
    8  * Version:     1.1.0
     8 * Version:     1.2.0
    99 * License:     GPL-2.0-or-later
    1010 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
     
    1515namespace SortaBrilliant\PostScript;
    1616
    17 const VERSION = '1.1.0';
     17const VERSION = '1.2.0';
    1818
    1919/**
     
    4747    );
    4848
     49    wp_register_script(
     50        'postscript-front-script',
     51        plugins_url( 'build/theme.js', __FILE__ ),
     52        [],
     53        $asset_file['version'],
     54        true
     55    );
     56
     57    wp_register_style(
     58        'postscript-front-style',
     59        plugins_url( 'build/theme.css', __FILE__ ),
     60        [],
     61        $asset_file['version']
     62    );
     63
    4964    register_block_type( 'sortabrilliant/postscript', [
    5065        'editor_script' => 'postscript',
    51         'editor_style'  => 'postscript-editor-style'
     66        'editor_style'  => 'postscript-editor-style',
     67        'render_callback' => __NAMESPACE__ . '\\block_load_assets',
    5268    ] );
    5369}
     
    5571
    5672/**
    57  * Enqueue front-end assets.
     73 * Conditionally load block assets.
    5874 *
    59  * @return void
     75 * @param array $attr
     76 * @param array $content
     77 * @return string $content
    6078 */
    61 function frontend_block_asssets() {
    62     if ( is_admin() ) {
    63         return;
     79function block_load_assets( $attr, $content ) {
     80    if ( ! is_admin() ) {
     81        wp_enqueue_script( 'postscript-front-script' );
     82        wp_enqueue_style( 'postscript-front-style' );
    6483    }
    6584
    66     wp_enqueue_script(
    67         'postscript-front-script',
    68         plugins_url( 'build/theme.js', __FILE__ ),
    69         [],
    70         VERSION,
    71         true
    72     );
    73 
    74     wp_enqueue_style(
    75         'postscript-front-style',
    76         plugins_url( 'build/theme.css', __FILE__ ),
    77         [],
    78         VERSION
    79     );
     85    return $content;
    8086}
    81 add_action( 'enqueue_block_assets', __NAMESPACE__ . '\\frontend_block_asssets' );
  • post-script/tags/1.2.0/readme.txt

    r2236816 r2275781  
    33Tags: popover, popup, block
    44Requires at least: 5.0
    5 Tested up to: 5.3.2
     5Tested up to: 5.4
    66Requires PHP: 5.6
    7 Stable tag: 1.1.0
     7Stable tag: 1.2.0
    88License: GPL-2.0-or-later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.txt
     
    2424
    2525== Changelog ==
     26#### 1.2.0
     27* Conditionally load block assets.
     28
    2629#### 1.1.0
    2730* Updates block styles.
  • post-script/trunk/postscript.php

    r2235133 r2275781  
    66 * Author:      sorta brilliant
    77 * Author URI:  https://sortabrilliant.com/
    8  * Version:     1.1.0
     8 * Version:     1.2.0
    99 * License:     GPL-2.0-or-later
    1010 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
     
    1515namespace SortaBrilliant\PostScript;
    1616
    17 const VERSION = '1.1.0';
     17const VERSION = '1.2.0';
    1818
    1919/**
     
    4747    );
    4848
     49    wp_register_script(
     50        'postscript-front-script',
     51        plugins_url( 'build/theme.js', __FILE__ ),
     52        [],
     53        $asset_file['version'],
     54        true
     55    );
     56
     57    wp_register_style(
     58        'postscript-front-style',
     59        plugins_url( 'build/theme.css', __FILE__ ),
     60        [],
     61        $asset_file['version']
     62    );
     63
    4964    register_block_type( 'sortabrilliant/postscript', [
    5065        'editor_script' => 'postscript',
    51         'editor_style'  => 'postscript-editor-style'
     66        'editor_style'  => 'postscript-editor-style',
     67        'render_callback' => __NAMESPACE__ . '\\block_load_assets',
    5268    ] );
    5369}
     
    5571
    5672/**
    57  * Enqueue front-end assets.
     73 * Conditionally load block assets.
    5874 *
    59  * @return void
     75 * @param array $attr
     76 * @param array $content
     77 * @return string $content
    6078 */
    61 function frontend_block_asssets() {
    62     if ( is_admin() ) {
    63         return;
     79function block_load_assets( $attr, $content ) {
     80    if ( ! is_admin() ) {
     81        wp_enqueue_script( 'postscript-front-script' );
     82        wp_enqueue_style( 'postscript-front-style' );
    6483    }
    6584
    66     wp_enqueue_script(
    67         'postscript-front-script',
    68         plugins_url( 'build/theme.js', __FILE__ ),
    69         [],
    70         VERSION,
    71         true
    72     );
    73 
    74     wp_enqueue_style(
    75         'postscript-front-style',
    76         plugins_url( 'build/theme.css', __FILE__ ),
    77         [],
    78         VERSION
    79     );
     85    return $content;
    8086}
    81 add_action( 'enqueue_block_assets', __NAMESPACE__ . '\\frontend_block_asssets' );
  • post-script/trunk/readme.txt

    r2236816 r2275781  
    33Tags: popover, popup, block
    44Requires at least: 5.0
    5 Tested up to: 5.3.2
     5Tested up to: 5.4
    66Requires PHP: 5.6
    7 Stable tag: 1.1.0
     7Stable tag: 1.2.0
    88License: GPL-2.0-or-later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.txt
     
    2424
    2525== Changelog ==
     26#### 1.2.0
     27* Conditionally load block assets.
     28
    2629#### 1.1.0
    2730* Updates block styles.
Note: See TracChangeset for help on using the changeset viewer.