Skip to content

Commit 0ddd96f

Browse files
authored
Merge pull request #2 from BeAPI/fix/composer
Fix/composer
2 parents 4c63052 + 7f509eb commit 0ddd96f

File tree

7 files changed

+792
-2852
lines changed

7 files changed

+792
-2852
lines changed

.github/workflows/quality-php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Setup PHP
2626
uses: shivammathur/setup-php@v2
2727
with:
28-
php-version: 7.4
28+
php-version: 8.3
2929
extensions: mbstring, intl
3030

3131
- name: Validate composer file

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
name: "Build project PHP"
4343
uses: shivammathur/setup-php@v2
4444
with:
45-
php-version: 7.2
45+
php-version: 8.3
4646
- run: composer install --prefer-dist --no-dev -o --ignore-platform-reqs
4747

4848
- id: commit-and-push

beapi-acf-palette.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
// Plugin constants
3838
define( 'BEAPI_ACF_PALETTE_VERSION', '1.0.4' );
3939
define( 'BEAPI_ACF_PALETTE_VIEWS_FOLDER_NAME', 'beapi-acf-palette' );
40-
define( 'BEAPI_ACF_PALETTE_CPT_NAME', 'custom_post_type' );
41-
define( 'BEAPI_ACF_PALETTE_TAXO_NAME', 'custom_taxonomy' );
4240

4341
// Plugin URL and PATH
4442
define( 'BEAPI_ACF_PALETTE_URL', plugin_dir_url( __FILE__ ) );

