Changeset 1577713
- Timestamp:
- 01/19/2017 05:10:05 AM (9 years ago)
- Location:
- tally-types/trunk
- Files:
-
- 3 edited
-
includes/settings-page.php (modified) (7 diffs)
-
readme.txt (modified) (2 diffs)
-
tally-types.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tally-types/trunk/includes/settings-page.php
r1564960 r1577713 67 67 $id = 'carousel'; 68 68 $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'); 70 70 $value = ($value == false) ? 0 : $value; 71 71 echo '<select name="'.TALLYTYPES_OPTION_NAME.'['.$id.']">'; … … 77 77 $id = 'services'; 78 78 $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'); 80 80 $value = ($value == false) ? 0 : $value; 81 81 echo '<select name="'.TALLYTYPES_OPTION_NAME.'['.$id.']">'; … … 87 87 $id = 'testimonials'; 88 88 $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'); 90 90 $value = ($value == false) ? 0 : $value; 91 91 echo '<select name="'.TALLYTYPES_OPTION_NAME.'['.$id.']">'; … … 97 97 $id = 'vcard'; 98 98 $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'); 100 100 $value = ($value == false) ? 0 : $value; 101 101 echo '<select name="'.TALLYTYPES_OPTION_NAME.'['.$id.']">'; … … 107 107 $id = 'grid'; 108 108 $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'); 110 110 $value = ($value == false) ? 0 : $value; 111 111 echo '<select name="'.TALLYTYPES_OPTION_NAME.'['.$id.']">'; … … 117 117 $id = 'slider'; 118 118 $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'); 120 120 $value = ($value == false) ? 0 : $value; 121 121 echo '<select name="'.TALLYTYPES_OPTION_NAME.'['.$id.']">'; … … 127 127 $id = 'gallery'; 128 128 $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'); 130 130 $value = ($value == false) ? 0 : $value; 131 131 echo '<select name="'.TALLYTYPES_OPTION_NAME.'['.$id.']">'; -
tally-types/trunk/readme.txt
r1564960 r1577713 4 4 Requires at least: 4.4 5 5 Tested up to: 4.7 6 Stable tag: 3. 06 Stable tag: 3.1 7 7 License: GPLv2 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.txt … … 37 37 38 38 == Changelog == 39 = 3.1 = 40 - FIXEDL the filter issue of TYPES from theme 41 39 42 = 3.0 = 40 43 - Added new Post type Gallery -
tally-types/trunk/tally-types.php
r1564960 r1577713 7 7 Plugin URI: http://tallythemes.com/ 8 8 Description: Provide Custom Post Types and Metaboxes 9 Version: 3. 09 Version: 3.1 10 10 Author: TallyThemes 11 11 Author URI: http://tallythemes.com/ … … 43 43 define( 'TALLYTYPES_OPTION_NAME', apply_filters('tallytypes_option_name', 'tallytypes_option') ); 44 44 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) ); 45 function 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 } 52 64 53 65 include('includes/metabox-helper.php'); … … 55 67 include('includes/settings-page.php'); 56 68 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 ); 58 78 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 ); 66 80 67 if($tallytypes_ is_carousel== true){81 if($tallytypes_options['carousel'] == true){ 68 82 include('types/carousel.php'); 69 83 } 70 if($tallytypes_ is_services== true){84 if($tallytypes_options['services'] == true){ 71 85 include('types/services.php'); 72 86 } 73 if($tallytypes_ is_testimonials== true){87 if($tallytypes_options['testimonials'] == true){ 74 88 include('types/testimonials.php'); 75 89 } 76 if($tallytypes_ is_vcard== true){90 if($tallytypes_options['vcard'] == true){ 77 91 include('types/vcard.php'); 78 92 } 79 if($tallytypes_ is_grid== true){93 if($tallytypes_options['grid'] == true){ 80 94 include('types/grid.php'); 81 95 } 82 if($tallytypes_ is_slider== true){96 if($tallytypes_options['slider'] == true){ 83 97 include('types/slider.php'); 84 98 } 85 if($tallytypes_ is_gallery== true){99 if($tallytypes_options['gallery'] == true){ 86 100 include('types/gallery.php'); 87 101 }
Note: See TracChangeset
for help on using the changeset viewer.