array( 'href' => true, 'target' => true, 'rel' => true, ), 'strong' => array(), 'em' => array(), 'b' => array(), 'i' => array(), ); } /** {@inheritdoc} */ public function sanitize_config( array $raw ) { $text = isset( $raw['text'] ) ? (string) $raw['text'] : ''; return array( 'text' => wp_kses( $text, self::allowed_html() ), ); } /** {@inheritdoc} */ public function sanitize_value( $raw, array $field ) { return ( is_scalar( $raw ) && '' !== (string) $raw && '0' !== (string) $raw ) ? '1' : ''; } /** {@inheritdoc} */ public function to_text( $value, array $field ) { return '1' === (string) $value ? __( 'Accepted', 'fillaro' ) : __( 'Not accepted', 'fillaro' ); } /** {@inheritdoc} */ public function render_control( array $field, array $ctx ) { $attrs = array( 'type' => 'checkbox', 'id' => $ctx['id'], 'name' => $ctx['name'], 'value' => '1', 'class' => 'pf-choice__input', 'checked' => '1' === (string) $ctx['value'], 'required' => ! empty( $field['required'] ), 'aria-required' => ! empty( $field['required'] ) ? 'true' : false, 'aria-describedby' => $ctx['describedby'], ); $text = '' !== $field['text'] ? $field['text'] : esc_html__( 'I agree to the privacy policy.', 'fillaro' ); return sprintf( '', esc_attr( $ctx['id'] ), $this->attrs( $attrs ), wp_kses( $text, self::allowed_html() ) ); } }