Skip to content

Commit

Permalink
Merge pull request #9675 from awesomemotive/release/3.2.3
Browse files Browse the repository at this point in the history
Release/3.2.3
  • Loading branch information
cklosowski authored Oct 2, 2023
2 parents 50ec8e1 + 07a551c commit f39f402
Show file tree
Hide file tree
Showing 50 changed files with 30,014 additions and 349 deletions.
1 change: 0 additions & 1 deletion .browserslistrc

This file was deleted.

29 changes: 0 additions & 29 deletions .editorconfig

This file was deleted.

5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

17 changes: 0 additions & 17 deletions .gitattributes

This file was deleted.

43 changes: 0 additions & 43 deletions .gitignore

This file was deleted.

15 changes: 0 additions & 15 deletions .jshintrc

This file was deleted.

42 changes: 42 additions & 0 deletions assets/js/admin/downloads/editor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* Prevents Downloads post type protected meta from being saved.
*
* @url https://github.com/awesomemotive/easy-digital-downloads-pro/issues/725
* @since 3.2.3
*/
const preventDownloadsProtectedMetaSave = () => {

// Add a middleware to WP API Fetch. So it will handle before any api request.
wp.apiFetch.use(
( options, next ) => {

// retrieve post type config to get api base.
const downloadConfig = wp.data.select( 'core' ).getEntityConfig( 'postType', 'download' );
// current request path.
const path = options?.path;

// if current request path and download api base path is same process the request and remove protected meta.
if ( downloadConfig && path && path.indexOf( downloadConfig.baseURL ) === 0 ) {

const metas = options?.data?.meta || {};

if ( Object.keys( metas ).length ) {
const newMetas = {};
for ( const [ key, value ] of Object.entries( metas ) ) {
// remove any meta which starts with _edd.
if ( key.indexOf( '_edd' ) !== 0 ) {
newMetas[ key ] = value;
}
}
options.data.meta = newMetas;
}
}

const result = next( options );
return result;
}
)

}

wp.domReady( preventDownloadsProtectedMetaSave );
1 change: 1 addition & 0 deletions assets/js/edd-admin-downloads-editor.js

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

2 changes: 1 addition & 1 deletion assets/js/edd-admin-downloads.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/edd-admin-email-tags.js

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

2 changes: 1 addition & 1 deletion assets/js/edd-admin-onboarding.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/edd-admin-orders.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/edd-admin-reports.js

Large diffs are not rendered by default.

Loading

0 comments on commit f39f402

Please sign in to comment.