Skip to content

Commit

Permalink
[SAC] Feedback (#163)
Browse files Browse the repository at this point in the history
* [N/A] Set Default JSX Block Render Template, Remove unneeded files

* [N/A] Add Plain Button Style

* [N/A] Media Position & Block Visibility

* [N/A] Mobile Menu Adjustments

* [N/A] Adjust default page template

* [N/A] Some Bug Fixes

* [N/A] Misc Feedback items/improvements

* [N/A] More features/updates

* [N/A] Forgot one important update!
  • Loading branch information
bd-viget authored Jan 3, 2025
1 parent dcc5167 commit 90f3795
Show file tree
Hide file tree
Showing 52 changed files with 784 additions and 544 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@
padding: 5px 20px;
text-decoration: none;
}

.acf-block > .acf-innerblocks-container:first-child {
display: contents;
}
16 changes: 7 additions & 9 deletions wp-content/plugins/acf-blocks-toolkit/acf-blocks-toolkit.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: ACF Blocks Toolkit
* Plugin URI: https://viget.com
* Description: ACF Block Registration and Helper functions.
* Version: 1.0.3
* Version: 1.0.4
* Requires at least: 5.7
* Requires PHP: 8.1
* Requires Plugins: advanced-custom-fields-pro
Expand All @@ -17,12 +17,8 @@
* @package ACFBlocksToolkit
*/

use Viget\ACFBlocksToolkit\BlockIcons;
use Viget\ACFBlocksToolkit\BlockRegistration;
use Viget\ACFBlocksToolkit\Settings;

// Plugin version.
const ACFBT_VERSION = '1.0.3';
const ACFBT_VERSION = '1.0.4';

// Plugin path.
define( 'ACFBT_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
Expand Down Expand Up @@ -51,6 +47,8 @@
// Block Icons support.
require_once 'src/classes/BlockIcons.php';

BlockRegistration::init();
Settings::init();
new BlockIcons();
// Breakpoint Visibility support.
require_once 'src/classes/BreakpointVisibility.php';

// Initialize the plugin.
acfbt();
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-dom-ready', 'wp-edit-post', 'wp-edit-site', 'wp-hooks', 'wp-i18n'), 'version' => 'dd313b9f0c3f3ebbcc45');
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-edit-site', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '2c695b1a054762b3fa76');
2 changes: 1 addition & 1 deletion wp-content/plugins/acf-blocks-toolkit/build/index.js

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

Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => '5d72acf79d0a162b91fd');
<?php return array('dependencies' => array(), 'version' => 'cdd6e5bc1cc311f24a2b');
2 changes: 1 addition & 1 deletion wp-content/plugins/acf-blocks-toolkit/build/style.css

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

4 changes: 2 additions & 2 deletions wp-content/plugins/acf-blocks-toolkit/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 wp-content/plugins/acf-blocks-toolkit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "acf-blocks-toolkit",
"version": "1.0.3",
"version": "1.0.4",
"description": "ACF Block support and button icons.",
"author": "Viget",
"license": "GPL-2.0-or-later",
Expand Down
22 changes: 20 additions & 2 deletions wp-content/plugins/acf-blocks-toolkit/src/classes/BlockIcons.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public function get_supported_blocks(): array {
'core/home-link',
'core/post-excerpt',
'core/read-more',
'core/query-pagination-next',
'core/query-pagination-previous',
]
);
}
Expand Down Expand Up @@ -338,6 +340,15 @@ private function editor_css(): string {
]
);

$selectors2 = apply_filters(
'acfbt_button_icons_editor_css_selectors2',
[
'.wp-block-read-more',
'.wp-block-query-pagination-next',
'.wp-block-query-pagination-previous',
]
);

foreach ( $icons as $icon ) {
$slug = $icon['value'];
$content = 'data:image/svg+xml;utf8,' . rawurlencode( $icon['icon'] );
Expand All @@ -347,8 +358,15 @@ private function editor_css(): string {
$css .= ".has-icon__{$slug} $selector::before,";
}

$css .= ".has-icon__{$slug}.wp-block-read-more::after,";
$css .= ".has-icon__{$slug}.wp-block-read-more::before {";
foreach ( $selectors2 as $index => $selector ) {
$css .= ".has-icon__{$slug}{$selector}::after,";
$css .= ".has-icon__{$slug}{$selector}::before";
if ( $index < count( $selectors2 ) - 1 ) {
$css .= ',';
} else {
$css .= '{';
}
}

$css .= 'height: 0.7em;';
$css .= 'width: 1em;';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ function ( array $metadata ): array {
return;
}

$render = ACFBT_PLUGIN_PATH . '/views/default.php';
if ( ! empty( $block['supports']['jsx'] ) ) {
$render = ACFBT_PLUGIN_PATH . '/views/jsx.php';
} else {
$render = ACFBT_PLUGIN_PATH . '/views/default.php';
}
}

require $render;
Expand Down
Loading

0 comments on commit 90f3795

Please sign in to comment.