Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .plugin-data
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "1.1.2",
"version": "1.1.3",
"slug": "blockparty-icons"
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ This plugin **doesn't run any sanitization on SVGs** before using them. Only use

## Changelog

### 1.1.3 - 2026-10-02

- Improved link editing with external link support and an edit button

### 1.1.2 - 2026-09-17

- Fix `beapi/icon-block` migration skipping icons that have a name but no collection (registry lookup then generic fallback)
Expand Down
4 changes: 2 additions & 2 deletions blockparty-icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Description: Provides blocks in WordPress editor to add custom SVG icons.
* Requires at least: 6.2
* Requires PHP: 8.1
* Version: 1.1.2
* Version: 1.1.3
* Author: Be API Technical Team
* Author URI: https://beapi.fr
* License: GPL-2.0-or-later
Expand All @@ -30,7 +30,7 @@
include_once __DIR__ . '/vendor/autoload.php';
}

define( 'BLOCKPARTY_ICONS_VERSION', '1.1.2' );
define( 'BLOCKPARTY_ICONS_VERSION', '1.1.3' );
define( 'BLOCKPARTY_ICONS_URL', plugin_dir_url( __FILE__ ) );
define( 'BLOCKPARTY_ICONS_DIR', plugin_dir_path( __FILE__ ) );
define( 'BLOCKPARTY_ICONS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
Expand Down
18 changes: 13 additions & 5 deletions includes/BlockRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ class BlockRenderer {
*/
public static function render( $attributes ) {
// Block attributes
$icon_data = $attributes['icon'] ?? [];
$radius = (string) ( $attributes['borderRadius'] ?? '0px' );
$link_url = (string) ( $attributes['url'] ?? '' );
$link_label = (string) ( $attributes['label'] ?? '' );
$icon_data = $attributes['icon'] ?? [];
$radius = (string) ( $attributes['borderRadius'] ?? '0px' );
$link_url = (string) ( $attributes['url'] ?? '' );
$link_label = (string) ( $attributes['label'] ?? '' );
$target_blank = ! empty( $attributes['targetBlank'] );

$collection_name = $icon_data['collection'] ?? null;
$icon_name = $icon_data['name'] ?? null;
Expand Down Expand Up @@ -52,10 +53,17 @@ public static function render( $attributes ) {

// Start block link
if ( ! empty( $link_url ) ) {
$link_attrs = '';
if ( ! empty( $link_label ) ) {
$link_attrs .= sprintf( ' aria-label="%s"', esc_attr( $link_label ) );
}
if ( $target_blank ) {
$link_attrs .= ' target="_blank" rel="noopener noreferrer"';
}
$html .= sprintf(
'<a class="wp-block-blockparty-icon__link" href="%s"%s>',
esc_url( $link_url ),
! empty( $link_label ) ? sprintf( ' aria-label="%s"', esc_attr( $link_label ) ) : ''
$link_attrs
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"translation-revision-date":"2026-06-25 08:38+0200","generator":"WP-CLI\/2.11.0","source":"build\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fr_FR","plural-forms":"nplurals=2; plural=(n != 1);"},"No name icon":["Ic\u00f4ne sans nom"],"Icon pagination":["Pagination des ic\u00f4nes"],"Previous page":["Page pr\u00e9c\u00e9dente"],"Previous":["Pr\u00e9c\u00e9dent"],"Page %d":["Page %d"],"Next page":["Page suivante"],"Next":["Suivant"],"Select an icon from your collections":["S\u00e9lectionnez une ic\u00f4ne dans vos collections"],"Search an icon":["Recherche une ic\u00f4ne"],"wordpress, heart, star\u2026":["wordpress, coeur, etoile\u2026"],"Hide settings":["Masquer les r\u00e9glages"],"Open settings":["Afficher les r\u00e9glages"],"Modal settings":["R\u00e9glages de la modale"],"Display":["Affichage"],"Preview of icon sizes":["Aper\u00e7u de la taille des ic\u00f4nes"],"Adjust preview size of the icons.":["Ajuster la taille de pr\u00e9visualisation des ic\u00f4nes."],"Pager":["Pagination"],"Icons per page":["Ic\u00f4nes par page"],"Number of icons displayed per page.":["Nombre d\u2019ic\u00f4nes \u00e0 afficher par page."],"No icons found matching your search.":["Aucune ic\u00f4ne trouv\u00e9e selon vos crit\u00e8res de recherche."],"%1$s (%2$d)":["%1$s (%2$d)"],"Icon color":["Couleur de l\u2019ic\u00f4ne"],"Add an icon":["Ajouter une ic\u00f4ne"],"Remove link":["Retirer le lien"],"Add a link":["Ajouter un lien"],"Replace icon":["Remplacer l\u2019ic\u00f4ne"],"Remove icon":["Retirer l\u2019ic\u00f4ne"],"Label of %s":["Libell\u00e9 de %s"],"Link label":["Libell\u00e9 du lien"],"Briefly describe the link to help screen reader users.":["D\u00e9crivez bri\u00e8vement le lien destin\u00e9 aux utilisateurs de lecteurs d'\u00e9cran."],"Icon radius":["Arrondis de l\u2019ic\u00f4ne"],"Icon size":["Taille de l\u2019ic\u00f4ne"],"Adjust the size of the icon (value in pixels)":["Ajustez la taille de l\u2019ic\u00f4ne (valeur en pixels)"]}}}
{"translation-revision-date":"2026-10-02 10:57+0200","generator":"WP-CLI\/2.12.0","source":"build\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fr_FR","plural-forms":"nplurals=2; plural=(n != 1);"},"No name icon":["Ic\u00f4ne sans nom"],"Icon pagination":["Pagination des ic\u00f4nes"],"Previous page":["Page pr\u00e9c\u00e9dente"],"Previous":["Pr\u00e9c\u00e9dent"],"Page %d":["Page %d"],"Next page":["Page suivante"],"Next":["Suivant"],"Select an icon from your collections":["S\u00e9lectionnez une ic\u00f4ne dans vos collections"],"Search an icon":["Recherche une ic\u00f4ne"],"wordpress, heart, star\u2026":["wordpress, coeur, etoile\u2026"],"Hide settings":["Masquer les r\u00e9glages"],"Open settings":["Afficher les r\u00e9glages"],"Modal settings":["R\u00e9glages de la modale"],"Display":["Affichage"],"Preview of icon sizes":["Aper\u00e7u de la taille des ic\u00f4nes"],"Adjust preview size of the icons.":["Ajuster la taille de pr\u00e9visualisation des ic\u00f4nes."],"Pager":["Pagination"],"Icons per page":["Ic\u00f4nes par page"],"Number of icons displayed per page.":["Nombre d\u2019ic\u00f4nes \u00e0 afficher par page."],"No icons found matching your search.":["Aucune ic\u00f4ne trouv\u00e9e selon vos crit\u00e8res de recherche."],"%1$s (%2$d)":["%1$s (%2$d)"],"Open in a new tab":["Ouvrir dans un nouvel onglet"],"Icon color":["Couleur de l\u2019ic\u00f4ne"],"Add an icon":["Ajouter une ic\u00f4ne"],"Edit link":["Modifier le lien"],"Remove link":["Retirer le lien"],"Add a link":["Ajouter un lien"],"Replace icon":["Remplacer l\u2019ic\u00f4ne"],"Remove icon":["Retirer l\u2019ic\u00f4ne"],"Label of %s":["Libell\u00e9 de %s"],"Link label":["Libell\u00e9 du lien"],"Briefly describe the link to help screen reader users.":["D\u00e9crivez bri\u00e8vement le lien destin\u00e9 aux utilisateurs de lecteurs d'\u00e9cran."],"Icon radius":["Arrondis de l\u2019ic\u00f4ne"],"Icon size":["Taille de l\u2019ic\u00f4ne"],"Adjust the size of the icon (value in pixels)":["Ajustez la taille de l\u2019ic\u00f4ne (valeur en pixels)"]}}}
Binary file modified languages/blockparty-icons-fr_FR.mo
Binary file not shown.
14 changes: 11 additions & 3 deletions languages/blockparty-icons-fr_FR.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ msgstr ""
"Project-Id-Version: Blockparty Icons 1.0.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/blockparty-"
"icons\n"
"POT-Creation-Date: 2026-06-25T06:37:19+00:00\n"
"PO-Revision-Date: 2026-06-25 08:38+0200\n"
"POT-Creation-Date: 2026-10-02T08:52:14+00:00\n"
"PO-Revision-Date: 2026-10-02 10:57+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr_FR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.9\n"
"X-Generator: Poedit 3.6\n"
"X-Domain: blockparty-icons\n"

