Skip to content

Commit

Permalink
Merge pull request #7268 from pods-framework/release/3.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0ttkclark committed Mar 25, 2024
2 parents a45cf6f + c7c89ae commit 6b82a85
Show file tree
Hide file tree
Showing 48 changed files with 1,013 additions and 195 deletions.
1 change: 1 addition & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Export ignore handling

# Directories
/.git
/.github
/.wordpress-org
/bin
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ tests/_support/_generated/* linguist-generated=true
# Export ignore handling

# Directories
/.git export-ignore
/.github export-ignore
/.wordpress-org export-ignore
/bin export-ignore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prepare-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
description: 'New plugin version (without the "-a-1"), defaults to the next incremental version from package.json'
required: false
version_increment:
description: 'Version increment scheme (if incrementing the package.json version)'
description: 'OR Version increment scheme (if incrementing the package.json version; patch=x.x.x, minor=x.x, major=x.0)'
required: true
type: choice
default: 'patch'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wordpress-plugin-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
with:
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }}
slack-channel: C02SWND14
slack-text: The pods tag has been deployed to svn.wordpress.org 🎉
slack-text: The ${{ github.event.repository.name }} tag has been deployed to svn.wordpress.org 🎉
20 changes: 20 additions & 0 deletions .github/workflows/wordpress-version-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "WordPress version checker"
on:
push:
branches:
- main
- release/*
schedule:
- cron: '0 0 * * *'

permissions:
issues: write

jobs:
wordpress-version-checker:
runs-on: ubuntu-latest
steps:
- name: WordPress version checker
uses: skaut/wordpress-version-checker@v1.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
37 changes: 37 additions & 0 deletions .wordpress-org/blueprints/blueprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"landingPage": "\/wp-admin\/admin.php?page=pods&pods_wasm_demo=1",
"preferredVersions": {
"php": "8.0",
"wp": "latest"
},
"phpExtensionBundles": [
"kitchen-sink"
],
"features": {
"networking": true
},
"steps": [
{
"step": "installPlugin",
"pluginZipFile": {
"resource": "wordpress.org\/plugins",
"slug": "pods"
},
"options": {
"activate": true
}
},
{
"step": "installTheme",
"themeZipFile": {
"resource": "wordpress.org\/themes",
"slug": "raft"
}
},
{
"step": "login",
"username": "admin",
"password": "password"
}
]
}
30 changes: 30 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,36 @@ Found a bug? Have a great feature idea? Get on GitHub and tell us about it and w

Our GitHub has the full list of all prior releases of Pods: https://github.com/pods-framework/pods/releases

= 3.2.0 - March 25th, 2024 =

* Feature: New support for Custom Field revisions in Pods that are Post Types that use Meta storage. You can optionally enable the feature per-pod or per-field. #7265 (@sc0ttkclark)
* Feature: New support for WordPress `register_meta()` for all Pods fields on meta-based Pods. You can enable this feature in Pods Admin > Settings > "Register meta fields". (@sc0ttkclark)
* Feature: New support for specifying where your Custom Fields show in REST API responses for Pods that support that. You can choose from Object (response.field_name) or Meta (response.meta.field_name). (@sc0ttkclark)
* Feature: New support for Custom Fields in the new [WordPress 6.5 Block Bindings API](https://make.wordpress.org/core/2024/03/06/new-feature-the-block-bindings-api/) for the `core/post-meta` source. To use your custom fields there, you will need to enable "Register meta fields" in your Pods Admin > Settings and set your Pod to show it's REST API fields in the "Meta" location instead of Object. (@sc0ttkclark)
* Feature: New custom binding source support for the [WordPress 6.5 Block Bindings API](https://make.wordpress.org/core/2024/03/06/new-feature-the-block-bindings-api/). Specify your source as `pods/bindings-field` and then just pass the same arguments you would pass for a normal `[pods]` shortcode or block. This will bind that dynamic output to the block you are working with. (@sc0ttkclark)
* Feature: Now you can specify whether to default values for a Pods field when the field is empty. This works great for when you add a new field to a Pod and you want to edit an existing item that did not have a field value set. The default value will be used in that circumstance. (@sc0ttkclark)
* Feature: Support for multiple default values when working with a multi-select field. Now you can just separate your values with a comma and they will be set as the default values. (@sc0ttkclark)
* Feature: Now you can specify whether to evaluate magic tags for default values like `{@user.ID}`. (@sc0ttkclark)
* Tweak: New option for Pods shortcodes when used in plugins like Elementor to bypass detecting the loop and to just use whatever ID/post type is available. Use the `bypass_detect_loop="1"` attribute. #7269 (@sc0ttkclark)
* Tweak: Added first used and last installed Pods versions to the Site Health information to be more helpful with debugging. (@sc0ttkclark)
* Tweak: Improved the field label/description for Additional User Capabilities field in the CPT settings. (@sc0ttkclark)
* Fixed: Resolved an annoying issue when adding a new group or field where it would reset the Pod label to the name (slug) of the pod. (@sc0ttkclark)
* Fixed: Updated logic for default value handling when using magic tags for internal field configs to ensure the magic tags get evaluated. (@sc0ttkclark)
* Fixed: Resolve issue with `pods_register_block_type()` not clearing the known blocks cache when registering them. #7167 (@sc0ttkclark)
* Fixed: PHP fatal errors resolved with `array_combine()` usage from changes in WP 6.5. #7266 (@sc0ttkclark)
* Fixed: Custom capability fallbacks when the option is empty now properly fallback to the default capability using that post type name. #7250 (@JoryHogeveen)
* Fixed: PHP deprecated notice with `trim()`. (@sc0ttkclark)
* Fixed: Resolved plupload browse button references to prevent JS console errors. (@sc0ttkclark)
* Fixed: Resolved issue with `window.wpEditorL10n` calls to more safely check for it to prevent JS console errors. (@sc0ttkclark)
* Fixed: Updated the implementation of the compatibility hooks for `set_transient` and `setted_transient` hooks have the proper args expected sent. (@sc0ttkclark)
* Fixed: Empty REST API fields no longer show when the pod doesn't support REST API. (@sc0ttkclark)
* Fixed: Restrict/unrestrict dynamic features logic now properly updates all of the associated Pod settings it needs to in the Access Rights Review screen. (@sc0ttkclark)
* Fixed: Empty arrays now return correctly in Pod / Group / Field settings instead of using their defaults when empty. (@sc0ttkclark)
* Fixed: Resolve potential issues with REST API in certain circumstances which would throw exceptions with the Pods REST API Messages object. (@sc0ttkclark)
* Fixed: Resolve issues when duplicating pods where the new pod name is over the limit and prevents creating the new pod correctly. (@sc0ttkclark)
* Fixed: Access Rights Review notice now only shows on existing installs updating from pre-3.1 instead of showing on new 3.1+ installs too. (@sc0ttkclark)
* Fixed: Accessibility issues with tabbing resolved for Pods Admin > Edit Pods table and Pods Admin > Edit Pod fields list table when working with row actions. #7196 #7198 (@heybran, @sc0ttkclark)

= 3.1.4 - February 28th, 2024 =

* Fixed: Defaults now show correctly for checkbox groups in the Edit Field modals. (@sc0ttkclark)
Expand Down
3 changes: 2 additions & 1 deletion classes/Pods.php
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,8 @@ public function field( $name, $single = null, $raw = false ) {
$params->single = (boolean) $params->single;
}

$params->name = trim( $params->name );
$params->name = trim( (string) $params->name );

if ( is_array( $params->name ) || '' === $params->name ) {
return null;
}
Expand Down
58 changes: 44 additions & 14 deletions classes/PodsAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -899,9 +899,10 @@ public function get_wp_object_fields( $object = 'post_type', $pod = null, $refre
'pick_data_storage' => 'object',
'pick_output' => 'ids',
'options' => [
'pick_format_type' => 'single',
'pick_format_single' => 'autocomplete',
'default_value' => '{@user.ID}',
'pick_format_type' => 'single',
'pick_format_single' => 'autocomplete',
'default_value' => '{@user.ID}',
'default_evaluate_tags' => 1,
],
],
'post_date' => [
Expand Down Expand Up @@ -2127,13 +2128,14 @@ public function save_pod( $params, $sanitized = false, $db = true ) {
'datetime_time_format' => 'h_mm_ss_A',
],
'author' => [
'name' => 'author',
'label' => 'Author',
'type' => 'pick',
'pick_object' => 'user',
'pick_format_type' => 'single',
'pick_format_single' => 'autocomplete',
'default_value' => '{@user.ID}',
'name' => 'author',
'label' => 'Author',
'type' => 'pick',
'pick_object' => 'user',
'pick_format_type' => 'single',
'pick_format_single' => 'autocomplete',
'default_value' => '{@user.ID}',
'default_evaluate_tags' => 1,
],
'permalink' => [
'name' => 'permalink',
Expand Down Expand Up @@ -5005,7 +5007,13 @@ public function save_pod_item( $params ) {
|| 'save' === $params->from
|| true === pods_permission( $fields[ $field ] )
) {
$value = PodsForm::default_value( pods_v( $field, 'post' ), $field_data['type'], $field, pods_v( 'options', $field_data, $field_data, true ), $pod, $params->id );
$field_options = $field_data;

if ( is_array( $field_options ) ) {
$field_options = pods_v( 'options', $field_options, $field_options, true );
}

$value = PodsForm::default_value( pods_v( $field, 'post' ), $field_data['type'], $field, $field_options, $pod, $params->id );

if ( null !== $value && '' !== $value && false !== $value ) {
$fields[ $field ]['value'] = $value;
Expand All @@ -5026,7 +5034,13 @@ public function save_pod_item( $params ) {
continue;
}

$value = PodsForm::default_value( pods_v( $field, 'post' ), $field_data['type'], $field, pods_v( 'options', $field_data, $field_data, true ), $pod, $params->id );
$field_options = $field_data;

if ( is_array( $field_options ) ) {
$field_options = pods_v( 'options', $field_options, $field_options, true );
}

$value = PodsForm::default_value( pods_v( $field, 'post' ), $field_data['type'], $field, $field_options, $pod, $params->id );

if ( null !== $value && '' !== $value && false !== $value ) {
$object_fields[ $field ]['value'] = $value;
Expand Down Expand Up @@ -5106,7 +5120,13 @@ public function save_pod_item( $params ) {
continue;
}

$value = PodsForm::default_value( pods_v( $field, 'post' ), $field_data['type'], $field, pods_v( 'options', $field_data, $field_data, true ), $pod, $params->id );
$field_options = $field_data;

if ( is_array( $field_options ) ) {
$field_options = pods_v( 'options', $field_options, $field_options, true );
}

$value = PodsForm::default_value( pods_v( $field, 'post' ), $field_data['type'], $field, $field_options, $pod, $params->id );

if ( null !== $value && '' !== $value && false !== $value ) {
$fields[ $field ]['value'] = $value;
Expand Down Expand Up @@ -6510,7 +6530,17 @@ public function duplicate_pod( $params, $strict = false ) {
while ( $this->load_pod( array( 'name' => $check_name ), false ) ) {
$try ++;

$check_name = $pod['name'] . $try;
$check_name_limited = $pod['name'];

if ( 'post_type' === $pod['type'] ) {
// Max length for post types are 20 characters, so let's limit it to that minus the strlen of $try.
$check_name_limited = substr( $$check_name_limited, 0, 20 - strlen( (string) $try ) );
} elseif ( 'taxonomy' === $pod['type'] ) {
// Max length for taxonomies are 32 characters, so let's limit it to that minus the strlen of $try.
$check_name_limited = substr( $$check_name_limited, 0, 32 - strlen( (string) $try ) );
}

$check_name = $check_name_limited . $try;
$new_label = $pod['label'] . $try;
}

Expand Down
Loading

0 comments on commit 6b82a85

Please sign in to comment.