| 1 |
<?php |
| 2 |
|
| 3 |
namespace gutenify; |
| 4 |
|
| 5 |
defined( 'ABSPATH' ) || exit; |
| 6 |
|
| 7 |
class Hover_Card_Hover{ |
| 8 |
public static function init() { |
| 9 |
add_action('init', array(__CLASS__, 'register_block')); |
| 10 |
} |
| 11 |
|
| 12 |
public static function register_block( ) { |
| 13 |
if ( ! Helpers::is_pro_block_active() ) { |
| 14 |
return; |
| 15 |
} |
| 16 |
|
| 17 |
register_block_type( __DIR__, array( |
| 18 |
'render_callback' => array( __CLASS__, 'render_callback' ) |
| 19 |
)); |
| 20 |
} |
| 21 |
|
| 22 |
public static function render_callback( $attributes, $content ) { |
| 23 |
$wrapper_attributes = get_block_wrapper_attributes( ); |
| 24 |
$output = sprintf( '<div %s>', $wrapper_attributes ); |
| 25 |
$output .= $content; |
| 26 |
$output .= '</div>'; |
| 27 |
return $output; |
| 28 |
} |
| 29 |
} |
| 30 |
|
| 31 |
Hover_Card_Hover::init(); |
| 32 |
|