$attributes Block attributes. * @since 0.0.1 */ public function __construct( $attributes ) { $this->slug = 'checkbox'; $this->set_properties( $attributes ); $this->set_unique_slug(); $this->set_markup_properties(); } /** * Render checkbox markup * * @since 0.0.1 * @return string */ public function markup() { // `sd-checkbox-field` is this block's own modifier. `sd-checkbox-block` // and the `sd-checkbox-*` element classes are a shared contract — the // anonymous-donation, cover-fees and privacy-consent fields write the // same markup by hand — so anything specific to the authorable field // (styling, and the frontend hooks that read its label and validate it) // keys off this class instead of the shared ones. $classes = $this->get_field_classes( [ 'sd-checkbox-field' ] ); $aria_desc = $this->get_aria_describedby(); $required_mark = $this->required ? '' : ''; // The slug is the key the value is submitted, validated and stored // under. Without it the field renders but never reaches the server — // the failure mode #273 hit on the anonymous-donation checkbox. $data_slug = $this->block_slug ? $this->block_slug : $this->unique_slug; ob_start(); ?>