array( 'show' => true, 'required' => true ), 'title' => array( 'show' => true, 'required' => false ), 'caption' => array( 'show' => true, 'required' => false ), ); } /** * Get the default minimum character counts per field. * * Single source of truth — use this everywhere instead of redefining. * * @since 1.5.4 * @return array */ public static function get_field_minimum_defaults() { return array( 'alt_text' => 5, 'title' => 5, 'caption' => 0, ); } /** * Register feature flag settings with WordPress Settings API. * * @since 1.2.0 */ public static function register_settings() { /* * gatewell_rules_admin_only is deliberately NOT registered. * * It has no form field on any settings tab, and wp-admin/options.php passes * null to the sanitize callback of every registered option missing from * $_POST and then saves the result — so registering it meant * rest_sanitize_boolean( null ) === false was written back on every single * settings save, silently switching admin-only mode off again. * * can_user_access_rules() reads it with get_option( ..., false ). Register it * again only together with a field that renders it. */ } }