diff --git a/assets/css/admin/admin-style.css b/assets/css/admin/admin-style.css index 9d8fe63..742401b 100755 --- a/assets/css/admin/admin-style.css +++ b/assets/css/admin/admin-style.css @@ -24,3 +24,7 @@ #titlewrap .error { color: var(--red); } + +.cmb2-char-counter-wrap input[type="text"] { + width: 2.5rem !important; +} diff --git a/includes/functions/metadata.php b/includes/functions/metadata.php index 8ea5ab2..a44d06f 100644 --- a/includes/functions/metadata.php +++ b/includes/functions/metadata.php @@ -467,19 +467,22 @@ 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', + 'name' => __( 'Short title', 'coop-library-framework' ), + 'description' => __( 'Shorter title used in resource listings.', 'coop-library-framework' ), + 'id' => $prefix . 'short_title', + 'type' => 'text', + 'char_counter' => true, + 'char_max' => 72, + 'char_max_enforce' => true, ] ); $general_info->add_field( [ - 'name' => __( 'Short title', 'coop-library-framework' ), - 'description' => __( 'Shorter title used in resource listings.', 'coop-library-framework' ), - 'id' => $prefix . 'short_title', - 'type' => 'text', + 'name' => __( 'Paywall', 'coop-library-framework' ), + 'description' => __( 'Is this resource behind a paywall?', 'coop-library-framework' ), + 'id' => $prefix . 'has_paywall', + 'type' => 'checkbox', ] );