Changeset 3349208
- Timestamp:
- 08/24/2025 10:55:45 AM (7 months ago)
- Location:
- frontblocks
- Files:
-
- 6 edited
- 1 copied
-
tags/1.0.1 (copied) (copied from frontblocks/trunk)
-
tags/1.0.1/frontblocks.php (modified) (3 diffs)
-
tags/1.0.1/includes/carousel/frontblocks-carousel.php (modified) (6 diffs)
-
tags/1.0.1/readme.txt (modified) (4 diffs)
-
trunk/frontblocks.php (modified) (3 diffs)
-
trunk/includes/carousel/frontblocks-carousel.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
frontblocks/tags/1.0.1/frontblocks.php
r3338168 r3349208 2 2 /** 3 3 * Plugin Name: FrontBlocks for GeneratePress 4 * Plugin URI: https:// github.com/closemarketing/frontblocks4 * Plugin URI: https://wordpress.org/plugins/frontblocks/ 5 5 * Description: Blocks and helpers that extends GeneratePress blocks. 6 * Version: 1.0. 06 * Version: 1.0.1 7 7 * Author: Closemarketing 8 8 * Author URI: https://close.marketing … … 12 12 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt 13 13 * 14 * Requires at least: 6.714 * Requires at least: 5.0 15 15 * Requires PHP: 7.0 16 16 * 17 17 * @package FrontBlocks 18 18 * @author Closemarketing 19 * @copyright 202 3Closemarketing19 * @copyright 2025 Closemarketing 20 20 * @license GPL-2.0+ 21 21 * … … 27 27 defined( 'ABSPATH' ) || die( 'No script kiddies please!' ); 28 28 29 define( 'FRBL_VERSION', '1.0. 0' );29 define( 'FRBL_VERSION', '1.0.1' ); 30 30 define( 'FRBL_PLUGIN', __FILE__ ); 31 31 define( 'FRBL_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); -
frontblocks/tags/1.0.1/includes/carousel/frontblocks-carousel.php
r3338168 r3349208 60 60 61 61 add_filter( 'render_block_generateblocks/grid', 'frbl_add_custom_attributes_to_grid_block', 10, 2 ); 62 /** 63 * Hook to filter the block output on frontend. 62 add_filter( 'render_block_generateblocks/element', 'frbl_add_custom_attributes_to_element_block', 10, 2 ); 63 /** 64 * Hook to filter the block output on frontend for grid blocks. 64 65 * 65 66 * @param html $block_content Block content. … … 69 70 */ 70 71 function frbl_add_custom_attributes_to_grid_block( $block_content, $block ) { 71 $attrs = $block['attrs'] ?? array();72 $custom_option = isset( $attrs['frblGridOption'] ) ? sanitize_text_field( $attrs['frblGridOption'] ) : '';73 $items_to_view = isset( $attrs['frblItemsToView'] ) ? (int) $attrs['frblItemsToView'] : 4;74 $responsive_to_view = isset( $attrs['frblResponsiveToView'] ) ? (int) $attrs['frblResponsiveToView'] : 1;75 $autoplay = isset( $attrs['frblAutoplay'] ) ? ( (int) $attrs['frblAutoplay'] * 1000 ) : '';76 $rewind = isset( $attrs['frblRewind'] ) ? (bool) $attrs['frblRewind'] : true;77 $buttons = isset( $attrs['frblButtons'] ) ? sanitize_text_field( $attrs['frblButtons'] ) : 'arrows';78 $button_color = isset( $attrs['frblButtonColor'] ) ? sanitize_text_field( $attrs['frblButtonColor'] ) : '';79 $button_bg_color = isset( $attrs['frblButtonBgColor'] ) ? sanitize_text_field( $attrs['frblButtonBgColor'] ) : '';80 $buttons_position = isset( $attrs['frblButtonsPosition'] ) ? sanitize_text_field( $attrs['frblButtonsPosition'] ) : 'side';72 $attrs = $block['attrs'] ?? array(); 73 $custom_option = isset( $attrs['frblGridOption'] ) ? sanitize_text_field( $attrs['frblGridOption'] ) : ''; 74 $items_to_view = isset( $attrs['frblItemsToView'] ) ? (int) $attrs['frblItemsToView'] : 4; 75 $responsive_to_view = isset( $attrs['frblResponsiveToView'] ) ? (int) $attrs['frblResponsiveToView'] : 1; 76 $autoplay = isset( $attrs['frblAutoplay'] ) ? ( (int) $attrs['frblAutoplay'] * 1000 ) : ''; 77 $rewind = isset( $attrs['frblRewind'] ) ? (bool) $attrs['frblRewind'] : true; 78 $buttons = isset( $attrs['frblButtons'] ) ? sanitize_text_field( $attrs['frblButtons'] ) : 'arrows'; 79 $button_color = isset( $attrs['frblButtonColor'] ) ? sanitize_text_field( $attrs['frblButtonColor'] ) : ''; 80 $button_bg_color = isset( $attrs['frblButtonBgColor'] ) ? sanitize_text_field( $attrs['frblButtonBgColor'] ) : ''; 81 $buttons_position = isset( $attrs['frblButtonsPosition'] ) ? sanitize_text_field( $attrs['frblButtonsPosition'] ) : 'side'; 81 82 82 83 // Example: Add data attributes to the wrapper div if carousel is enabled. … … 105 106 } 106 107 108 return $block_content; 109 } 110 111 /** 112 * Hook to filter the block output on frontend for element blocks with grid display. 113 * 114 * @param html $block_content Block content. 115 * @param array $block Block attributes. 116 * 117 * @return html 118 */ 119 function frbl_add_custom_attributes_to_element_block( $block_content, $block ) { 120 $attrs = $block['attrs'] ?? array(); 121 122 // Check if this element has grid display 123 $styles = $attrs['styles'] ?? array(); 124 $display = $styles['display'] ?? ''; 125 126 // Only process if it's a grid element 127 if ( 'grid' !== $display ) { 107 128 return $block_content; 129 } 130 131 $custom_option = isset( $attrs['frblGridOption'] ) ? sanitize_text_field( $attrs['frblGridOption'] ) : ''; 132 $items_to_view = isset( $attrs['frblItemsToView'] ) ? (int) $attrs['frblItemsToView'] : 4; 133 $responsive_to_view = isset( $attrs['frblResponsiveToView'] ) ? (int) $attrs['frblResponsiveToView'] : 1; 134 $autoplay = isset( $attrs['frblAutoplay'] ) ? ( (int) $attrs['frblAutoplay'] * 1000 ) : ''; 135 $rewind = isset( $attrs['frblRewind'] ) ? (bool) $attrs['frblRewind'] : true; 136 $buttons = isset( $attrs['frblButtons'] ) ? sanitize_text_field( $attrs['frblButtons'] ) : 'arrows'; 137 $button_color = isset( $attrs['frblButtonColor'] ) ? sanitize_text_field( $attrs['frblButtonColor'] ) : ''; 138 $button_bg_color = isset( $attrs['frblButtonBgColor'] ) ? sanitize_text_field( $attrs['frblButtonBgColor'] ) : ''; 139 $buttons_position = isset( $attrs['frblButtonsPosition'] ) ? sanitize_text_field( $attrs['frblButtonsPosition'] ) : 'side'; 140 141 // Example: Add data attributes to the wrapper div if carousel is enabled. 142 if ( 'carousel' === $custom_option || 'slider' === $custom_option ) { 143 $attributes = ''; 144 if ( 'slider' === $custom_option ) { 145 $attributes .= ' data-rewind="' . esc_attr( $rewind ) . '"'; 146 } 147 // Add data attributes and the 'frontblocks-carousel' class to the first div in the block content. 148 $block_content = preg_replace( 149 '/<div([^>]*)class="([^"]*gb-element-[^"]*)"([^>]*)>/', 150 '<div$1class="$2 frontblocks-carousel"$3' . 151 ' data-type="' . esc_attr( $custom_option ) . '"' . 152 ' data-view="' . esc_attr( $items_to_view ) . '"' . 153 ' data-res-view="' . esc_attr( $responsive_to_view ) . '"' . 154 ' data-autoplay="' . esc_attr( $autoplay ) . '"' . 155 ' data-buttons="' . esc_attr( $buttons ) . '"' . 156 ' data-buttons-color="' . esc_attr( $button_color ) . '"' . 157 ' data-buttons-background-color="' . esc_attr( $button_bg_color ) . '"' . 158 ' data-buttons-position="' . esc_attr( $buttons_position ) . '"' . 159 $attributes . 160 '>', 161 $block_content, 162 1 // Only replace the first occurrence. 163 ); 164 } 165 166 return $block_content; 108 167 } 109 168 … … 131 190 'frontblocks/grid-attributes', 132 191 function( settings, name ) { 133 if ( name !== 'generateblocks/grid' ) {192 if ( name !== 'generateblocks/grid' && name !== 'generateblocks/element' ) { 134 193 return settings; 135 194 } … … 187 246 188 247 /** 189 * Register custom attributes for GenerateBlocks Grid block.248 * Register custom attributes for GenerateBlocks Grid and Element blocks. 190 249 * 191 250 * @param array $block_args The block arguments. … … 195 254 */ 196 255 function frbl_register_custom_attributes_for_grid_block( $block_args, $block_type ) { 197 if ( 'generateblocks/grid' !== $block_type ) {256 if ( 'generateblocks/grid' !== $block_type && 'generateblocks/element' !== $block_type ) { 198 257 return $block_args; 199 258 } -
frontblocks/tags/1.0.1/readme.txt
r3338168 r3349208 5 5 Requires at least: 5.0 6 6 Tested up to: 6.8 7 Stable tag: 1.0. 08 Version: 1.0. 07 Stable tag: 1.0.1 8 Version: 1.0.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 14 14 == Description == 15 15 16 **Carousel/Slider for GenerateBlocks Grid**17 We have added options to the Gutenberg blocks that allow you to create a carousel or slider with the blocks you want.18 19 To start using the Carousel, go to the grid block and select the "Carousel" or "Slider" option in the "FrontBlocks Grid Option" section.20 21 Attributes for the Carousel/Slider:22 - Autoplay - automatically change the slides after a certain time in seconds.23 - View - number of items to show in the carousel/slider.24 - Responsive View - number of items to show in the carousel/slider in responsive view.25 - Buttons - type of buttons to show in the carousel/slider (bullets, arrows, none).26 - Buttons Color - color of the buttons.27 - Buttons Background Color - background color of the buttons (can be transparent).28 29 **Enhanced WordPress Native Gallery**30 We have added options to the native WordPress gallery that allow you to create a different layout as Grid or Masonry, and also make click to carousel with the images.31 32 **Animations for Blocks**33 You can add animations to the blocks you want. To do this, go to the block settings and select the "FrontBlocks Animation Option" section. There you will find a list of animations that you can apply to the block.34 16 **Carousel/Slider for GenerateBlocks Grid** 35 17 We have added options to the Gutenberg blocks that allow you to create a carousel or slider with the blocks you want. … … 87 69 88 70 == Changelog == 71 = 1.0.1 = 72 * Fixed: options for carousel/slider not showing. 73 89 74 = 1.0.0 = 90 75 * Added sticked option for Grid block. … … 93 78 * Added options in native gallery block. 94 79 * Added: Insert Post block to display content from other posts, pages, or custom post types. 95 96 = 1.0.0 =97 * Added sticked option for Grid block.98 * Improved interface for animations.99 * Improved interface for carousel/slider.100 * Added options in native gallery block.101 80 102 81 = 0.2.5 = -
frontblocks/trunk/frontblocks.php
r3338168 r3349208 2 2 /** 3 3 * Plugin Name: FrontBlocks for GeneratePress 4 * Plugin URI: https:// github.com/closemarketing/frontblocks4 * Plugin URI: https://wordpress.org/plugins/frontblocks/ 5 5 * Description: Blocks and helpers that extends GeneratePress blocks. 6 * Version: 1.0. 06 * Version: 1.0.1 7 7 * Author: Closemarketing 8 8 * Author URI: https://close.marketing … … 12 12 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt 13 13 * 14 * Requires at least: 6.714 * Requires at least: 5.0 15 15 * Requires PHP: 7.0 16 16 * 17 17 * @package FrontBlocks 18 18 * @author Closemarketing 19 * @copyright 202 3Closemarketing19 * @copyright 2025 Closemarketing 20 20 * @license GPL-2.0+ 21 21 * … … 27 27 defined( 'ABSPATH' ) || die( 'No script kiddies please!' ); 28 28 29 define( 'FRBL_VERSION', '1.0. 0' );29 define( 'FRBL_VERSION', '1.0.1' ); 30 30 define( 'FRBL_PLUGIN', __FILE__ ); 31 31 define( 'FRBL_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); -
frontblocks/trunk/includes/carousel/frontblocks-carousel.php
r3338168 r3349208 60 60 61 61 add_filter( 'render_block_generateblocks/grid', 'frbl_add_custom_attributes_to_grid_block', 10, 2 ); 62 /** 63 * Hook to filter the block output on frontend. 62 add_filter( 'render_block_generateblocks/element', 'frbl_add_custom_attributes_to_element_block', 10, 2 ); 63 /** 64 * Hook to filter the block output on frontend for grid blocks. 64 65 * 65 66 * @param html $block_content Block content. … … 69 70 */ 70 71 function frbl_add_custom_attributes_to_grid_block( $block_content, $block ) { 71 $attrs = $block['attrs'] ?? array();72 $custom_option = isset( $attrs['frblGridOption'] ) ? sanitize_text_field( $attrs['frblGridOption'] ) : '';73 $items_to_view = isset( $attrs['frblItemsToView'] ) ? (int) $attrs['frblItemsToView'] : 4;74 $responsive_to_view = isset( $attrs['frblResponsiveToView'] ) ? (int) $attrs['frblResponsiveToView'] : 1;75 $autoplay = isset( $attrs['frblAutoplay'] ) ? ( (int) $attrs['frblAutoplay'] * 1000 ) : '';76 $rewind = isset( $attrs['frblRewind'] ) ? (bool) $attrs['frblRewind'] : true;77 $buttons = isset( $attrs['frblButtons'] ) ? sanitize_text_field( $attrs['frblButtons'] ) : 'arrows';78 $button_color = isset( $attrs['frblButtonColor'] ) ? sanitize_text_field( $attrs['frblButtonColor'] ) : '';79 $button_bg_color = isset( $attrs['frblButtonBgColor'] ) ? sanitize_text_field( $attrs['frblButtonBgColor'] ) : '';80 $buttons_position = isset( $attrs['frblButtonsPosition'] ) ? sanitize_text_field( $attrs['frblButtonsPosition'] ) : 'side';72 $attrs = $block['attrs'] ?? array(); 73 $custom_option = isset( $attrs['frblGridOption'] ) ? sanitize_text_field( $attrs['frblGridOption'] ) : ''; 74 $items_to_view = isset( $attrs['frblItemsToView'] ) ? (int) $attrs['frblItemsToView'] : 4; 75 $responsive_to_view = isset( $attrs['frblResponsiveToView'] ) ? (int) $attrs['frblResponsiveToView'] : 1; 76 $autoplay = isset( $attrs['frblAutoplay'] ) ? ( (int) $attrs['frblAutoplay'] * 1000 ) : ''; 77 $rewind = isset( $attrs['frblRewind'] ) ? (bool) $attrs['frblRewind'] : true; 78 $buttons = isset( $attrs['frblButtons'] ) ? sanitize_text_field( $attrs['frblButtons'] ) : 'arrows'; 79 $button_color = isset( $attrs['frblButtonColor'] ) ? sanitize_text_field( $attrs['frblButtonColor'] ) : ''; 80 $button_bg_color = isset( $attrs['frblButtonBgColor'] ) ? sanitize_text_field( $attrs['frblButtonBgColor'] ) : ''; 81 $buttons_position = isset( $attrs['frblButtonsPosition'] ) ? sanitize_text_field( $attrs['frblButtonsPosition'] ) : 'side'; 81 82 82 83 // Example: Add data attributes to the wrapper div if carousel is enabled. … … 105 106 } 106 107 108 return $block_content; 109 } 110 111 /** 112 * Hook to filter the block output on frontend for element blocks with grid display. 113 * 114 * @param html $block_content Block content. 115 * @param array $block Block attributes. 116 * 117 * @return html 118 */ 119 function frbl_add_custom_attributes_to_element_block( $block_content, $block ) { 120 $attrs = $block['attrs'] ?? array(); 121 122 // Check if this element has grid display 123 $styles = $attrs['styles'] ?? array(); 124 $display = $styles['display'] ?? ''; 125 126 // Only process if it's a grid element 127 if ( 'grid' !== $display ) { 107 128 return $block_content; 129 } 130 131 $custom_option = isset( $attrs['frblGridOption'] ) ? sanitize_text_field( $attrs['frblGridOption'] ) : ''; 132 $items_to_view = isset( $attrs['frblItemsToView'] ) ? (int) $attrs['frblItemsToView'] : 4; 133 $responsive_to_view = isset( $attrs['frblResponsiveToView'] ) ? (int) $attrs['frblResponsiveToView'] : 1; 134 $autoplay = isset( $attrs['frblAutoplay'] ) ? ( (int) $attrs['frblAutoplay'] * 1000 ) : ''; 135 $rewind = isset( $attrs['frblRewind'] ) ? (bool) $attrs['frblRewind'] : true; 136 $buttons = isset( $attrs['frblButtons'] ) ? sanitize_text_field( $attrs['frblButtons'] ) : 'arrows'; 137 $button_color = isset( $attrs['frblButtonColor'] ) ? sanitize_text_field( $attrs['frblButtonColor'] ) : ''; 138 $button_bg_color = isset( $attrs['frblButtonBgColor'] ) ? sanitize_text_field( $attrs['frblButtonBgColor'] ) : ''; 139 $buttons_position = isset( $attrs['frblButtonsPosition'] ) ? sanitize_text_field( $attrs['frblButtonsPosition'] ) : 'side'; 140 141 // Example: Add data attributes to the wrapper div if carousel is enabled. 142 if ( 'carousel' === $custom_option || 'slider' === $custom_option ) { 143 $attributes = ''; 144 if ( 'slider' === $custom_option ) { 145 $attributes .= ' data-rewind="' . esc_attr( $rewind ) . '"'; 146 } 147 // Add data attributes and the 'frontblocks-carousel' class to the first div in the block content. 148 $block_content = preg_replace( 149 '/<div([^>]*)class="([^"]*gb-element-[^"]*)"([^>]*)>/', 150 '<div$1class="$2 frontblocks-carousel"$3' . 151 ' data-type="' . esc_attr( $custom_option ) . '"' . 152 ' data-view="' . esc_attr( $items_to_view ) . '"' . 153 ' data-res-view="' . esc_attr( $responsive_to_view ) . '"' . 154 ' data-autoplay="' . esc_attr( $autoplay ) . '"' . 155 ' data-buttons="' . esc_attr( $buttons ) . '"' . 156 ' data-buttons-color="' . esc_attr( $button_color ) . '"' . 157 ' data-buttons-background-color="' . esc_attr( $button_bg_color ) . '"' . 158 ' data-buttons-position="' . esc_attr( $buttons_position ) . '"' . 159 $attributes . 160 '>', 161 $block_content, 162 1 // Only replace the first occurrence. 163 ); 164 } 165 166 return $block_content; 108 167 } 109 168 … … 131 190 'frontblocks/grid-attributes', 132 191 function( settings, name ) { 133 if ( name !== 'generateblocks/grid' ) {192 if ( name !== 'generateblocks/grid' && name !== 'generateblocks/element' ) { 134 193 return settings; 135 194 } … … 187 246 188 247 /** 189 * Register custom attributes for GenerateBlocks Grid block.248 * Register custom attributes for GenerateBlocks Grid and Element blocks. 190 249 * 191 250 * @param array $block_args The block arguments. … … 195 254 */ 196 255 function frbl_register_custom_attributes_for_grid_block( $block_args, $block_type ) { 197 if ( 'generateblocks/grid' !== $block_type ) {256 if ( 'generateblocks/grid' !== $block_type && 'generateblocks/element' !== $block_type ) { 198 257 return $block_args; 199 258 } -
frontblocks/trunk/readme.txt
r3338168 r3349208 5 5 Requires at least: 5.0 6 6 Tested up to: 6.8 7 Stable tag: 1.0. 08 Version: 1.0. 07 Stable tag: 1.0.1 8 Version: 1.0.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 14 14 == Description == 15 15 16 **Carousel/Slider for GenerateBlocks Grid**17 We have added options to the Gutenberg blocks that allow you to create a carousel or slider with the blocks you want.18 19 To start using the Carousel, go to the grid block and select the "Carousel" or "Slider" option in the "FrontBlocks Grid Option" section.20 21 Attributes for the Carousel/Slider:22 - Autoplay - automatically change the slides after a certain time in seconds.23 - View - number of items to show in the carousel/slider.24 - Responsive View - number of items to show in the carousel/slider in responsive view.25 - Buttons - type of buttons to show in the carousel/slider (bullets, arrows, none).26 - Buttons Color - color of the buttons.27 - Buttons Background Color - background color of the buttons (can be transparent).28 29 **Enhanced WordPress Native Gallery**30 We have added options to the native WordPress gallery that allow you to create a different layout as Grid or Masonry, and also make click to carousel with the images.31 32 **Animations for Blocks**33 You can add animations to the blocks you want. To do this, go to the block settings and select the "FrontBlocks Animation Option" section. There you will find a list of animations that you can apply to the block.34 16 **Carousel/Slider for GenerateBlocks Grid** 35 17 We have added options to the Gutenberg blocks that allow you to create a carousel or slider with the blocks you want. … … 87 69 88 70 == Changelog == 71 = 1.0.1 = 72 * Fixed: options for carousel/slider not showing. 73 89 74 = 1.0.0 = 90 75 * Added sticked option for Grid block. … … 93 78 * Added options in native gallery block. 94 79 * Added: Insert Post block to display content from other posts, pages, or custom post types. 95 96 = 1.0.0 =97 * Added sticked option for Grid block.98 * Improved interface for animations.99 * Improved interface for carousel/slider.100 * Added options in native gallery block.101 80 102 81 = 0.2.5 =
Note: See TracChangeset
for help on using the changeset viewer.