Skip to content

Commit

Permalink
Merge pull request #4202 from Codeinwp/feat/scroll_to_top_cta
Browse files Browse the repository at this point in the history
feat: added scroll to top cta
  • Loading branch information
preda-bogdan authored Feb 22, 2024
2 parents 6826d27 + f307dbb commit 83d18c8
Show file tree
Hide file tree
Showing 5 changed files with 578 additions and 2 deletions.
14 changes: 14 additions & 0 deletions assets/customizer/css/upsells.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,20 @@
padding-top: 10px;
align-items: center;
}
.nv-simple-upsell.column-layout {
flex-direction: column;
align-items: start;
gap: 16px;
border-bottom: 1px solid #ccc;
border-top: none;
padding-bottom: 12px;
}

.nv-simple-upsell.column-layout p {
font-size: 13px;
font-weight: normal;
}

.nv-simple-upsell p {
margin: 0 10px 0 0;
font-weight: 600;
Expand Down
23 changes: 21 additions & 2 deletions inc/customizer/controls/simple_upsell.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,38 @@ class Simple_Upsell extends \WP_Customize_Control {
*/
public $text = '';

/**
* Additional CSS class.
*
* @since 3.8.0
* @var string
*/
public $class = '';

/**
* Use primary button class.
*
* @since 3.8.0
* @var string
*/
public $use_primary = '';

/**
* Render Method
*
* @return void
*/
public function render_content() {
$base_class = 'nv-simple-upsell';
$class = ( ! empty( $this->class ) ) ? $base_class . ' ' . $this->class : $base_class;
$button_class = ( ! empty( $this->use_primary ) ) ? 'button-primary' : 'button-secondary';
?>
<div class="nv-simple-upsell">
<div class="<?php echo esc_attr( $class ); ?>">
<?php if ( ! empty( $this->text ) ) { ?>
<p><?php echo esc_html( $this->text ); ?></p>
<?php } ?>
<?php if ( ! empty( $this->link ) && ! empty( $this->button_text ) ) { ?>
<a target="_blank" rel="external noreferrer noopener" href="<?php echo esc_url( $this->link ); ?>" class='button button-secondary'>
<a target="_blank" rel="external noreferrer noopener" href="<?php echo esc_url( $this->link ); ?>" class='button <?php echo esc_attr( $button_class ); ?>'>
<?php echo esc_html( $this->button_text ); ?>
<span class="components-visually-hidden"><?php echo esc_html__( '(opens in a new tab)', 'neve' ); ?></span>
</a>
Expand Down
Loading

0 comments on commit 83d18c8

Please sign in to comment.