Plugin Directory

Changeset 1577713


Ignore:
Timestamp:
01/19/2017 05:10:05 AM (9 years ago)
Author:
tallythemes
Message:

Fixed theme filter issue

Location:
tally-types/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tally-types/trunk/includes/settings-page.php

    r1564960 r1577713  
    6767    $id = 'carousel';
    6868    $options = get_option( TALLYTYPES_OPTION_NAME );
    69     $value = (isset($options[$id])) ? $options[$id] : TALLYTYPES_ENABLE_CAROUSEL;
     69    $value = (isset($options[$id])) ? $options[$id] : tallytypes_options_std('carousel');
    7070    $value = ($value == false) ? 0 : $value;
    7171    echo '<select name="'.TALLYTYPES_OPTION_NAME.'['.$id.']">';
     
    7777    $id = 'services';
    7878    $options = get_option( TALLYTYPES_OPTION_NAME );
    79     $value = (isset($options[$id])) ? $options[$id] : TALLYTYPES_ENABLE_SERVICES;
     79    $value = (isset($options[$id])) ? $options[$id] : tallytypes_options_std('services');
    8080    $value = ($value == false) ? 0 : $value;
    8181    echo '<select name="'.TALLYTYPES_OPTION_NAME.'['.$id.']">';
     
    8787    $id = 'testimonials';
    8888    $options = get_option( TALLYTYPES_OPTION_NAME );
    89     $value = (isset($options[$id])) ? $options[$id] : TALLYTYPES_ENABLE_TESTIMONIALS;
     89    $value = (isset($options[$id])) ? $options[$id] : tallytypes_options_std('testimonials');
    9090    $value = ($value == false) ? 0 : $value;
    9191    echo '<select name="'.TALLYTYPES_OPTION_NAME.'['.$id.']">';
     
    9797    $id = 'vcard';
    9898    $options = get_option( TALLYTYPES_OPTION_NAME );
    99     $value = (isset($options[$id])) ? $options[$id] : TALLYTYPES_ENABLE_VCARD;
     99    $value = (isset($options[$id])) ? $options[$id] : tallytypes_options_std('vcard');
    100100    $value = ($value == false) ? 0 : $value;
    101101    echo '<select name="'.TALLYTYPES_OPTION_NAME.'['.$id.']">';
     
    107107    $id = 'grid';
    108108    $options = get_option( TALLYTYPES_OPTION_NAME );
    109     $value = (isset($options[$id])) ? $options[$id] : TALLYTYPES_ENABLE_GRID;
     109    $value = (isset($options[$id])) ? $options[$id] : tallytypes_options_std('grid');
    110110    $value = ($value == false) ? 0 : $value;
    111111    echo '<select name="'.TALLYTYPES_OPTION_NAME.'['.$id.']">';
     
    117117    $id = 'slider';
    118118    $options = get_option( TALLYTYPES_OPTION_NAME );
    119     $value = (isset($options[$id])) ? $options[$id] : TALLYTYPES_ENABLE_SLIDER;
     119    $value = (isset($options[$id])) ? $options[$id] : tallytypes_options_std('slider');
    120120    $value = ($value == false) ? 0 : $value;
    121121    echo '<select name="'.TALLYTYPES_OPTION_NAME.'['.$id.']">';
     
    127127    $id = 'gallery';
    128128    $options = get_option( TALLYTYPES_OPTION_NAME );
    129     $value = (isset($options[$id])) ? $options[$id] : TALLYTYPES_ENABLE_GALLERY;
     129    $value = (isset($options[$id])) ? $options[$id] : tallytypes_options_std('gallery');
    130130    $value = ($value == false) ? 0 : $value;
    131131    echo '<select name="'.TALLYTYPES_OPTION_NAME.'['.$id.']">';
  • tally-types/trunk/readme.txt

    r1564960 r1577713  
    44Requires at least: 4.4
    55Tested up to: 4.7
    6 Stable tag: 3.0
     6Stable tag: 3.1
    77License: GPLv2
    88License URI: http://www.gnu.org/licenses/gpl-2.0.txt
     
    3737
    3838== Changelog ==
     39= 3.1 =
     40- FIXEDL the filter issue of TYPES from theme
     41
    3942= 3.0 =
    4043- Added new Post type Gallery
  • tally-types/trunk/tally-types.php

    r1564960 r1577713  
    77Plugin URI: http://tallythemes.com/
    88Description: Provide Custom Post Types and Metaboxes
    9 Version: 3.0
     9Version: 3.1
    1010Author: TallyThemes
    1111Author URI: http://tallythemes.com/
     
    4343define( 'TALLYTYPES_OPTION_NAME', apply_filters('tallytypes_option_name', 'tallytypes_option') );
    4444
    45 define( 'TALLYTYPES_ENABLE_CAROUSEL', apply_filters('tallytypes_enable_carousel', false) );
    46 define( 'TALLYTYPES_ENABLE_SERVICES', apply_filters('tallytypes_enable_services', false) );
    47 define( 'TALLYTYPES_ENABLE_TESTIMONIALS', apply_filters('tallytypes_enable_testimonials', false) );
    48 define( 'TALLYTYPES_ENABLE_VCARD', apply_filters('tallytypes_enable_vcard', false) );
    49 define( 'TALLYTYPES_ENABLE_GRID', apply_filters('tallytypes_enable_grid', false) );
    50 define( 'TALLYTYPES_ENABLE_SLIDER', apply_filters('tallytypes_enable_slider', false) );
    51 define( 'TALLYTYPES_ENABLE_GALLERY', apply_filters('tallytypes_enable_gallery', false) );
     45function tallytypes_options_std($name){
     46    if($name == 'carousel'){
     47        return apply_filters('tallytypes_enable_carousel', false);
     48    }elseif($name == 'services'){
     49        return apply_filters('tallytypes_enable_services', false);
     50    }elseif($name == 'testimonials'){
     51        return apply_filters('tallytypes_enable_testimonials', false);
     52    }elseif($name == 'vcard'){
     53        return apply_filters('tallytypes_enable_vcard', false);
     54    }elseif($name == 'grid'){
     55        return apply_filters('tallytypes_enable_grid', false);
     56    }elseif($name == 'slider'){
     57        return apply_filters('tallytypes_enable_slider', false);
     58    }elseif($name == 'gallery'){
     59        return apply_filters('tallytypes_enable_gallery', false);
     60    }else{
     61        return false;
     62    }
     63}
    5264
    5365include('includes/metabox-helper.php');
     
    5567include('includes/settings-page.php');
    5668
    57 $tallytypes_options = get_option( TALLYTYPES_OPTION_NAME );
     69$tallytypes_std_data = array(
     70    'carousel' => tallytypes_options_std('carousel'),
     71    'services' => tallytypes_options_std('services'),
     72    'testimonials' => tallytypes_options_std('testimonials'),
     73    'vcard' => tallytypes_options_std('vcard'),
     74    'grid' => tallytypes_options_std('grid'),
     75    'slider' => tallytypes_options_std('slider'),
     76    'gallery' => tallytypes_options_std('gallery'),
     77);
    5878
    59 $tallytypes_is_carousel = (isset($tallytypes_options['carousel'])) ? $tallytypes_options['carousel'] : TALLYTYPES_ENABLE_CAROUSEL;
    60 $tallytypes_is_services = (isset($tallytypes_options['services'])) ? $tallytypes_options['services'] : TALLYTYPES_ENABLE_SERVICES;
    61 $tallytypes_is_testimonials = (isset($tallytypes_options['testimonials'])) ? $tallytypes_options['testimonials'] : TALLYTYPES_ENABLE_TESTIMONIALS;
    62 $tallytypes_is_vcard = (isset($tallytypes_options['vcard'])) ? $tallytypes_options['vcard'] : TALLYTYPES_ENABLE_VCARD;
    63 $tallytypes_is_grid = (isset($tallytypes_options['grid'])) ? $tallytypes_options['grid'] : TALLYTYPES_ENABLE_GRID;
    64 $tallytypes_is_slider = (isset($tallytypes_options['slider'])) ? $tallytypes_options['slider'] : TALLYTYPES_ENABLE_SLIDER;
    65 $tallytypes_is_gallery = (isset($tallytypes_options['gallery'])) ? $tallytypes_options['gallery'] : TALLYTYPES_ENABLE_GALLERY;
     79$tallytypes_options = get_option( TALLYTYPES_OPTION_NAME, $tallytypes_std_data );
    6680
    67 if($tallytypes_is_carousel == true){
     81if($tallytypes_options['carousel'] == true){
    6882    include('types/carousel.php');
    6983}
    70 if($tallytypes_is_services == true){
     84if($tallytypes_options['services'] == true){
    7185    include('types/services.php');
    7286}
    73 if($tallytypes_is_testimonials == true){
     87if($tallytypes_options['testimonials'] == true){
    7488    include('types/testimonials.php');
    7589}
    76 if($tallytypes_is_vcard == true){
     90if($tallytypes_options['vcard'] == true){
    7791    include('types/vcard.php');
    7892}
    79 if($tallytypes_is_grid == true){
     93if($tallytypes_options['grid'] == true){
    8094    include('types/grid.php');
    8195}
    82 if($tallytypes_is_slider == true){
     96if($tallytypes_options['slider'] == true){
    8397    include('types/slider.php');
    8498}
    85 if($tallytypes_is_gallery == true){
     99if($tallytypes_options['gallery'] == true){
    86100    include('types/gallery.php');
    87101}
Note: See TracChangeset for help on using the changeset viewer.