WordPress.org

Plugin Directory

Changeset 1564960


Ignore:
Timestamp:
12/30/16 12:30:39 (11 months ago)
Author:
tallythemes
Message:
  • Added new Post type Gallery
  • Improve Metabox class
  • Add new metabox field type "Image_size_select"
Location:
tally-types/trunk
Files:
1 added
4 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • tally-types/trunk/includes/metabox-helper.php

    r1546419 r1564960  
    279279 
    280280 
     281/*  Image size Select 
     282--------------------------------------*/ 
     283function tallytypes_mb_field_image_size_select($arg){ 
     284    extract(array_merge( tallytypes_mb_field_default_arguments(), $arg )); 
     285    if($name == ''){ $name = $id; } 
     286    global $_wp_additional_image_sizes;  
     287     
     288    /* doing some data validation for Database output */ 
     289    $value = tallytypes_mb_field_sanitize($sanitize, $value); 
     290 
     291    tallytypes_mb_field_before($id, $title, $class); 
     292        echo '<select name="'.$name.'" id="'.$id.'">'; 
     293            echo '<option value="">--</option>'; 
     294            echo '<option value="thumbnail" '.selected($value, 'thumbnail').'>thumbnail</option>'; 
     295            echo '<option value="medium" '.selected($value, 'medium').'>medium</option>'; 
     296            echo '<option value="large" '.selected($value, 'large').'>large</option>'; 
     297            echo '<option value="full" '.selected($value, 'full').'>full</option>'; 
     298            foreach ( $_wp_additional_image_sizes as $item_key => $item ) {  
     299                echo '<option value="'.$item_key.'" '.selected($value, $item_key).'>'.$item_key.' ('.$item['width'].'x'.$item['height'].')</option>';        
     300            } 
     301        echo '</select>'; 
     302    tallytypes_mb_field_after($des); 
     303} 
     304 
     305 
    281306 
    282307/*  Class of the metabox generator 
     
    335360                    $field['value'] = $saved_value; 
    336361                } 
    337                 if($field['type'] == 'text'){ 
    338                     tallytypes_mb_field_text($field); 
    339                 }elseif($field['type'] == 'textarea'){ 
    340                     tallytypes_mb_field_textarea($field); 
    341                 }elseif($field['type'] == 'select'){ 
    342                     tallytypes_mb_field_select($field); 
    343                 }elseif($field['type'] == 'image_upload'){ 
    344                     tallytypes_mb_field_image_upload($field); 
    345                 }elseif($field['type'] == 'group'){ 
    346                     tallytypes_mb_field_group($field); 
    347                 }elseif($field['type'] == 'color'){ 
    348                     tallytypes_mb_field_color($field); 
    349                 } 
     362                 
     363                $field_function_name = 'tallytypes_mb_field_'.$field['type']; 
     364                if(function_exists($field_function_name)){ 
     365                    $field_function_name($field); 
     366                } 
     367                 
    350368            } 
    351369        } 
  • tally-types/trunk/includes/settings-page.php

    r1546419 r1564960  
    5050    add_settings_field( 'grid', 'Enabal Grid','tallytypes_field_render_5', 'tallytypes', 'tallytypes_pluginPage_section'); 
    5151    add_settings_field( 'Slider', 'Enabal Slider','tallytypes_field_render_6', 'tallytypes', 'tallytypes_pluginPage_section'); 
     52    add_settings_field( 'Gallery', 'Enabal Gallery','tallytypes_field_render_7', 'tallytypes', 'tallytypes_pluginPage_section'); 
    5253} 
    5354 
     
    123124    echo '</select>'; 
    124125} 
     126function tallytypes_field_render_7(){  
     127    $id = 'gallery'; 
     128    $options = get_option( TALLYTYPES_OPTION_NAME ); 
     129    $value = (isset($options[$id])) ? $options[$id] : TALLYTYPES_ENABLE_GALLERY; 
     130    $value = ($value == false) ? 0 : $value; 
     131    echo '<select name="'.TALLYTYPES_OPTION_NAME.'['.$id.']">'; 
     132        echo '<option value="1" '.selected( $value, 1, false ).'>Yes</option>'; 
     133        echo '<option value="0" '.selected( $value, 0, false ).'>No</option>'; 
     134    echo '</select>'; 
     135} 
  • tally-types/trunk/readme.txt

    r1546419 r1564960  
    44Requires at least: 4.4 
    55Tested up to: 4.7 
    6 Stable tag: 2.0 
     6Stable tag: 3.0 
    77License: GPLv2 
    88License URI: http://www.gnu.org/licenses/gpl-2.0.txt 
     
    3737 
    3838== Changelog == 
     39= 3.0 = 
     40- Added new Post type Gallery 
     41- Improve Metabox class 
     42- Add new metabox field type "Image_size_select" 
     43 
    3944= 2.0 = 
    4045- Added new Post type Grid and Slider 
  • tally-types/trunk/tally-types.php

    r1546419 r1564960  
    77Plugin URI: http://tallythemes.com/ 
    88Description: Provide Custom Post Types and Metaboxes 
    9 Version: 2.0 
     9Version: 3.0 
    1010Author: TallyThemes 
    1111Author URI: http://tallythemes.com/ 
     
    4040define( 'TALLYTYPES_URL', plugin_dir_url( __FILE__ ) ); 
    4141define( 'TALLYTYPES_DRI', plugin_dir_path( __FILE__ ) ); 
     42 
    4243define( 'TALLYTYPES_OPTION_NAME', apply_filters('tallytypes_option_name', 'tallytypes_option') ); 
    43 define( 'TALLYTYPES_ENABLE_CAROUSEL', apply_filters('tallytypes_enable_carousel', true) ); 
    44 define( 'TALLYTYPES_ENABLE_SERVICES', apply_filters('tallytypes_enable_services', true) ); 
    45 define( 'TALLYTYPES_ENABLE_TESTIMONIALS', apply_filters('tallytypes_enable_testimonials', true) ); 
    46 define( 'TALLYTYPES_ENABLE_VCARD', apply_filters('tallytypes_enable_vcard', true) ); 
    47 define( 'TALLYTYPES_ENABLE_GRID', apply_filters('tallytypes_enable_grid', true) ); 
    48 define( 'TALLYTYPES_ENABLE_SLIDER', apply_filters('tallytypes_enable_slider', true) ); 
     44 
     45define( 'TALLYTYPES_ENABLE_CAROUSEL', apply_filters('tallytypes_enable_carousel', false) ); 
     46define( 'TALLYTYPES_ENABLE_SERVICES', apply_filters('tallytypes_enable_services', false) ); 
     47define( 'TALLYTYPES_ENABLE_TESTIMONIALS', apply_filters('tallytypes_enable_testimonials', false) ); 
     48define( 'TALLYTYPES_ENABLE_VCARD', apply_filters('tallytypes_enable_vcard', false) ); 
     49define( 'TALLYTYPES_ENABLE_GRID', apply_filters('tallytypes_enable_grid', false) ); 
     50define( 'TALLYTYPES_ENABLE_SLIDER', apply_filters('tallytypes_enable_slider', false) ); 
     51define( 'TALLYTYPES_ENABLE_GALLERY', apply_filters('tallytypes_enable_gallery', false) ); 
    4952 
    5053include('includes/metabox-helper.php'); 
     
    6063$tallytypes_is_grid = (isset($tallytypes_options['grid'])) ? $tallytypes_options['grid'] : TALLYTYPES_ENABLE_GRID; 
    6164$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; 
    6266 
    6367if($tallytypes_is_carousel == true){ 
     
    7983    include('types/slider.php'); 
    8084} 
     85if($tallytypes_is_gallery == true){ 
     86    include('types/gallery.php'); 
     87} 
Note: See TracChangeset for help on using the changeset viewer.