Plugin Directory

Changeset 2876465


Ignore:
Timestamp:
03/08/2023 12:06:07 PM (3 years ago)
Author:
goodwpio
Message:

Update to version 1.2.0 from GitHub

Location:
good-slider
Files:
2 edited
1 copied

Legend:

Unmodified
Added
Removed
  • good-slider/tags/1.2.0/good-slider.php

    r2831178 r2876465  
    66 * Requires at least: 6.0
    77 * Requires PHP:      7.4
    8  * Version:           1.1.0
     8 * Version:           1.2.0
    99 * Author:            GoodWP
    1010 * Author URI:        https://goodwp.io
     
    3232    ]);
    3333
    34     register_block_type(__DIR__ . '/build/item-block');
     34    register_block_type(__DIR__ . '/build/item-block', [
     35        'render_callback' => __NAMESPACE__ . '\renderItemBlock'
     36    ]);
    3537}
    3638add_action('init', __NAMESPACE__ . '\registerBlock');
     
    173175    return $content;
    174176}
     177
     178/**
     179 * Render the block
     180 *
     181 * @param array $attributes
     182 * @param string $content
     183 * @return string
     184 */
     185function renderItemBlock($attributes, $content)
     186{
     187    // prevent empty slides from rendering
     188    if (trim($content) === '<div class="wp-block-good-slider-item"></div>') {
     189        return '';
     190    }
     191    return $content;
     192}
  • good-slider/trunk/good-slider.php

    r2831178 r2876465  
    66 * Requires at least: 6.0
    77 * Requires PHP:      7.4
    8  * Version:           1.1.0
     8 * Version:           1.2.0
    99 * Author:            GoodWP
    1010 * Author URI:        https://goodwp.io
     
    3232    ]);
    3333
    34     register_block_type(__DIR__ . '/build/item-block');
     34    register_block_type(__DIR__ . '/build/item-block', [
     35        'render_callback' => __NAMESPACE__ . '\renderItemBlock'
     36    ]);
    3537}
    3638add_action('init', __NAMESPACE__ . '\registerBlock');
     
    173175    return $content;
    174176}
     177
     178/**
     179 * Render the block
     180 *
     181 * @param array $attributes
     182 * @param string $content
     183 * @return string
     184 */
     185function renderItemBlock($attributes, $content)
     186{
     187    // prevent empty slides from rendering
     188    if (trim($content) === '<div class="wp-block-good-slider-item"></div>') {
     189        return '';
     190    }
     191    return $content;
     192}
Note: See TracChangeset for help on using the changeset viewer.