Skip to content

Commit

Permalink
Added shortcode support for widget main excerpts
Browse files Browse the repository at this point in the history
  • Loading branch information
marcperel committed Apr 18, 2016
1 parent 3cbb22d commit b4df696
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
12 changes: 6 additions & 6 deletions core/widgets/modules/contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function widget( $args, $instance ) {
<h3 class="heading"><?php echo $instance['title']; ?></h3>
<?php } ?>
<?php if( '' != $this->check_and_return( $instance, 'excerpt' ) ) { ?>
<div class="excerpt"><?php echo $instance['excerpt']; ?></div>
<div class="excerpt"><?php echo layers_the_content( $instance['excerpt'] ); ?></div>
<?php } ?>
</div>
</div>
Expand Down Expand Up @@ -329,7 +329,7 @@ function form( $instance ){
<section class="layers-accordion-section layers-content">
<div class="layers-row layers-push-bottom clearfix">
<div class="layers-form-item">

<?php echo $this->form_elements()->input(
array(
'type' => 'text',
Expand All @@ -340,7 +340,7 @@ function form( $instance ){
'class' => 'layers-text layers-large'
)
); ?>

<?php $this->design_bar(
'top', // CSS Class Name
array( // Widget Object
Expand All @@ -356,10 +356,10 @@ function form( $instance ){
'fonts',
), $this, $instance )
); ?>

</div>
<div class="layers-form-item">

<?php echo $this->form_elements()->input(
array(
'type' => 'rte',
Expand All @@ -370,7 +370,7 @@ function form( $instance ){
'class' => 'layers-textarea layers-large'
)
); ?>

</div>
</div>
<div class="layers-row clearfix">
Expand Down
26 changes: 13 additions & 13 deletions core/widgets/modules/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function widget( $args, $instance ) {
<<?php echo $heading_type; ?> class="heading"><?php echo $instance['title'] ?></<?php echo $heading_type; ?>>
<?php } ?>
<?php if( '' != $this->check_and_return( $instance, 'excerpt' ) ) { ?>
<div class="excerpt"><?php echo $instance['excerpt']; ?></div>
<div class="excerpt"><?php echo layers_the_content( $instance['excerpt'] ); ?></div>
<?php } ?>
</div>
</div>
Expand All @@ -187,15 +187,15 @@ function widget( $args, $instance ) {
}
// Set the background styling
if( !empty( $item_instance['design'][ 'background' ] ) ) $this->inline_css .= layers_inline_styles( '#' . $widget_id . '-' . $column_key , 'background', array( 'background' => $item_instance['design'][ 'background' ] ) );
if( !empty( $item_instance['design']['fonts'][ 'color' ] ) ) $this->inline_css .= layers_inline_styles( '#' . $widget_id . '-' . $column_key , 'color', array( 'selectors' => array( 'h5.heading a', 'h5.heading' , 'div.excerpt' , 'div.excerpt p' ) , 'color' => $item_instance['design']['fonts'][ 'color' ] ) );
if( !empty( $item_instance['design']['fonts'][ 'shadow' ] ) ) $this->inline_css .= layers_inline_styles( '#' . $widget_id . '-' . $column_key , 'text-shadow', array( 'selectors' => array( 'h5.heading a', 'h5.heading' , 'div.excerpt' , 'div.excerpt p' ) , 'text-shadow' => $item_instance['design']['fonts'][ 'shadow' ] ) );
if( !empty( $item_instance['design']['fonts'][ 'color' ] ) ) $this->inline_css .= layers_inline_styles( '#' . $widget_id . '-' . $column_key , 'color', array( 'selectors' => array( '.heading a', '.heading' , 'div.excerpt' , 'div.excerpt p' ) , 'color' => $item_instance['design']['fonts'][ 'color' ] ) );
if( !empty( $item_instance['design']['fonts'][ 'shadow' ] ) ) $this->inline_css .= layers_inline_styles( '#' . $widget_id . '-' . $column_key , 'text-shadow', array( 'selectors' => array( '.heading a', '.heading' , 'div.excerpt' , 'div.excerpt p' ) , 'text-shadow' => $item_instance['design']['fonts'][ 'shadow' ] ) );

// Set column margin & padding
if ( !empty( $item_instance['design']['advanced']['margin'] ) ) $this->inline_css .= layers_inline_styles( "#{$widget_id}-{$column_key}", 'margin', array( 'margin' => $item_instance['design']['advanced']['margin'] ) );
if ( !empty( $item_instance['design']['advanced']['padding'] ) ) $this->inline_css .= layers_inline_styles( "#{$widget_id}-{$column_key}", 'padding', array( 'padding' => $item_instance['design']['advanced']['padding'] ) );

if( !isset( $item_instance[ 'width' ] ) ) $item_instance[ 'width' ] = $this->column_defaults[ 'width' ];

// Set the button styling
if ( function_exists( 'layers_pro_apply_widget_button_styling' ) ) {
$this->inline_css .= layers_pro_apply_widget_button_styling( $this, $item_instance, array( "#{$widget_id}-{$column_key} .button" ) );
Expand Down Expand Up @@ -310,12 +310,12 @@ function widget( $args, $instance ) {
$column_inner_classes[] = $this->check_and_return( $item_instance, 'design', 'imagealign' );
$column_inner_classes[] = $this->check_and_return( $item_instance, 'design', 'fonts' , 'size' );
$column_inner_classes = implode( ' ', $column_inner_classes );

/**
* Get Heading Type - for SEO
*/
$heading_type = ( isset( $item_instance['design']['fonts']['heading-type'] ) ) ? $item_instance['design']['fonts']['heading-type'] : 'h3' ;

/**
* Button Size.
*/
Expand Down Expand Up @@ -465,7 +465,7 @@ function form( $instance ){

<section class="layers-accordion-section layers-content">
<div class="layers-form-item">

<?php echo $this->form_elements()->input(
array(
'type' => 'text',
Expand All @@ -476,7 +476,7 @@ function form( $instance ){
'class' => 'layers-text layers-large layers-input-has-controls',
)
); ?>

<?php $this->design_bar(
'top', // CSS Class Name
array( // Widget Object
Expand All @@ -492,10 +492,10 @@ function form( $instance ){
'fonts',
), $this, $instance )
); ?>

</div>
<div class="layers-form-item">

<?php echo $this->form_elements()->input(
array(
'type' => 'rte',
Expand All @@ -506,14 +506,14 @@ function form( $instance ){
'class' => 'layers-textarea layers-large'
)
); ?>

</div>
</section>
<section class="layers-accordion-section layers-content">
<div class="layers-form-item">

<?php $this->repeater( 'column', $instance ); ?>

</div>
</section>

Expand Down
14 changes: 7 additions & 7 deletions core/widgets/modules/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function widget( $args, $instance ) {
$this->inline_css .= layers_inline_styles( '#' . $widget_id, 'background', array( 'background' => $instance['design'][ 'background' ] ) );
$this->inline_css .= layers_inline_styles( '#' . $widget_id, 'color', array( 'selectors' => array( '.section-title .heading' , '.section-title div.excerpt' ) , 'color' => $instance['design']['fonts'][ 'color' ] ) );
$this->inline_css .= layers_inline_styles( '#' . $widget_id, 'background', array( 'selectors' => array( '.thumbnail-body' ) , 'background' => array( 'color' => $this->check_and_return( $instance, 'design', 'column-background-color' ) ) ) );

// Apply Button Styling.
if ( function_exists( 'layers_pro_apply_widget_button_styling' ) ) {
// Apply Layers Pro Button Styling.
Expand Down Expand Up @@ -250,7 +250,7 @@ function widget( $args, $instance ) {
<h3 class="heading"><?php echo $instance['title'] ?></h3>
<?php } ?>
<?php if( '' != $this->check_and_return( $instance, 'excerpt' ) ) { ?>
<div class="excerpt"><?php echo $instance['excerpt']; ?></div>
<div class="excerpt"><?php echo layers_the_content( $instance['excerpt'] ); ?></div>
<?php } ?>
</div>
</div>
Expand Down Expand Up @@ -578,7 +578,7 @@ function form( $instance ){

<div class="layers-row layers-push-bottom">
<div class="layers-form-item">

<?php echo $this->form_elements()->input(
array(
'type' => 'text',
Expand All @@ -589,7 +589,7 @@ function form( $instance ){
'class' => 'layers-text layers-large'
)
); ?>

<?php $this->design_bar(
'top', // CSS Class Name
array( // Widget Object
Expand All @@ -605,10 +605,10 @@ function form( $instance ){
'fonts',
), $this, $instance )
); ?>

</div>
<div class="layers-form-item">

<?php echo $this->form_elements()->input(
array(
'type' => 'rte',
Expand All @@ -619,7 +619,7 @@ function form( $instance ){
'class' => 'layers-textarea layers-large'
)
); ?>

</div>
<?php // Grab the terms as an array and loop 'em to generate the $options for the input
$terms = get_terms( $this->taxonomy , array( 'hide_empty' => false ) );
Expand Down

0 comments on commit b4df696

Please sign in to comment.