'', 'form' => '', 'preForm' => '', 'slug' => '', 'hash' => '', 'output' => 'form', ]; } /** * Wrapper function for our dynamic buttons. * * @since 1.0.0 * @param array $attributes The block attributes. * @param string $content The dynamic text to display. * @param WP_Block $block Block instance. */ public static function render_block( $attributes, $content, $block ) { if ( !$attributes['hash'] ) return ''; $output = ''; $classes = ['amem-test']; $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) ); $output .= sprintf( '
', $wrapper_attributes ); // Check if it's a shortcode if ( strpos($attributes['hash'], '[') === 0 ) { $output .= do_shortcode($attributes['hash']); } else { $output .= amem_form($attributes['form'], ['echo' => false]); } $output .= '
'; return $output; } }