Skip to content

Commit

Permalink
A link to create a field group after a CPT has been created (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
lexuanbao161096 authored Jul 17, 2024
1 parent 1b45f6c commit d0f76aa
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/hooks/usePostTypes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { create } from 'zustand';
import { getSettings } from '../functions';
import { ensureArray, getSettings } from '../functions';

const sanitize = types => {
let t = types && Array.isArray( types ) ? types : [ 'post' ];
Expand All @@ -10,7 +10,7 @@ const sanitize = types => {
const settings = getSettings();

const usePostTypes = create( set => ( {
types: sanitize( settings.post_types ),
types: sanitize( ensureArray( settings.post_types || [] ) ),
update: types => set( state => ( { types: sanitize( types ) } ) ),
} ) );

Expand Down
2 changes: 1 addition & 1 deletion assets/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion modules/relationships/assets/relationships.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion modules/settings-page/assets/settings-page.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public function enqueue() {
// All other fields are false by default, but save_field need to be true by default.
$fields = array_map( function ( $field ) {
$field['save_field'] = $field['save_field'] ?? true;

return $field;
}, $fields );

Expand Down Expand Up @@ -81,7 +80,7 @@ public function enqueue() {
'termMeta' => Data::is_extension_active( 'mb-term-meta' ),
'userMeta' => Data::is_extension_active( 'mb-user-meta' ),
'revision' => Data::is_extension_active( 'mb-revision' ),
'views' => Data::is_extension_active( 'mb-views' ),
'views' => Data::is_extension_active( 'mb-views' ),
],
];

Expand Down

0 comments on commit d0f76aa

Please sign in to comment.