Plugin Directory

Changeset 1376579


Ignore:
Timestamp:
03/22/2016 07:26:31 PM (10 years ago)
Author:
msalsas
Message:

Add 'exclude from Shop page' option (for Woocommerce plugin)

Location:
dynamic-audio-player-basic/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • dynamic-audio-player-basic/trunk/dynamicplayer.php

    r1206862 r1376579  
    44Plugin URI: http://dynamicaudioplayer.com
    55Description: This plugin allows you to add an audio player widget with a dynamic playlist and shortcodes for single buttons
    6 Version: 2.2.1
     6Version: 2.3.0
    77Author: Manolo Salsas Durán
    88Author URI: http://msalsas.com/en/
     
    9292    $includedPages = array();
    9393    $includedHomePage = false;
     94    $includedShopPage = false;
    9495
    9596    foreach($dyn_option as $option)
     
    130131        if(isset($option["dynPlayerShowHomePage"])) {
    131132            $includedHomePage = $option["dynPlayerShowHomePage"] == "true" ? true : false;
     133            break;
     134        }
     135    }
     136    foreach($dyn_option as $option)
     137    {
     138        if(isset($option["dynPlayerShowShopPage"])) {
     139            $includedShopPage = $option["dynPlayerShowShopPage"] == "true" ? true : false;
    132140            break;
    133141        }
     
    178186            return null;
    179187    }
    180 
     188    elseif(function_exists('is_shop') && is_shop()) {
     189        if(! $includedShopPage)
     190            return null;
     191    }
    181192    dyn_scripts($dyn_option);
    182193}
     
    369380        'dynPlayerExcludePosts' => '',
    370381        'dynPlayerIncludePosts' => '',
     382        'dynPlayerShowShopPage' => '',
    371383    );
    372384    $active_sidebars['dynamic-player-sidebar'] = array('dynamic-player-widget-1') ;
     
    453465        $instance['dynPlayerExcludePosts'] = strip_tags( $new_instance['dynPlayerExcludePosts'] );
    454466        $instance['dynPlayerIncludePosts'] = strip_tags( $new_instance['dynPlayerIncludePosts'] );
     467        $instance['dynPlayerShowShopPage'] = strip_tags( $new_instance['dynPlayerShowShopPage'] );
    455468
    456469        return $instance;
     
    476489            'dynPlayerIncludePages' => '',
    477490            'dynPlayerExcludePosts' => '',
    478             'dynPlayerIncludePosts' => ''
     491            'dynPlayerIncludePosts' => '',
     492            'dynPlayerShowShopPage' => ''
    479493        );
    480494        $instance = wp_parse_args( (array) $instance, $defaults ); ?>
     
    602616</p>
    603617
     618<p>
     619    <label for="<?php echo $this->get_field_id( 'dynPlayerShowShopPage' ); ?>">
     620        Show in shop page (only for Woocommerce plugin)
     621    </label>
     622    <select id="<?php echo $this->get_field_id('dynPlayerShowShopPage'); ?>" name="<?php echo $this->get_field_name('dynPlayerShowShopPage'); ?>" class="widefat" style="width:100%;">
     623        <option <?php selected( $instance['dynPlayerShowShopPage'], 'true'); ?> value="true">true</option>
     624        <option <?php selected( $instance['dynPlayerShowShopPage'], 'false'); ?> value="false">false</option>
     625    </select>
     626</p>
    604627
    605628<?php
  • dynamic-audio-player-basic/trunk/readme.txt

    r1347480 r1376579  
    4949
    5050== Changelog ==
     51
     52= 2.3.0 =
     53Add "exclude from Shop page" option (for Woocommerce plugin).
    5154
    5255= 2.2.1 =
Note: See TracChangeset for help on using the changeset viewer.