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 .github/workflows/quality-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.3
extensions: mbstring, intl

- name: Validate composer file
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
name: "Build project PHP"
uses: shivammathur/setup-php@v2
with:
php-version: 7.2
php-version: 8.3
- run: composer install --prefer-dist --no-dev -o --ignore-platform-reqs

- id: commit-and-push
Expand Down
2 changes: 0 additions & 2 deletions beapi-acf-palette.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
// Plugin constants
define( 'BEAPI_ACF_PALETTE_VERSION', '1.0.4' );
define( 'BEAPI_ACF_PALETTE_VIEWS_FOLDER_NAME', 'beapi-acf-palette' );
define( 'BEAPI_ACF_PALETTE_CPT_NAME', 'custom_post_type' );
define( 'BEAPI_ACF_PALETTE_TAXO_NAME', 'custom_taxonomy' );

// Plugin URL and PATH
define( 'BEAPI_ACF_PALETTE_URL', plugin_dir_url( __FILE__ ) );
Expand Down
8 changes: 4 additions & 4 deletions classes/ACF_Theme_Color_Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public function __construct() {
*/
public function render_field( $field ) {
$colors = Theme_Color_Field::get_theme_colors();
$exclude_colors = $field['exclude_colors'] ?? [];
$include_colors = $field['include_colors'] ?? [];
$exclude_colors = ! empty($field['exclude_colors']) ? $field['exclude_colors'] : [];
$include_colors = ! empty($field['include_colors']) ? $field['include_colors'] : [];
$color_filter = $field['color_filter'] ?? 'exclude';

// Filter colors based on the selected method
Expand Down Expand Up @@ -291,8 +291,8 @@ public function update_value( $value, $post_id, $field ) {
*/
public function load_value( $value, $post_id, $field ) {
$colors = Theme_Color_Field::get_theme_colors();
$exclude_colors = $field['exclude_colors'] ?? [];
$include_colors = $field['include_colors'] ?? [];
$exclude_colors = ! empty($field['exclude_colors']) ? $field['exclude_colors'] : [];
$include_colors = ! empty($field['include_colors']) ? $field['include_colors'] : [];
$color_filter = $field['color_filter'] ?? 'exclude';

// Filter colors based on the selected method
Expand Down
105 changes: 52 additions & 53 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "beapi/acf-palette",
"description": "Add a new theme color palette selector field for Advanced Custom Fields.",
"type": "wordpress-plugin",
"keywords": ["wordpress", "plugin", "acf", "fse", "theme.json", "color", "palette", "gutenberg", "editor"],
"license": "GPL-2.0-or-later",
"name": "beapi/acf-palette",
"description": "Add a new theme color palette selector field for Advanced Custom Fields.",
"type": "wordpress-plugin",
"keywords": ["wordpress", "plugin", "acf", "fse", "theme.json", "color", "palette", "gutenberg", "editor"],
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "BeAPI",
Expand All @@ -12,55 +12,54 @@
"role":"Company"
}
],
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"composer/installers": true,
"phpro/grumphp-shim": true
},
"platform": {
"php": "8.1.25"
}
},
"require": {
"php": "^8",
"ext-json": "*",
"composer/installers": "^1.0 || ^2.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"humanmade/psalm-plugin-wordpress": "^3.0",
"overtrue/phplint": "^3.4",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"phpro/grumphp-shim": "^1.5",
"roave/security-advisories": "dev-latest",
"vimeo/psalm": "^5.20",
"wp-coding-standards/wpcs": "^3.0",
"wp-phpunit/wp-phpunit": "^6.0",
"yoast/phpunit-polyfills": "^1.0"
},
"autoload": {
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"composer/installers": true,
"phpro/grumphp-shim": true
},
"platform": {
"php": "8.3.28"
}
},
"require": {
"php": "8.3.*",
"ext-json": "*",
"composer/installers": "^1.0 || ^2.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.2",
"humanmade/psalm-plugin-wordpress": "^2.0",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpcompatibility/php-compatibility": "^9.3",
"phpro/grumphp-shim": "^1.5",
"roave/security-advisories": "dev-latest",
"roots/wordpress-no-content": "^6.0",
"squizlabs/php_codesniffer": "^3.7",
"vimeo/psalm": "~4.23.0",
"wp-cli/wp-cli": "^2.6",
"wp-coding-standards/wpcs": "^3.0"
},
"autoload": {
"psr-4": {
"BEAPI\\Acf_Palette\\": "classes/"
}
},
"autoload-dev": {
},
"scripts": {
"cs": "./vendor/bin/phpcs",
"cb": "./vendor/bin/phpcbf",
"psalm": "./vendor/bin/psalm",
"phpunit": "phpunit"
},
"scripts-descriptions": {
"cs": "Run PHP CodeSniffer on codebase using custom ruleset.",
"cb": "Run PHP Code Beautifier and Fixer on codebase using custom ruleset.",
"psalm": "Run psalm on codebase using custom ruleset.",
"phpunit": "Run PHP unit tests."
}

},
"autoload-dev": {
},
"scripts": {
"cs": "./vendor/bin/phpcs",
"cb": "./vendor/bin/phpcbf",
"psalm": "./vendor/bin/psalm",
"phpunit": "phpunit"
},
"scripts-descriptions": {
"cs": "Run PHP CodeSniffer on codebase using custom ruleset.",
"cb": "Run PHP Code Beautifier and Fixer on codebase using custom ruleset.",
"psalm": "Run psalm on codebase using custom ruleset.",
"phpunit": "Run PHP unit tests."
}
}
Loading
Loading