Skip to content

Commit

Permalink
specify what custom post type supports
Browse files Browse the repository at this point in the history
  • Loading branch information
ashfame committed Sep 13, 2024
1 parent 5702c4c commit 83b5b14
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/plugin/class-liberation-engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class LiberationEngine {
const string POST_TYPE_NAVIGATION = 'liberated_navigation';

private array $custom_post_types; // allows us to loop through constants defined above
private array $custom_post_types_supports = array( 'title', 'editor', 'custom-fields' );
private array $post_meta_fields = [ 'guid', 'raw_title', 'raw_date', 'raw_content' ];

public function __construct() {
Expand Down Expand Up @@ -52,7 +53,7 @@ public function register_post_types() : void {
'rest_base' => 'liberated_posts',
'show_ui' => self::is_debug_mode(),
'show_in_menu' => self::is_debug_mode(),
'supports' => array( 'custom-fields' ),
'supports' => $this->custom_post_types_supports,
)
);
register_post_type(
Expand All @@ -64,7 +65,7 @@ public function register_post_types() : void {
'rest_base' => 'liberated_pages',
'show_ui' => self::is_debug_mode(),
'show_in_menu' => self::is_debug_mode(),
'supports' => array( 'custom-fields' ),
'supports' => $this->custom_post_types_supports,
)
);
register_post_type(
Expand All @@ -76,7 +77,7 @@ public function register_post_types() : void {
'rest_base' => 'liberated_products',
'show_ui' => self::is_debug_mode(),
'show_in_menu' => self::is_debug_mode(),
'supports' => array( 'custom-fields' ),
'supports' => $this->custom_post_types_supports,
)
);
register_post_type(
Expand All @@ -88,7 +89,7 @@ public function register_post_types() : void {
'rest_base' => 'liberated_navigations',
'show_ui' => self::is_debug_mode(),
'show_in_menu' => self::is_debug_mode(),
'supports' => array( 'custom-fields' ),
'supports' => $this->custom_post_types_supports,
)
);
}
Expand Down

0 comments on commit 83b5b14

Please sign in to comment.