Plugin Directory

Changeset 3486789


Ignore:
Timestamp:
03/19/2026 07:27:57 PM (2 weeks ago)
Author:
rstake
Message:

Remove legacy tg_gallery shortcode, add Tested up to header, internationalize block editor, fix asset version

Location:
sdaweb-social-galleri-feed/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sdaweb-social-galleri-feed/trunk/assets/js/block-editor.asset.php

    r3483261 r3486789  
    22// Asset dependencies for the block editor script (no build step).
    33return array(
    4     'dependencies' => array( 'wp-blocks', 'wp-element', 'wp-block-editor', 'wp-components', 'wp-server-side-render' ),
    5     'version'      => defined( 'SDAWSOGA_VERSION' ) ? SDAWSOGA_VERSION : '4.10.0',
     4    'dependencies' => array( 'wp-blocks', 'wp-element', 'wp-block-editor', 'wp-components', 'wp-server-side-render', 'wp-i18n' ),
     5    'version'      => defined( 'SDAWSOGA_VERSION' ) ? SDAWSOGA_VERSION : '4.10.1',
    66);
  • sdaweb-social-galleri-feed/trunk/assets/js/block-editor.js

    r3483261 r3486789  
    55 * No build step required — uses wp.element.createElement directly.
    66 */
    7 (function(blocks, element, blockEditor, components, serverSideRender) {
     7(function(blocks, element, blockEditor, components, serverSideRender, i18n) {
    88    var el = element.createElement;
     9    var __ = i18n.__;
    910    var InspectorControls = blockEditor.InspectorControls;
    1011    var PanelBody = components.PanelBody;
     
    2122            return el(element.Fragment, null,
    2223                el(InspectorControls, null,
    23                     el(PanelBody, { title: 'Feed Settings', initialOpen: true },
     24                    el(PanelBody, { title: __('Feed Settings', 'sdaweb-social-galleri-feed'), initialOpen: true },
    2425                        el(TextControl, {
    25                             label: 'Feed ID',
    26                             help: 'Unique identifier for this feed instance.',
     26                            label: __('Feed ID', 'sdaweb-social-galleri-feed'),
     27                            help: __('Unique identifier for this feed instance.', 'sdaweb-social-galleri-feed'),
    2728                            value: attrs.feedId,
    2829                            onChange: function(v) { props.setAttributes({ feedId: v }); }
    2930                        }),
    3031                        el(RangeControl, {
    31                             label: 'Posts to show',
     32                            label: __('Posts to show', 'sdaweb-social-galleri-feed'),
    3233                            value: attrs.limit,
    3334                            onChange: function(v) { props.setAttributes({ limit: v }); },
     
    3536                        }),
    3637                        el(RangeControl, {
    37                             label: 'Columns',
     38                            label: __('Columns', 'sdaweb-social-galleri-feed'),
    3839                            value: attrs.columns,
    3940                            onChange: function(v) { props.setAttributes({ columns: v }); },
     
    4142                        }),
    4243                        el(SelectControl, {
    43                             label: 'Layout',
     44                            label: __('Layout', 'sdaweb-social-galleri-feed'),
    4445                            value: attrs.layout,
    4546                            options: [
    46                                 { label: 'Default (from settings)', value: '' },
    47                                 { label: 'Grid', value: 'grid' },
    48                                 { label: 'Masonry', value: 'masonry' },
    49                                 { label: 'Highlight', value: 'highlight' }
     47                                { label: __('Default (from settings)', 'sdaweb-social-galleri-feed'), value: '' },
     48                                { label: __('Grid', 'sdaweb-social-galleri-feed'), value: 'grid' },
     49                                { label: __('Masonry', 'sdaweb-social-galleri-feed'), value: 'masonry' },
     50                                { label: __('Highlight', 'sdaweb-social-galleri-feed'), value: 'highlight' }
    5051                            ],
    5152                            onChange: function(v) { props.setAttributes({ layout: v }); }
    5253                        }),
    5354                        el(SelectControl, {
    54                             label: 'Aspect Ratio',
     55                            label: __('Aspect Ratio', 'sdaweb-social-galleri-feed'),
    5556                            value: attrs.aspectRatio,
    5657                            options: [
    57                                 { label: 'Default (from settings)', value: '' },
    58                                 { label: 'Square (1:1)', value: 'square' },
    59                                 { label: 'Instagram (4:5)', value: 'instagram' },
    60                                 { label: 'Portrait (4:5)', value: 'portrait' },
    61                                 { label: 'Original', value: 'original' }
     58                                { label: __('Default (from settings)', 'sdaweb-social-galleri-feed'), value: '' },
     59                                { label: __('Square (1:1)', 'sdaweb-social-galleri-feed'), value: 'square' },
     60                                { label: __('Instagram (4:5)', 'sdaweb-social-galleri-feed'), value: 'instagram' },
     61                                { label: __('Portrait (4:5)', 'sdaweb-social-galleri-feed'), value: 'portrait' },
     62                                { label: __('Original', 'sdaweb-social-galleri-feed'), value: 'original' }
    6263                            ],
    6364                            onChange: function(v) { props.setAttributes({ aspectRatio: v }); }
    6465                        })
    6566                    ),
    66                     el(PanelBody, { title: 'Display Options', initialOpen: false },
     67                    el(PanelBody, { title: __('Display Options', 'sdaweb-social-galleri-feed'), initialOpen: false },
    6768                        el(ToggleControl, {
    68                             label: 'Show header',
     69                            label: __('Show header', 'sdaweb-social-galleri-feed'),
    6970                            checked: attrs.showHeader,
    7071                            onChange: function(v) { props.setAttributes({ showHeader: v }); }
    7172                        }),
    7273                        el(ToggleControl, {
    73                             label: 'Show Load More button',
     74                            label: __('Show Load More button', 'sdaweb-social-galleri-feed'),
    7475                            checked: attrs.showLoadmore,
    7576                            onChange: function(v) { props.setAttributes({ showLoadmore: v }); }
    7677                        })
    7778                    ),
    78                     el(PanelBody, { title: 'Filtering', initialOpen: false },
     79                    el(PanelBody, { title: __('Filtering', 'sdaweb-social-galleri-feed'), initialOpen: false },
    7980                        el(TextControl, {
    80                             label: 'Hashtag filter',
    81                             help: 'Only show posts with this hashtag.',
     81                            label: __('Hashtag filter', 'sdaweb-social-galleri-feed'),
     82                            help: __('Only show posts with this hashtag.', 'sdaweb-social-galleri-feed'),
    8283                            value: attrs.hashtag,
    8384                            onChange: function(v) { props.setAttributes({ hashtag: v }); }
    8485                        }),
    8586                        el(TextControl, {
    86                             label: 'Exclude hashtags',
    87                             help: 'Comma-separated hashtags to exclude.',
     87                            label: __('Exclude hashtags', 'sdaweb-social-galleri-feed'),
     88                            help: __('Comma-separated hashtags to exclude.', 'sdaweb-social-galleri-feed'),
    8889                            value: attrs.excludeHashtags,
    8990                            onChange: function(v) { props.setAttributes({ excludeHashtags: v }); }
     
    105106                        },
    106107                            el('div', { style: { fontSize: '36px', marginBottom: '8px' } }, '\uD83D\uDDBC'),
    107                             el('p', { style: { margin: 0 } }, 'Social Galleri Feed'),
    108                             el('p', { style: { margin: '4px 0 0', fontSize: '12px' } }, 'Configure your feed in the sidebar settings.')
     108                            el('p', { style: { margin: 0 } }, __('Social Galleri Feed', 'sdaweb-social-galleri-feed')),
     109                            el('p', { style: { margin: '4px 0 0', fontSize: '12px' } }, __('Configure your feed in the sidebar settings.', 'sdaweb-social-galleri-feed'))
    109110                        );
    110111                    }
     
    121122    window.wp.blockEditor,
    122123    window.wp.components,
    123     window.wp.serverSideRender
     124    window.wp.serverSideRender,
     125    window.wp.i18n
    124126));
  • sdaweb-social-galleri-feed/trunk/includes/class-api-handler.php

    r3483261 r3486789  
    5050            'methods' => 'GET',
    5151            'callback' => [__CLASS__, 'rest_fetch_data'],
    52             'permission_callback' => '__return_true',
     52            'permission_callback' => '__return_true', // Public read-only endpoint — serves cached feed data, no data modification
    5353        ]);
    5454    }
  • sdaweb-social-galleri-feed/trunk/sdaweb-social-galleri-feed.php

    r3483311 r3486789  
    66 * Requires at least: 5.8
    77 * Requires PHP: 7.4
     8 * Tested up to: 6.9
    89 * Author: SDAweb - Rune Stavdal, Vinjar Romsvik, Christer Andvik
    910 * Author URI: https://sdaweb.no
     
    272273        // Shortcode
    273274        add_shortcode('sdawsoga_gallery', ['SDAWSOGA_Gallery_Renderer', 'render_shortcode']);
    274         add_shortcode('tg_gallery', ['SDAWSOGA_Gallery_Renderer', 'render_shortcode']); // Legacy alias (pre-4.6)
    275275       
    276276        // Initialize admin if in admin area
Note: See TracChangeset for help on using the changeset viewer.