Skip to content

Commit

Permalink
Merge pull request #32 from redelivre/pull-request-whatsapp
Browse files Browse the repository at this point in the history
Campo whats app na seção contato
  • Loading branch information
diegorojas authored Feb 7, 2019
2 parents cc507d1 + 7573c3c commit d4c79c7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2456,6 +2456,20 @@ function coletivo_customize_register( $wp_customize ) {
'description' => '',
)
);
// Contact What's app
$wp_customize->add_setting( 'coletivo_contact_whats',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => '',
)
);
$wp_customize->add_control( 'coletivo_contact_whats',
array(
'label' => esc_html__('What´s App', 'coletivo'),
'section' => 'coletivo_contact_content',
'description' => '',
)
);
// Contact Email
$wp_customize->add_setting( 'coletivo_contact_email',
array(
Expand Down
14 changes: 14 additions & 0 deletions section-parts/section-contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
$coletivo_contact_text = get_theme_mod( 'coletivo_contact_text' );
$coletivo_contact_address = get_theme_mod( 'coletivo_contact_address' );
$coletivo_contact_phone = get_theme_mod( 'coletivo_contact_phone' );
$coletivo_contact_whats = get_theme_mod( 'coletivo_contact_whats' );
$coletivo_contact_email = get_theme_mod( 'coletivo_contact_email' );
$coletivo_contact_fb = get_theme_mod( 'coletivo_contact_fb' );
$coletivo_contact_instagram = get_theme_mod( 'coletivo_contact_instagram' );
Expand Down Expand Up @@ -74,6 +75,19 @@ class="<?php echo esc_attr(apply_filters('coletivo_section_class', 'section-cont
</div>
<?php endif; ?>

<?php if ($coletivo_contact_whats != ''): ?>
<div class="address-contact">
<span class="fa-stack"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-whatsapp fa-stack-1x fa-inverse"></i></span>

<div class="address-content">
<?php
$coletivo_contact_whats_number = preg_replace( '/[^0-9]/', '', $coletivo_contact_whats );
?>
<a target="_blank" href="https://api.whatsapp.com/send?phone=<?php echo $coletivo_contact_whats_number ?>"><?php echo wp_kses_post($coletivo_contact_whats); ?></a>
</div>
</div>
<?php endif; ?>

<?php if ($coletivo_contact_email != ''): ?>
<div class="address-contact">
<span class="fa-stack"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-envelope-o fa-stack-1x fa-inverse"></i></span>
Expand Down

0 comments on commit d4c79c7

Please sign in to comment.