Skip to content

Commit

Permalink
feat: add term order field (resolves #294)
Browse files Browse the repository at this point in the history
  • Loading branch information
greatislander committed Feb 24, 2020
1 parent 2bc1e89 commit 9a590d2
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion includes/functions/metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,21 @@ function register_meta() {
function resource_data_init() {
$prefix = 'lc_resource_';

$term_info = new_cmb2_box(
[
'id' => 'term_info',
'title' => __( 'Tag Information', 'coop-library-framework' ),
'object_types' => [ 'term' ],
'taxonomies' => [ 'lc_goal', 'lc_topic' ],
'context' => 'normal',
'priority' => 'high',
'show_names' => true,
]
);

$general_info = new_cmb2_box(
[
'id' => '01_resource_data',
'id' => '01_general_info',
'title' => __( 'General Information', 'coop-library-framework' ),
'object_types' => [ 'lc_resource' ],
'context' => 'normal',
Expand Down Expand Up @@ -428,6 +440,17 @@ function resource_data_init() {
]
);

$term_info->add_field(
[
'name' => __( 'Order', 'coop-library-framework' ),
'description' => __( 'The numeric order of this tag.', 'coop-library-framework' ),
'id' => 'lc_term_order',
'type' => 'text',
'default' => 0,
'sanitize_cb' => 'intval',
]
);

$general_info->add_field(
[
'name' => __( 'Favorites', 'coop-library-framework' ),
Expand Down

0 comments on commit 9a590d2

Please sign in to comment.