#. Plugin Name of the plugin
Expand Down Expand Up @@ -164,6 +164,10 @@ msgstr "Aucune icône trouvée selon vos critères de recherche."
msgid "%1$s (%2$d)"
msgstr "%1$s (%2$d)"

#: build/index.js:3
msgid "Open in a new tab"
msgstr "Ouvrir dans un nouvel onglet"

#: build/index.js:3
msgid "Icon color"
msgstr "Couleur de l’icône"
Expand All @@ -172,6 +176,10 @@ msgstr "Couleur de l’icône"
msgid "Add an icon"
msgstr "Ajouter une icône"

#: build/index.js:3
msgid "Edit link"
msgstr "Modifier le lien"

#: build/index.js:3
msgid "Remove link"
msgstr "Retirer le lien"
Expand Down
17 changes: 14 additions & 3 deletions languages/blockparty-icons.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
# This file is distributed under the GPL-2.0-or-later.
msgid ""
msgstr ""
"Project-Id-Version: Blockparty Icons 1.0.7\n"
"Project-Id-Version: Blockparty Icons 1.1.2\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/blockparty-icons\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2026-06-25T06:37:19+00:00\n"
"POT-Creation-Date: 2026-10-02T08:52:14+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.11.0\n"
"X-Generator: WP-CLI 2.12.0\n"
"X-Domain: blockparty-icons\n"

