Plugin Directory

Changeset 3349208


Ignore:
Timestamp:
08/24/2025 10:55:45 AM (7 months ago)
Author:
closemarketing
Message:

Update to version 1.0.1 from GitHub

Location:
frontblocks
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • frontblocks/tags/1.0.1/frontblocks.php

    r3338168 r3349208  
    22/**
    33 * Plugin Name: FrontBlocks for GeneratePress
    4  * Plugin URI:  https://github.com/closemarketing/frontblocks
     4 * Plugin URI:  https://wordpress.org/plugins/frontblocks/
    55 * Description: Blocks and helpers that extends GeneratePress blocks.
    6  * Version:     1.0.0
     6 * Version:     1.0.1
    77 * Author:      Closemarketing
    88 * Author URI:  https://close.marketing
     
    1212 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
    1313 *
    14  * Requires at least: 6.7
     14 * Requires at least: 5.0
    1515 * Requires PHP: 7.0
    1616 *
    1717 * @package     FrontBlocks
    1818 * @author      Closemarketing
    19  * @copyright   2023 Closemarketing
     19 * @copyright   2025 Closemarketing
    2020 * @license     GPL-2.0+
    2121 *
     
    2727defined( 'ABSPATH' ) || die( 'No script kiddies please!' );
    2828
    29 define( 'FRBL_VERSION', '1.0.0' );
     29define( 'FRBL_VERSION', '1.0.1' );
    3030define( 'FRBL_PLUGIN', __FILE__ );
    3131define( 'FRBL_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
  • frontblocks/tags/1.0.1/includes/carousel/frontblocks-carousel.php

    r3338168 r3349208  
    6060
    6161add_filter( 'render_block_generateblocks/grid', 'frbl_add_custom_attributes_to_grid_block', 10, 2 );
    62 /**
    63  * Hook to filter the block output on frontend.
     62add_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.
    6465 *
    6566 * @param html  $block_content Block content.
     
    6970 */
    7071function 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';
    8182
    8283    // Example: Add data attributes to the wrapper div if carousel is enabled.
     
    105106    }
    106107
     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 */
     119function 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 ) {
    107128        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;
    108167}
    109168
     
    131190                        'frontblocks/grid-attributes',
    132191                        function( settings, name ) {
    133                             if ( name !== 'generateblocks/grid' ) {
     192                            if ( name !== 'generateblocks/grid' && name !== 'generateblocks/element' ) {
    134193                                return settings;
    135194                            }
     
    187246
    188247/**
    189  * Register custom attributes for GenerateBlocks Grid block.
     248 * Register custom attributes for GenerateBlocks Grid and Element blocks.
    190249 *
    191250 * @param array  $block_args The block arguments.
     
    195254 */
    196255function 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 ) {
    198257        return $block_args;
    199258    }
  • frontblocks/tags/1.0.1/readme.txt

    r3338168 r3349208  
    55Requires at least: 5.0
    66Tested up to: 6.8
    7 Stable tag: 1.0.0
    8 Version: 1.0.0
     7Stable tag: 1.0.1
     8Version: 1.0.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1414== Description ==
    1515
    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.
    3416**Carousel/Slider for GenerateBlocks Grid**
    3517We have added options to the Gutenberg blocks that allow you to create a carousel or slider with the blocks you want.
     
    8769
    8870== Changelog ==
     71= 1.0.1 =
     72*   Fixed: options for carousel/slider not showing.
     73
    8974= 1.0.0 =
    9075*   Added sticked option for Grid block.
     
    9378*   Added options in native gallery block.
    9479*   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.
    10180
    10281= 0.2.5 =
  • frontblocks/trunk/frontblocks.php

    r3338168 r3349208  
    22/**
    33 * Plugin Name: FrontBlocks for GeneratePress
    4  * Plugin URI:  https://github.com/closemarketing/frontblocks
     4 * Plugin URI:  https://wordpress.org/plugins/frontblocks/
    55 * Description: Blocks and helpers that extends GeneratePress blocks.
    6  * Version:     1.0.0
     6 * Version:     1.0.1
    77 * Author:      Closemarketing
    88 * Author URI:  https://close.marketing
     
    1212 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
    1313 *
    14  * Requires at least: 6.7
     14 * Requires at least: 5.0
    1515 * Requires PHP: 7.0
    1616 *
    1717 * @package     FrontBlocks
    1818 * @author      Closemarketing
    19  * @copyright   2023 Closemarketing
     19 * @copyright   2025 Closemarketing
    2020 * @license     GPL-2.0+
    2121 *
     
    2727defined( 'ABSPATH' ) || die( 'No script kiddies please!' );
    2828
    29 define( 'FRBL_VERSION', '1.0.0' );
     29define( 'FRBL_VERSION', '1.0.1' );
    3030define( 'FRBL_PLUGIN', __FILE__ );
    3131define( 'FRBL_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
  • frontblocks/trunk/includes/carousel/frontblocks-carousel.php

    r3338168 r3349208  
    6060
    6161add_filter( 'render_block_generateblocks/grid', 'frbl_add_custom_attributes_to_grid_block', 10, 2 );
    62 /**
    63  * Hook to filter the block output on frontend.
     62add_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.
    6465 *
    6566 * @param html  $block_content Block content.
     
    6970 */
    7071function 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';
    8182
    8283    // Example: Add data attributes to the wrapper div if carousel is enabled.
     
    105106    }
    106107
     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 */
     119function 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 ) {
    107128        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;
    108167}
    109168
     
    131190                        'frontblocks/grid-attributes',
    132191                        function( settings, name ) {
    133                             if ( name !== 'generateblocks/grid' ) {
     192                            if ( name !== 'generateblocks/grid' && name !== 'generateblocks/element' ) {
    134193                                return settings;
    135194                            }
     
    187246
    188247/**
    189  * Register custom attributes for GenerateBlocks Grid block.
     248 * Register custom attributes for GenerateBlocks Grid and Element blocks.
    190249 *
    191250 * @param array  $block_args The block arguments.
     
    195254 */
    196255function 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 ) {
    198257        return $block_args;
    199258    }
  • frontblocks/trunk/readme.txt

    r3338168 r3349208  
    55Requires at least: 5.0
    66Tested up to: 6.8
    7 Stable tag: 1.0.0
    8 Version: 1.0.0
     7Stable tag: 1.0.1
     8Version: 1.0.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1414== Description ==
    1515
    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.
    3416**Carousel/Slider for GenerateBlocks Grid**
    3517We have added options to the Gutenberg blocks that allow you to create a carousel or slider with the blocks you want.
     
    8769
    8870== Changelog ==
     71= 1.0.1 =
     72*   Fixed: options for carousel/slider not showing.
     73
    8974= 1.0.0 =
    9075*   Added sticked option for Grid block.
     
    9378*   Added options in native gallery block.
    9479*   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.
    10180
    10281= 0.2.5 =
Note: See TracChangeset for help on using the changeset viewer.