Aa'; } /** Whether an add-on provides the style editing controls. */ public static function editor() { return (bool) Extensions::filter( 'accessible_forms_style_editor', false ); } /** * The theme whose colors match, or `custom`. * * @param array $values Appearance values. * @return string */ public static function current_theme( array $values ) { foreach ( Appearance::presets() as $key => $candidate ) { $colors = array_intersect_key( $candidate['colors'], Appearance::colors() ); if ( ! array_diff_assoc( $colors, array_intersect_key( $values, Appearance::colors() ) ) ) { return $key; } } return 'custom'; } public static function render( $raw, $layout = array() ) { $values = is_array( $raw ) ? array_merge( Appearance::defaults(), array_filter( $raw, 'is_scalar' ) ) : Appearance::defaults(); $layout = array_merge( array( 'width' => 'comfortable', 'button' => 'start', 'labels' => 'above', ), is_array( $layout ) ? array_filter( $layout, 'is_scalar' ) : array() ); $preset = self::current_theme( $values ); $editor = self::editor(); ?>

' . esc_html__( 'This form uses custom colors. Choosing a theme replaces them.', 'accessible-forms-by-accessible-org' ) . '

'; } foreach ( array_keys( Appearance::colors() ) as $key ) { echo ''; } } ?>
'; } foreach ( self::LAYOUT_KEYS as $key ) { echo ''; } } ?>