Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a setting to indicate whether or not a resource is paywalled #288

Merged
merged 1 commit into from
Feb 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions includes/functions/metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ function register_meta() {
]
);

register_post_meta(
'lc_resource',
'lc_resource_has_paywall',
[
'type' => 'string',
'description' => 'Indicates whether or not the resource is behind a paywall.',
'single' => true,
'show_in_rest' => true,
]
);

register_post_meta(
'lc_resource',
'lc_resource_perma_cc_links',
Expand Down Expand Up @@ -454,6 +465,15 @@ function resource_data_init() {
]
);

$general_info->add_field(
[
'name' => __( 'Paywall', 'coop-library-framework' ),
'description' => __( 'Is this resource behind a paywall?', 'coop-library-framework' ),
'id' => $prefix . 'has_paywall',
'type' => 'checkbox',
]
);

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