diff --git a/includes/functions/metadata.php b/includes/functions/metadata.php index 144c439..8ea5ab2 100644 --- a/includes/functions/metadata.php +++ b/includes/functions/metadata.php @@ -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', @@ -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' ),