ADDED Code of Version 2.0.0 of the Advanced Composer Blocks for Newsletter Plugin
This commit is contained in:
commit
028d595144
28 changed files with 2187 additions and 0 deletions
59
blocks/mbtnp-cta/block.php
Normal file
59
blocks/mbtnp-cta/block.php
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
/*
|
||||
* Name: Call To Action+
|
||||
* Section: content
|
||||
* Description: Call to action button
|
||||
*/
|
||||
|
||||
// Don't access this file directly
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$default_options = array(
|
||||
'button_text' => 'Learn more',
|
||||
'button_url' => '',
|
||||
'button_color' => '#000000',
|
||||
'button_border_radius' => '3',
|
||||
'text_color' => '#ffffff',
|
||||
'align' => 'center',
|
||||
'block_background' => '',
|
||||
'button_width' => 'inline',
|
||||
'button_align' => 'center',
|
||||
'block_padding_top' => 20,
|
||||
'block_padding_bottom' => 20,
|
||||
'schema' => ''
|
||||
);
|
||||
|
||||
$options = array_merge($default_options, $options);
|
||||
|
||||
$text_style = TNP_Composer::get_style($options, 'button_text', $composer, 'text');
|
||||
?>
|
||||
|
||||
<style>
|
||||
.button {
|
||||
<?php echo esc_html( $text_style->echo_css() ) ?>
|
||||
background: <?php echo esc_attr( $options['button_color'] ); ?>;
|
||||
color: <?php echo esc_attr( $options['text_color'] ); ?>;
|
||||
display: inline-block;
|
||||
<?php if( $options['button_width'] == 'full_width' ){ ?>
|
||||
display: block;
|
||||
<?php } ?>
|
||||
padding: 12px 24px;
|
||||
<?php if( $options['button_text_font_size'] ){ ?>
|
||||
padding: <?php echo esc_attr( $options['button_text_font_size'] ) * 0.75; ?>px <?php echo esc_attr( $options['button_text_font_size'] ) * 1.5; ?>px;
|
||||
<?php } ?>
|
||||
text-decoration: none;
|
||||
<?php if( $options['button_border_radius'] ){ ?>
|
||||
border-radius: <?php echo esc_attr( $options['button_border_radius'] ); ?>px;
|
||||
<?php } ?>
|
||||
}
|
||||
</style>
|
||||
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="margin: 0; border-collapse: collapse;">
|
||||
<tr>
|
||||
<td align="<?php echo esc_attr( $options['button_align'] ) ?>">
|
||||
<a href="<?php echo esc_url( $options['button_url'] ) ?>" inline-class="button"><?php echo esc_html( $options['button_text'] ); ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
BIN
blocks/mbtnp-cta/icon.png
Normal file
BIN
blocks/mbtnp-cta/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
39
blocks/mbtnp-cta/options.php
Normal file
39
blocks/mbtnp-cta/options.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
/* @var $fields NewsletterFields */
|
||||
|
||||
// Don't access this file directly
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php $fields->text('button_text', __('Button text', 'advanced-composer-blocks-for-newsletter')) ?>
|
||||
<?php $fields->font('button_text_font', '', [ 'family_default' => true, 'size_default' => true, 'weight_default' => true, 'align'=>false, 'color'=>false ] ) ?>
|
||||
|
||||
<?php $fields->url('button_url', __('Button link URL', 'advanced-composer-blocks-for-newsletter') ) ?>
|
||||
|
||||
|
||||
<div class="tnp-field-row">
|
||||
<div class="tnp-field-col-3">
|
||||
<?php $fields->color('text_color', __('Text color', 'advanced-composer-blocks-for-newsletter')) ?>
|
||||
</div>
|
||||
<div class="tnp-field-col-3">
|
||||
<?php $fields->color('button_color', __('Button color', 'advanced-composer-blocks-for-newsletter')) ?>
|
||||
</div>
|
||||
<div class="tnp-field-col-3">
|
||||
<?php $fields->size('button_border_radius', __('Border radius', 'advanced-composer-blocks-for-newsletter')) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tnp-field-row">
|
||||
<div class="tnp-field-col-2">
|
||||
<?php $fields->select('button_width', 'Width', ['inline' => __('Inline'), 'full_width' => __('Full width')]) ?>
|
||||
</div>
|
||||
<div class="tnp-field-col-2">
|
||||
<?php $fields->select('button_align', 'Alignment', ['center' => __('Center'), 'left' => __('Left'), 'right' => __('Right')]) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr style="clear:both;margin:20px 0;" />
|
||||
|
||||
<?php $fields->block_commons() ?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue