Changeset 2876465
- Timestamp:
- 03/08/2023 12:06:07 PM (3 years ago)
- Location:
- good-slider
- Files:
-
- 2 edited
- 1 copied
-
tags/1.2.0 (copied) (copied from good-slider/trunk)
-
tags/1.2.0/good-slider.php (modified) (3 diffs)
-
trunk/good-slider.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
good-slider/tags/1.2.0/good-slider.php
r2831178 r2876465 6 6 * Requires at least: 6.0 7 7 * Requires PHP: 7.4 8 * Version: 1. 1.08 * Version: 1.2.0 9 9 * Author: GoodWP 10 10 * Author URI: https://goodwp.io … … 32 32 ]); 33 33 34 register_block_type(__DIR__ . '/build/item-block'); 34 register_block_type(__DIR__ . '/build/item-block', [ 35 'render_callback' => __NAMESPACE__ . '\renderItemBlock' 36 ]); 35 37 } 36 38 add_action('init', __NAMESPACE__ . '\registerBlock'); … … 173 175 return $content; 174 176 } 177 178 /** 179 * Render the block 180 * 181 * @param array $attributes 182 * @param string $content 183 * @return string 184 */ 185 function 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 6 6 * Requires at least: 6.0 7 7 * Requires PHP: 7.4 8 * Version: 1. 1.08 * Version: 1.2.0 9 9 * Author: GoodWP 10 10 * Author URI: https://goodwp.io … … 32 32 ]); 33 33 34 register_block_type(__DIR__ . '/build/item-block'); 34 register_block_type(__DIR__ . '/build/item-block', [ 35 'render_callback' => __NAMESPACE__ . '\renderItemBlock' 36 ]); 35 37 } 36 38 add_action('init', __NAMESPACE__ . '\registerBlock'); … … 173 175 return $content; 174 176 } 177 178 /** 179 * Render the block 180 * 181 * @param array $attributes 182 * @param string $content 183 * @return string 184 */ 185 function 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.