#. Plugin Name of the plugin
Expand Down Expand Up @@ -92,6 +92,7 @@ msgstr ""

#. translators: %d: page number
#: build/index.js:2
#, js-format
msgid "Page %d"
msgstr ""

Expand Down Expand Up @@ -157,9 +158,14 @@ msgstr ""

#. translators: 1: collection name, 2: number of results
#: build/index.js:3
#, js-format
msgid "%1$s (%2$d)"
msgstr ""

#: build/index.js:3
msgid "Open in a new tab"
msgstr ""

#: build/index.js:3
msgid "Icon color"
msgstr ""
Expand All @@ -168,6 +174,10 @@ msgstr ""
msgid "Add an icon"
msgstr ""

#: build/index.js:3
msgid "Edit link"
msgstr ""

#: build/index.js:3
msgid "Remove link"
msgstr ""
Expand All @@ -186,6 +196,7 @@ msgstr ""

#. translators: %s: name of the icon name.
#: build/index.js:4
#, js-format
msgid "Label of %s"
msgstr ""

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blockparty-icons",
"version": "1.1.2",
"version": "1.1.3",
"description": "Provides blocks in WordPress editor to add custom SVG icons from your theme.",
"author": "Be API Technical team",
"license": "GPL-2.0-or-later",
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: block, icons, svg, gutenberg, editor
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 8.1
Stable tag: 1.1.2
Stable tag: 1.1.3
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -36,6 +36,9 @@ Yes. Register a collection with `type` set to `folder` and `source` pointing to

== Changelog ==

= 1.1.3 =
* Improved link editing with external link support and an edit button

= 1.1.2 =
* Fix `beapi/icon-block` migration skipping icons that have a name but no collection (registry lookup then generic fallback).
* Load an icon's SVG only when it is used. Registering a collection now builds a lightweight index, so a front-end page no longer holds every icon of every collection in memory.
Expand Down
6 changes: 5 additions & 1 deletion src/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "blockparty/icon",
"version": "1.1.2",
"version": "1.1.3",
"title": "Icon",
"category": "widgets",
"description": "Easily add custom vector icon to your content.",
Expand Down Expand Up @@ -51,6 +51,10 @@
},
"label": {
"type": "string"
},
"targetBlank": {
"type": "boolean",
"default": false
}
},
"textdomain": "blockparty-icons",
Expand Down
79 changes: 46 additions & 33 deletions src/components/link-url-popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import {
store as blockEditorStore,
} from '@wordpress/block-editor';
import { __ } from '@wordpress/i18n';
import { Button } from '@wordpress/components';
import { Button, ToggleControl } from '@wordpress/components';
import { keyboardReturn } from '@wordpress/icons';

export default function SocialLinkURLPopover( {
url,
targetBlank,
setAttributes,
setPopover,
popoverAnchor,
Expand All @@ -25,42 +26,54 @@ export default function SocialLinkURLPopover( {
anchor={ popoverAnchor }
onClose={ () => setPopover( false ) }
>
<form
className="block-editor-url-popover__link-editor"
onSubmit={ ( event ) => {
event.preventDefault();
setPopover( false );
} }
>
<div className="block-editor-url-input">
<URLInput
<div className="blockparty-icons-link-url-popover">
<form
className="blockparty-icons-link-url-popover__form block-editor-url-popover__link-editor"
onSubmit={ ( event ) => {
event.preventDefault();
setPopover( false );
} }
>
<div className="block-editor-url-input">
<URLInput
__nextHasNoMarginBottom
value={ url }
onChange={ ( nextURL ) =>
setAttributes( { url: nextURL } )
}
placeholder={ __( 'Enter address' ) }
disableSuggestions={ true }
onKeyDown={ ( event ) => {
if (
!! url ||
event.defaultPrevented ||
! [ BACKSPACE, DELETE ].includes(
event.keyCode
)
) {
return;
}
removeBlock( clientId );
} }
/>
</div>
<Button
icon={ keyboardReturn }
label={ __( 'Apply' ) }
type="submit"
/>
</form>
<div className="blockparty-icons-link-url-popover__settings">
<ToggleControl
__nextHasNoMarginBottom
value={ url }
onChange={ ( nextURL ) =>
setAttributes( { url: nextURL } )
label={ __( 'Open in a new tab', 'blockparty-icons' ) }
checked={ !! targetBlank }
onChange={ ( value ) =>
setAttributes( { targetBlank: value } )
}
placeholder={ __( 'Enter address' ) }
disableSuggestions={ true }
onKeyDown={ ( event ) => {
if (
!! url ||
event.defaultPrevented ||
! [ BACKSPACE, DELETE ].includes(
event.keyCode
)
) {
return;
}
removeBlock( clientId );
} }
/>
</div>
<Button
icon={ keyboardReturn }
label={ __( 'Apply' ) }
type="submit"
/>
</form>
</div>
</URLPopover>
);
}
Loading
Loading