WordPress.org

Plugin Directory

Changeset 718500


Ignore:
Timestamp:
05/26/13 16:23:28 (11 months ago)
Author:
eskapism
Message:

version 1.3.2

Location:
simple-fields
Files:
9 edited
21 copied

Legend:

Unmodified
Added
Removed
  • simple-fields/tags/1.3.2/field_types/field_date_v2.php

    r647599 r718500  
    240240            $str_set_date = ""; 
    241241            $str_unixtime_to_set = ""; 
     242 
    242243            if (isset($options["use_defaults"]) && $options["use_defaults"]) { 
     244 
    243245                if (isset($options["default_date"]) && $options["default_date"] === "today") { 
     246 
    244247                    $str_unixtime_to_set = time() * 1000; 
    245248                    $str_iso_to_set = date("Y/m/d H:i"); 
     249 
    246250                } elseif (isset($options["default_date"]) && $options["default_date"] === "no_date") { 
    247251                     
    248252                } 
    249253            } else { 
     254 
    250255                $str_saved_unixtime = $saved_values["saved_date_time"]; 
     256 
    251257                // convert saved values to unixtime 
    252258                // echo "Saved value: $str_saved_unixtime"; 
     
    291297            // $locale = "sv"; 
    292298 
    293             if ($str_unixtime_to_set) { 
     299            if ( $str_unixtime_to_set ) { 
    294300                // If saved value exists then set date to this value on load 
    295301                // The display: none-thingie is added beause the date picker get shown by setDate-method 
    296302                // Unsure if bug or feature, but annoying anyway. 
     303 
    297304                $str_set_date = ' 
    298305                    var date_saved = new Date("'.$str_iso_to_set.'"); 
     
    300307                    $( "#ui-datepicker-div" ).css("display","none"); 
    301308                '; 
     309 
     310            } 
     311 
     312            // don't set a date if default date is no_date and no date is selected 
     313            // (actually unset what we previosly set) 
     314            if ( empty( $str_saved_unixtime ) && isset($options["default_date"]) && $options["default_date"] === "no_date") { 
     315                 
     316                // echo "<br>unset date/make no date selected"; 
     317                $str_set_date .= ' 
     318                    $( "#%1$s" ).'.$method_name.'("setDate", ""); 
     319                '; 
     320 
    302321            } 
    303322 
     
    338357                $this->get_options_id("gui_selected_date"), 
    339358                $this->get_options_name("gui_selected_date"), 
    340                 $this->get_options_id("saved_date_time"), 
    341                 $this->get_options_name("saved_date_time"), 
     359                $this->get_options_id("saved_date_time"), // 3 
     360                $this->get_options_name("saved_date_time"), // 
    342361                "", // 5 
    343362                $str_saved_unixtime, // 6 
  • simple-fields/tags/1.3.2/field_types/field_example.php

    r609729 r718500  
    66 */ 
    77 
     8// Notify user if Simple Fields is not installed 
     9add_action("admin_notices", "simple_fields_field_example_check_simple_fields_installed"); 
     10 
    811// Make sure simple fields have loaded before we try to do anything. Will get errors otherwise. 
    9 add_action("plugins_loaded", "init_simple_fields_field_example"); 
     12add_action("simple_fields_register_field_types", "init_simple_fields_field_example"); 
    1013 
     14 
     15// Check if Simple Fields is installed and notify user if not 
     16function simple_fields_field_example_check_simple_fields_installed() { 
     17 
     18    $plugin_is_active = is_plugin_active("Simple-Fields-GIT/simple_fields.php") || is_plugin_active("Simple-Fields/simple_fields.php"); 
     19    if ( ! $plugin_is_active ) { 
     20        ?> 
     21        <div class="error"> 
     22            <p><?php _e('To use the plugin <em>Simple Fields Example Extension</em> you must also have <a target="_blank" href="http://wordpress.org/extend/plugins/simple-fields/">Simple Fields</a> installed.', 'simple-fields-field-example'); ?></p> 
     23        </div> 
     24        <?php 
     25    } 
     26 
     27} 
     28 
     29// Main function, that holds the main class with the field 
    1130function init_simple_fields_field_example() { 
    1231     
  • simple-fields/tags/1.3.2/field_types/field_minimalistic_example.php

    r609729 r718500  
    11<?php 
    22 
    3 add_action("plugins_loaded", "init_simple_fields_field_minimalexample"); 
     3add_action("simple_fields_register_field_types", "init_simple_fields_field_minimalexample"); 
    44 
    55function init_simple_fields_field_minimalexample() { 
  • simple-fields/tags/1.3.2/functions.php

    r707484 r718500  
    11971197    } 
    11981198 
     1199    // Make sure post_types is an array (this allows for post_types to be a string) 
     1200    if ( isset($new_post_connector["post_types"]) && ! is_array($new_post_connector["post_types"]) ) { 
     1201        $new_post_connector["post_types"] = (array) $new_post_connector["post_types"]; 
     1202    } 
     1203 
    11991204    // Setup defaults to merge to 
    12001205    if ($is_new_connector) { 
  • simple-fields/tags/1.3.2/readme.txt

    r710189 r718500  
    55Requires at least: 3.5.1 
    66Tested up to: 3.5.1 
    7 Stable tag: 1.3.1 
     7Stable tag: 1.3.2 
    88 
    99With Simple Fields you can add any kind of custom fields to your pages, posts and attachments. 
     
    144144 
    145145== Changelog == 
     146 
     147#### Version 1.3.2 
     148 
     149- Updated field extension example with code to notify user that they must have simple fields 
     150installed to use the plugin 
     151 
     152- simple_fields_register_post_connector can now accept a string in the post_types argument,  
     153if only one post type is to be connected 
    146154 
    147155#### Version 1.3.1 
  • simple-fields/tags/1.3.2/simple_fields.php

    r707596 r718500  
    44Plugin URI: http://simple-fields.com 
    55Description: Add groups of textareas, input-fields, dropdowns, radiobuttons, checkboxes and files to your edit post screen. 
    6 Version: 1.3.1 
     6Version: 1.3.2 
    77Author: Pär Thernström 
    88Author URI: http://eskapism.se/ 
     
    5353    function init() { 
    5454 
    55         define( "SIMPLE_FIELDS_VERSION", "1.3.1"); 
     55        define( "SIMPLE_FIELDS_VERSION", "1.3.2"); 
    5656        define( "SIMPLE_FIELDS_URL", plugins_url(basename(dirname(__FILE__))). "/"); 
    5757        define( "SIMPLE_FIELDS_NAME", "Simple Fields"); 
  • simple-fields/trunk/field_types/field_date_v2.php

    r647599 r718500  
    240240            $str_set_date = ""; 
    241241            $str_unixtime_to_set = ""; 
     242 
    242243            if (isset($options["use_defaults"]) && $options["use_defaults"]) { 
     244 
    243245                if (isset($options["default_date"]) && $options["default_date"] === "today") { 
     246 
    244247                    $str_unixtime_to_set = time() * 1000; 
    245248                    $str_iso_to_set = date("Y/m/d H:i"); 
     249 
    246250                } elseif (isset($options["default_date"]) && $options["default_date"] === "no_date") { 
    247251                     
    248252                } 
    249253            } else { 
     254 
    250255                $str_saved_unixtime = $saved_values["saved_date_time"]; 
     256 
    251257                // convert saved values to unixtime 
    252258                // echo "Saved value: $str_saved_unixtime"; 
     
    291297            // $locale = "sv"; 
    292298 
    293             if ($str_unixtime_to_set) { 
     299            if ( $str_unixtime_to_set ) { 
    294300                // If saved value exists then set date to this value on load 
    295301                // The display: none-thingie is added beause the date picker get shown by setDate-method 
    296302                // Unsure if bug or feature, but annoying anyway. 
     303 
    297304                $str_set_date = ' 
    298305                    var date_saved = new Date("'.$str_iso_to_set.'"); 
     
    300307                    $( "#ui-datepicker-div" ).css("display","none"); 
    301308                '; 
     309 
     310            } 
     311 
     312            // don't set a date if default date is no_date and no date is selected 
     313            // (actually unset what we previosly set) 
     314            if ( empty( $str_saved_unixtime ) && isset($options["default_date"]) && $options["default_date"] === "no_date") { 
     315                 
     316                // echo "<br>unset date/make no date selected"; 
     317                $str_set_date .= ' 
     318                    $( "#%1$s" ).'.$method_name.'("setDate", ""); 
     319                '; 
     320 
    302321            } 
    303322 
     
    338357                $this->get_options_id("gui_selected_date"), 
    339358                $this->get_options_name("gui_selected_date"), 
    340                 $this->get_options_id("saved_date_time"), 
    341                 $this->get_options_name("saved_date_time"), 
     359                $this->get_options_id("saved_date_time"), // 3 
     360                $this->get_options_name("saved_date_time"), // 
    342361                "", // 5 
    343362                $str_saved_unixtime, // 6 
  • simple-fields/trunk/field_types/field_example.php

    r609729 r718500  
    66 */ 
    77 
     8// Notify user if Simple Fields is not installed 
     9add_action("admin_notices", "simple_fields_field_example_check_simple_fields_installed"); 
     10 
    811// Make sure simple fields have loaded before we try to do anything. Will get errors otherwise. 
    9 add_action("plugins_loaded", "init_simple_fields_field_example"); 
     12add_action("simple_fields_register_field_types", "init_simple_fields_field_example"); 
    1013 
     14 
     15// Check if Simple Fields is installed and notify user if not 
     16function simple_fields_field_example_check_simple_fields_installed() { 
     17 
     18    $plugin_is_active = is_plugin_active("Simple-Fields-GIT/simple_fields.php") || is_plugin_active("Simple-Fields/simple_fields.php"); 
     19    if ( ! $plugin_is_active ) { 
     20        ?> 
     21        <div class="error"> 
     22            <p><?php _e('To use the plugin <em>Simple Fields Example Extension</em> you must also have <a target="_blank" href="http://wordpress.org/extend/plugins/simple-fields/">Simple Fields</a> installed.', 'simple-fields-field-example'); ?></p> 
     23        </div> 
     24        <?php 
     25    } 
     26 
     27} 
     28 
     29// Main function, that holds the main class with the field 
    1130function init_simple_fields_field_example() { 
    1231     
  • simple-fields/trunk/field_types/field_minimalistic_example.php

    r609729 r718500  
    11<?php 
    22 
    3 add_action("plugins_loaded", "init_simple_fields_field_minimalexample"); 
     3add_action("simple_fields_register_field_types", "init_simple_fields_field_minimalexample"); 
    44 
    55function init_simple_fields_field_minimalexample() { 
  • simple-fields/trunk/functions.php

    r707484 r718500  
    11971197    } 
    11981198 
     1199    // Make sure post_types is an array (this allows for post_types to be a string) 
     1200    if ( isset($new_post_connector["post_types"]) && ! is_array($new_post_connector["post_types"]) ) { 
     1201        $new_post_connector["post_types"] = (array) $new_post_connector["post_types"]; 
     1202    } 
     1203 
    11991204    // Setup defaults to merge to 
    12001205    if ($is_new_connector) { 
  • simple-fields/trunk/readme.txt

    r710189 r718500  
    55Requires at least: 3.5.1 
    66Tested up to: 3.5.1 
    7 Stable tag: 1.3.1 
     7Stable tag: 1.3.2 
    88 
    99With Simple Fields you can add any kind of custom fields to your pages, posts and attachments. 
     
    144144 
    145145== Changelog == 
     146 
     147#### Version 1.3.2 
     148 
     149- Updated field extension example with code to notify user that they must have simple fields 
     150installed to use the plugin 
     151 
     152- simple_fields_register_post_connector can now accept a string in the post_types argument,  
     153if only one post type is to be connected 
    146154 
    147155#### Version 1.3.1 
  • simple-fields/trunk/simple_fields.php

    r707596 r718500  
    44Plugin URI: http://simple-fields.com 
    55Description: Add groups of textareas, input-fields, dropdowns, radiobuttons, checkboxes and files to your edit post screen. 
    6 Version: 1.3.1 
     6Version: 1.3.2 
    77Author: Pär Thernström 
    88Author URI: http://eskapism.se/ 
     
    5353    function init() { 
    5454 
    55         define( "SIMPLE_FIELDS_VERSION", "1.3.1"); 
     55        define( "SIMPLE_FIELDS_VERSION", "1.3.2"); 
    5656        define( "SIMPLE_FIELDS_URL", plugins_url(basename(dirname(__FILE__))). "/"); 
    5757        define( "SIMPLE_FIELDS_NAME", "Simple Fields"); 
Note: See TracChangeset for help on using the changeset viewer.