' . $attributes['badge_content'] . ' '; } $button_open = ' <' . $attributes['type'] . ' ' . areoi_return_id( $attributes ) . ' class="' . areoi_format_block_id( $attributes['block_id'] ) . ' ' . $class . '" '; if ( !empty( $attributes['url'] ) ) { $button_open .= ' href="' . $attributes['url'] . '"'; } if ( !empty( $attributes['rel'] ) ) { $button_open .= ' rel="' . $attributes['rel'] . '"'; } if ( !empty( $attributes['linkTarget'] ) ) { $button_open .= ' target="' . $attributes['linkTarget'] . '"'; } if ( !empty( $attributes['dropdown'] ) ) { $button_open .= ' data-bs-toggle="dropdown"'; $button_open .= ' data-bs-auto-close="' . $attributes['dropdown_auto_close'] . '"'; } $button_open .= ' ' . $tooltip . '>'; $output = ''; if ( !empty( $attributes['dropdown'] ) ) { $output .= '
'; } if ( !empty( $attributes['popover'] ) ) { $output .= ' '; } $output .= ' ' . $button_open . ' ' . $attributes['text'] . ' ' . $badge . ' '; if ( !empty( $attributes['popover'] ) ) { $output .= ''; } if ( !empty( $attributes['dropdown'] ) ) { $output .= '
' . $content . '
'; $output .= '
'; } return $output; } function areoi_register_block_button() { register_block_type_from_metadata( __DIR__ . '/button', array( 'render_callback' => 'areoi_render_block_button', ) ); } areoi_register_block_button();