Skip to content

Commit

Permalink
Remove accents when creating slugs and names
Browse files Browse the repository at this point in the history
Fixes #6874
  • Loading branch information
sc0ttkclark committed Sep 21, 2022
1 parent 3cf4d13 commit a971a6a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Our GitHub has the full list of all prior releases of Pods: https://github.com/p
* Enhancement: You can now specify a custom display separator for repeateable fields to use when rendering. #6892 #6890 (@JoryHogeveen)
* Changed: Resetting a Pod has been removed from the Pods Admin > Edit Pods page, instead of clicking "Delete All Items" there, you can now access this directly from Pods Admin > Settings > Cleanup & Reset as the new "Delete all content for a Pod" option. You can specify the Pod you want to delete content for and it explains exactly what you can expect from running it. (@sc0ttkclark)
* Tweak: Updated Pods Admin > Help page now lists more add-ons and where to get them / get support for them. (@sc0ttkclark)
* Fixed: Properly convert accents when creating a new pod and using the label to generate the pod name. #6874 (@sc0ttkclark)
* Fixed: Relationship/file fields that are hidden on the screen will now have all field values referenced instead of only the first value when multiple is enabled for that field. #6913 (@sc0ttkclark)
* Fixed: `pods_query_arg()` now correctly excludes all `$_GET` parameters when passing a manual URL into the function. (@sc0ttkclark)
* Fixed: Legacy WP-CLI commands for Pods are now showing up again, however they will be replaced in a future release with a more comprehensive solution. In the meantime, you can use those commands by calling `wp pods-legacy` and `wp pods-legacy-api`.
Expand Down
2 changes: 2 additions & 0 deletions includes/data.php
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,7 @@ function pods_cast( $value, $cast_from = null ) {
* @since 1.8.9
*/
function pods_create_slug( $orig, $strict = true ) {
$str = remove_accents( $orig );
$str = preg_replace( '/([_ \\/])/', '-', trim( $orig ) );

if ( $strict ) {
Expand Down Expand Up @@ -1398,6 +1399,7 @@ function pods_unique_slug( $slug, $column_name, $pod, $pod_id = 0, $id = 0, $obj
*/
function pods_clean_name( $orig, $lower = true, $trim_underscores = false ) {
$str = trim( $orig );
$str = remove_accents( $str );
$str = preg_replace( '/([^0-9a-zA-Z\-_\s])/', '', $str );
$str = preg_replace( '/(\s_)/', '_', $str );
$str = preg_replace( '/(\s+)/', '_', $str );
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ Pods really wouldn't be where it is without all the contributions from our [dono
* Enhancement: You can now specify a custom display separator for repeateable fields to use when rendering. #6892 #6890 (@JoryHogeveen)
* Changed: Resetting a Pod has been removed from the Pods Admin > Edit Pods page, instead of clicking "Delete All Items" there, you can now access this directly from Pods Admin > Settings > Cleanup & Reset as the new "Delete all content for a Pod" option. You can specify the Pod you want to delete content for and it explains exactly what you can expect from running it. (@sc0ttkclark)
* Tweak: Updated Pods Admin > Help page now lists more add-ons and where to get them / get support for them. (@sc0ttkclark)
* Fixed: Properly convert accents when creating a new pod and using the label to generate the pod name. #6874 (@sc0ttkclark)
* Fixed: Relationship/file fields that are hidden on the screen will now have all field values referenced instead of only the first value when multiple is enabled for that field. #6913 (@sc0ttkclark)
* Fixed: `pods_query_arg()` now correctly excludes all `$_GET` parameters when passing a manual URL into the function. (@sc0ttkclark)
* Fixed: Legacy WP-CLI commands for Pods are now showing up again, however they will be replaced in a future release with a more comprehensive solution. In the meantime, you can use those commands by calling `wp pods-legacy` and `wp pods-legacy-api`.
Expand Down

0 comments on commit a971a6a

Please sign in to comment.