PluginProbe
Button Block – Stylish buttons that get more clicks / 1.1.8
Button Block – Stylish buttons that get more clicks v1.1.8
1.2.6 1.2.5 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 All 28 releases
button-block / build / render.php

render.php in Button Block – Stylish buttons that get more clicks 1.1.8, at build/render.php

24 lines 882 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 extract( $attributes );
3
4 $id = wp_unique_id( 'btnButton-' );
5
6 $popup = $popup ?? [ 'type' => 'image', 'content' => '', 'caption' => '' ];
7 if ( 'content' === $popup['type'] ) {
8 $blocks = parse_blocks( $popup['content'] );
9 $popup['content'] = '';
10 foreach ( $blocks as $block ) {
11 $popup['content'] .= render_block( $block );
12 }
13 } // Convert the blocks to dom elements
14 ?>
15 <div
16 <?php echo get_block_wrapper_attributes( [ 'class' => btnIsPremium() ? 'premium' : 'free' ] ); ?>
17 id='<?php echo esc_attr( $id ); ?>'
18 data-nonce='<?php echo esc_attr( wp_json_encode( wp_create_nonce( 'wp_ajax' ) ) ); ?>'
19 data-attributes='<?php echo esc_attr( wp_json_encode( $attributes ) ); ?>'
20 data-info='<?php echo esc_attr( wp_json_encode( [
21 'userRoles' => is_user_logged_in() ? wp_get_current_user()->roles : [],
22 'loginURL' => wp_login_url()
23 ] ) ); ?>'
24 ></div>