classes/ACF_Theme_Color_Field.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public function __construct() {
3636
*/
3737
public function render_field( $field ) {
3838
$colors = Theme_Color_Field::get_theme_colors();
39-
$exclude_colors = $field['exclude_colors'] ?? [];
40-
$include_colors = $field['include_colors'] ?? [];
39+
$exclude_colors = ! empty($field['exclude_colors']) ? $field['exclude_colors'] : [];
40+
$include_colors = ! empty($field['include_colors']) ? $field['include_colors'] : [];
4141
$color_filter = $field['color_filter'] ?? 'exclude';
4242

4343
// Filter colors based on the selected method
@@ -291,8 +291,8 @@ public function update_value( $value, $post_id, $field ) {
291291
*/
292292
public function load_value( $value, $post_id, $field ) {
293293
$colors = Theme_Color_Field::get_theme_colors();
294-
$exclude_colors = $field['exclude_colors'] ?? [];
295-
$include_colors = $field['include_colors'] ?? [];
294+
$exclude_colors = ! empty($field['exclude_colors']) ? $field['exclude_colors'] : [];
295+
$include_colors = ! empty($field['include_colors']) ? $field['include_colors'] : [];
296296
$color_filter = $field['color_filter'] ?? 'exclude';
297297

298298
// Filter colors based on the selected method

composer.json

Lines changed: 52 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "beapi/acf-palette",
3-
"description": "Add a new theme color palette selector field for Advanced Custom Fields.",
4-
"type": "wordpress-plugin",
5-
"keywords": ["wordpress", "plugin", "acf", "fse", "theme.json", "color", "palette", "gutenberg", "editor"],
6-
"license": "GPL-2.0-or-later",
2+
"name": "beapi/acf-palette",
3+
"description": "Add a new theme color palette selector field for Advanced Custom Fields.",
4+
"type": "wordpress-plugin",
5+
"keywords": ["wordpress", "plugin", "acf", "fse", "theme.json", "color", "palette", "gutenberg", "editor"],
6+
"license": "GPL-2.0-or-later",
77
"authors": [
88
{
99
"name": "BeAPI",
@@ -12,55 +12,54 @@
1212
"role":"Company"
1313
}
1414
],
15-
"config": {
16-
"optimize-autoloader": true,
17-
"preferred-install": "dist",
18-
"sort-packages": true,
19-
"allow-plugins": {
20-
"dealerdirect/phpcodesniffer-composer-installer": true,
21-
"composer/installers": true,
22-
"phpro/grumphp-shim": true
23-
},
24-
"platform": {
25-
"php": "8.1.25"
26-
}
27-
},
28-
"require": {
29-
"php": "^8",
30-
"ext-json": "*",
31-
"composer/installers": "^1.0 || ^2.0"
32-
},
33-
"require-dev": {
34-
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
35-
"humanmade/psalm-plugin-wordpress": "^3.0",
36-
"overtrue/phplint": "^3.4",
37-
"php-parallel-lint/php-parallel-lint": "^1.3",
38-
"phpcompatibility/phpcompatibility-wp": "^2.1",
39-
"phpro/grumphp-shim": "^1.5",
40-
"roave/security-advisories": "dev-latest",
41-
"vimeo/psalm": "^5.20",
42-
"wp-coding-standards/wpcs": "^3.0",
43-
"wp-phpunit/wp-phpunit": "^6.0",
44-
"yoast/phpunit-polyfills": "^1.0"
45-
},
46-
"autoload": {
15+
"config": {
16+
"optimize-autoloader": true,
17+
"preferred-install": "dist",
18+
"sort-packages": true,
19+
"allow-plugins": {
20+
"dealerdirect/phpcodesniffer-composer-installer": true,
21+
"composer/installers": true,
22+
"phpro/grumphp-shim": true
23+
},
24+
"platform": {
25+
"php": "8.3.28"
26+
}
27+
},
28+
"require": {
29+
"php": "8.3.*",
30+
"ext-json": "*",
31+
"composer/installers": "^1.0 || ^2.0"
32+
},
33+
"require-dev": {
34+
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.2",
35+
"humanmade/psalm-plugin-wordpress": "^2.0",
36+
"php-parallel-lint/php-parallel-lint": "^1.3",
37+
"phpcompatibility/php-compatibility": "^9.3",
38+
"phpro/grumphp-shim": "^1.5",
39+
"roave/security-advisories": "dev-latest",
40+
"roots/wordpress-no-content": "^6.0",
41+
"squizlabs/php_codesniffer": "^3.7",
42+
"vimeo/psalm": "~4.23.0",
43+
"wp-cli/wp-cli": "^2.6",
44+
"wp-coding-standards/wpcs": "^3.0"
45+
},
46+
"autoload": {
4747
"psr-4": {
4848
"BEAPI\\Acf_Palette\\": "classes/"
4949
}
50-
},
51-
"autoload-dev": {
52-
},
53-
"scripts": {
54-
"cs": "./vendor/bin/phpcs",
55-
"cb": "./vendor/bin/phpcbf",
56-
"psalm": "./vendor/bin/psalm",
57-
"phpunit": "phpunit"
58-
},
59-
"scripts-descriptions": {
60-
"cs": "Run PHP CodeSniffer on codebase using custom ruleset.",
61-
"cb": "Run PHP Code Beautifier and Fixer on codebase using custom ruleset.",
62-
"psalm": "Run psalm on codebase using custom ruleset.",
63-
"phpunit": "Run PHP unit tests."
64-
}
65-
50+
},
51+
"autoload-dev": {
52+
},
53+
"scripts": {
54+
"cs": "./vendor/bin/phpcs",
55+
"cb": "./vendor/bin/phpcbf",
56+
"psalm": "./vendor/bin/psalm",
57+
"phpunit": "phpunit"
58+
},
59+
"scripts-descriptions": {
60+
"cs": "Run PHP CodeSniffer on codebase using custom ruleset.",
61+
"cb": "Run PHP Code Beautifier and Fixer on codebase using custom ruleset.",
62+
"psalm": "Run psalm on codebase using custom ruleset.",
63+
"phpunit": "Run PHP unit tests."
64+
}
6665
}

0 commit comments

Comments
 (0)