Plugin Directory

Changeset 2415078


Ignore:
Timestamp:
11/09/2020 10:38:04 AM (5 years ago)
Author:
qlstudio
Message:

Update to version 0.5.7 from GitHub

Location:
advanced-custom-fields-number-slider
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • advanced-custom-fields-number-slider/tags/0.5.7/acf-number-slider.php

    r2371244 r2415078  
    22
    33/*
    4 Plugin Name:    Advanced Custom Fields: Number Slider
    5 Plugin URI:     http://www.qstudio.us/plugins/
    6 Description:    Number Slider field for Advanced Custom Fields
    7 Version:        0.5.6
    8 Author:         Q Studio
    9 Author URI:     http://www.qstudio.us
    10 License:        GPLv2 or later
    11 License URI:    http://www.gnu.org/licenses/gpl-2.0.html
     4 * Plugin Name:         Advanced Custom Fields: Number Slider
     5 * Plugin URI:          https://qstudio.us
     6 * Description:         Number Slider field for Advanced Custom Fields
     7 * Version:             0.5.7
     8 * Author:              Q Studio
     9 * Author URI:          https://qstudio.us
     10 * License:             GPLv3 or later
     11 * License URI:         http://www.gnu.org/licenses/gpl-2.0.html
     12 * GitHub Plugin URI:   qstudio/advanced-custom-fields-number-slider
    1213*/
    1314
     
    1718 */
    1819
    19 class acf_field_number_slider_plugin
    20 {
     20class acf_field_number_slider_plugin{
    2121   
    2222    /*
     
    2626    *  @since: 0.1
    2727    */
    28     function __construct()
    29     {
     28    public function __construct(){
    3029       
    3130        // set text domain
    32         $domain = 'acf-number_slider';
    33         $mofile = trailingslashit( dirname(__FILE__)) . 'lang/' . $domain . '-' . get_locale() . '.mo';
    34         load_textdomain( $domain, $mofile );
     31        $mo_file = trailingslashit( dirname(__FILE__)) . 'lang/' . 'acf-number_slider' . '-' . get_locale() . '.mo';
     32        load_textdomain( 'acf-number_slider', $mo_file );
    3533
    3634        // version 4+
     
    3937        // version 3-
    4038        add_action( 'init', array( $this, 'init' ));
    41        
     39       
     40        // add config ##
    4241        add_action('acf/include_field_types', array($this, 'include_field_types_number_slider'));   
    4342       
     
    5251    *  @created: 1/04/13
    5352    */
    54     function init()
    55     {
     53    public function init(){
     54
    5655        if ( function_exists('register_field') ) {
    5756           
     
    6261    }
    6362
     63   
    6464    /*
    6565    *  register_fields
     
    6969    *  @created: 1/04/13
    7070    */
    71     function register_fields()
    72     {
    73         include_once('number-slider-v4.php');
     71    public function register_fields(){
     72
     73        include_once('number-slider-v4.php');
     74       
    7475    }
    7576   
    76     function include_field_types_number_slider( $version ) {
     77    public function include_field_types_number_slider( $version ) {
    7778   
    7879        include_once('number-slider-v5.php');
  • advanced-custom-fields-number-slider/tags/0.5.7/number-slider-v5.php

    r2371244 r2415078  
    5151            'increment_value' => 1,
    5252            'slider_units' => "%",
     53            'slider_append' => "",
    5354            'default_value' => 0,
    5455        );
     
    111112            'name'          => 'default_value',
    112113        ));
    113 
    114114       
    115115        acf_render_field_setting( $field, array(
     
    133133            'name'          => 'increment_value',
    134134        ));
     135
     136        acf_render_field_setting( $field, array(
     137            'label'         => __('Append','acf-number_slider'),
     138            'instructions'  => __('Appears after the input','acf-number_slider'),
     139            'type'          => 'text',
     140            'name'          => 'slider_append',
     141        ));
    135142       
    136143
     
    155162   
    156163    function render_field( $field ) {
    157        
    158        
    159         // create a random ID ##
    160164           
    161165        $default = ( intval($field['default_value'] ) < intval($field['slider_min_value'] ) ) ? intval($field['default_value']) : intval($field['slider_min_value']);
     
    166170        <input type="text" value="<?php echo $value; ?>" name="<?php echo $field['name'] ?> " class="simple_slider" title="<?php echo $field['label'] ?>" data-slider="true" data-slider-highlight="true" data-slider-range="<?php echo $field['slider_min_value'] ?>,<?php echo $field['slider_max_value']; ?>" data-slider-step="<?php echo $field['increment_value']; ?>" data-slider-snap="true" data-units="<?php echo $field['slider_units']; ?>"/>
    167171       
    168         <p class="description slide"><?php echo $value; ?><?php echo $field['slider_units']; ?></p>
     172        <p class="description slide"><?php echo $value; ?> <?php echo $field['slider_units']; ?></p>
    169173   
    170174<?php
     
    191195    function input_admin_enqueue_scripts() {
    192196       
     197        // get plugin directory ##
    193198        $dir = plugin_dir_url( __FILE__ );
    194199       
    195         /*
    196    
    197         // register & include JS
    198         wp_register_script( 'acf-input-number_slider', "{$dir}js/input.js" );
    199         wp_enqueue_script('acf-input-number_slider');
    200        
    201        
    202         // register & include CSS
    203         wp_register_style( 'acf-input-number_slider', "{$dir}css/input.css" );
    204         wp_enqueue_style('acf-input-number_slider');
    205         */
    206        
    207        
    208       // add JS ##
     200        // add ACF JS ##
    209201        wp_enqueue_script( 'ss-input', $dir . 'js/input.js', array( 'jquery' ), $this->version, false );
    210202       
    211 
     203        // add simple slider ##
    212204        wp_enqueue_script( 'jquery-simple-slider', $dir . 'js/simple-slider.js', array( 'jquery' ), $this->version, false );
    213205
     
    217209       
    218210    }
    219    
    220    
    221    
    222     /*
    223     *  input_admin_head()
    224     *
    225     *  This action is called in the admin_head action on the edit screen where your field is created.
    226     *  Use this action to add CSS and JavaScript to assist your render_field() action.
    227     *
    228     *  @type    action (admin_head)
    229     *  @since   3.6
    230     *  @date    23/01/13
    231     *
    232     *  @param   n/a
    233     *  @return  n/a
    234     */
    235 
    236     /*
    237        
    238     function input_admin_head() {
    239    
    240        
    241        
    242     }
    243    
    244     */
    245    
    246    
    247     /*
    248     *  input_form_data()
    249     *
    250     *  This function is called once on the 'input' page between the head and footer
    251     *  There are 2 situations where ACF did not load during the 'acf/input_admin_enqueue_scripts' and
    252     *  'acf/input_admin_head' actions because ACF did not know it was going to be used. These situations are
    253     *  seen on comments / user edit forms on the front end. This function will always be called, and includes
    254     *  $args that related to the current screen such as $args['post_id']
    255     *
    256     *  @type    function
    257     *  @date    6/03/2014
    258     *  @since   5.0.0
    259     *
    260     *  @param   $args (array)
    261     *  @return  n/a
    262     */
    263    
    264     /*
    265    
    266     function input_form_data( $args ) {
    267        
    268        
    269    
    270     }
    271    
    272     */
    273    
    274    
    275     /*
    276     *  input_admin_footer()
    277     *
    278     *  This action is called in the admin_footer action on the edit screen where your field is created.
    279     *  Use this action to add CSS and JavaScript to assist your render_field() action.
    280     *
    281     *  @type    action (admin_footer)
    282     *  @since   3.6
    283     *  @date    23/01/13
    284     *
    285     *  @param   n/a
    286     *  @return  n/a
    287     */
    288 
    289     /*
    290        
    291     function input_admin_footer() {
    292    
    293        
    294        
    295     }
    296    
    297     */
    298    
    299    
    300     /*
    301     *  field_group_admin_enqueue_scripts()
    302     *
    303     *  This action is called in the admin_enqueue_scripts action on the edit screen where your field is edited.
    304     *  Use this action to add CSS + JavaScript to assist your render_field_options() action.
    305     *
    306     *  @type    action (admin_enqueue_scripts)
    307     *  @since   3.6
    308     *  @date    23/01/13
    309     *
    310     *  @param   n/a
    311     *  @return  n/a
    312     */
    313 
    314     /*
    315    
    316     function field_group_admin_enqueue_scripts() {
    317        
    318     }
    319    
    320     */
    321 
    322    
    323     /*
    324     *  field_group_admin_head()
    325     *
    326     *  This action is called in the admin_head action on the edit screen where your field is edited.
    327     *  Use this action to add CSS and JavaScript to assist your render_field_options() action.
    328     *
    329     *  @type    action (admin_head)
    330     *  @since   3.6
    331     *  @date    23/01/13
    332     *
    333     *  @param   n/a
    334     *  @return  n/a
    335     */
    336     /*
    337    
    338     function field_group_admin_head() {
    339    
    340     }
    341    
    342     */
    343211
    344212
     
    381249    function update_value( $value, $post_id, $field ) {
    382250
    383             #logger($field['name']);
    384             #logger($value);
    385 
    386             return (int)$value;
     251        #logger($field['name']);
     252        #logger($value);
     253
     254        return (int)$value;
    387255
    388256    }
     
    408276   
    409277    function format_value( $value, $post_id, $field ) {
    410        
    411          return (int)$value;
    412     }
    413    
    414    
    415    
    416     /*
    417     *  validate_value()
    418     *
    419     *  This filter is used to perform validation on the value prior to saving.
    420     *  All values are validated regardless of the field's required setting. This allows you to validate and return
    421     *  messages to the user if the value is not correct
    422     *
    423     *  @type    filter
    424     *  @date    11/02/2014
    425     *  @since   5.0.0
    426     *
    427     *  @param   $valid (boolean) validation status based on the value and the field's required setting
    428     *  @param   $value (mixed) the $_POST value
    429     *  @param   $field (array) the field array holding all the field options
    430     *  @param   $input (string) the corresponding input name for $_POST value
    431     *  @return  $valid
    432     */
    433    
    434     /*
    435    
    436     function validate_value( $valid, $value, $field, $input ){
    437        
    438         // Basic usage
    439         if( $value < $field['custom_minimum_setting'] )
    440         {
    441             $valid = false;
    442         }
    443        
    444        
    445         // Advanced usage
    446         if( $value < $field['custom_minimum_setting'] )
    447         {
    448             $valid = __('The value is too little!','acf-number_slider'),
    449         }
    450        
    451        
    452         // return
    453         return $valid;
    454        
    455     }
    456    
    457     */
    458    
    459    
    460     /*
    461     *  delete_value()
    462     *
    463     *  This action is fired after a value has been deleted from the db.
    464     *  Please note that saving a blank value is treated as an update, not a delete
    465     *
    466     *  @type    action
    467     *  @date    6/03/2014
    468     *  @since   5.0.0
    469     *
    470     *  @param   $post_id (mixed) the $post_id from which the value was deleted
    471     *  @param   $key (string) the $meta_key which the value was deleted
    472     *  @return  n/a
    473     */
    474    
    475     /*
    476    
    477     function delete_value( $post_id, $key ) {
    478        
    479        
    480        
    481     }
    482    
    483     */
     278
     279        // \willow\core\helper::log( $field );
     280
     281        // check if we need to append a value ##
     282        $append = isset( $field['slider_append'] ) ? $field['slider_append'] : '';
     283       
     284        // kick back value, with append - if set ##
     285        return ( (int)$value ).' '.$append;
     286
     287    }
     288   
    484289   
    485290   
     
    497302    */
    498303   
    499     /*
    500    
    501304    function load_field( $field ) {
    502        
     305
    503306        return $field;
    504307       
    505308    }   
    506    
    507     */
    508    
    509    
    510     /*
    511     *  update_field()
    512     *
    513     *  This filter is applied to the $field before it is saved to the database
    514     *
    515     *  @type    filter
    516     *  @date    23/01/2013
    517     *  @since   3.6.0
    518     *
    519     *  @param   $field (array) the field array holding all the field options
    520     *  @return  $field
    521     */
    522    
    523     /*
    524    
    525     function update_field( $field ) {
    526        
    527         return $field;
    528        
    529     }   
    530    
    531     */
    532    
    533    
    534     /*
    535     *  delete_field()
    536     *
    537     *  This action is fired after a field is deleted from the database
    538     *
    539     *  @type    action
    540     *  @date    11/02/2014
    541     *  @since   5.0.0
    542     *
    543     *  @param   $field (array) the field array holding all the field options
    544     *  @return  n/a
    545     */
    546    
    547     /*
    548    
    549     function delete_field( $field ) {
    550        
    551        
    552        
    553     }   
    554    
    555     */
    556309   
    557310   
  • advanced-custom-fields-number-slider/tags/0.5.7/readme.md

    r2371244 r2415078  
    1 # Advanced Custom Fields: Number Slider #
     1# Advanced Custom Fields: Number Slider # 
    22**Contributors:** qlstudio 
    3 **Tags:** acf, advanced custom field, number, slider, slide, select, integer 
    4 **Requires at least:** 4.0.0 
    5 **Tested up to:** 5.5.0
    6 **Stable tag:** 0.5.6
     3**Tags:** acf, advanced custom field, number, slider, slide, select, integer   
     4**Requires at least:** 4.0.0   
     5**Tested up to:** 5.5.
     6**Stable tag:** 0.5.
    77**License:** GPLv2 or later 
    88**License URI:** http://www.gnu.org/licenses/gpl-2.0.html 
     
    6464## Changelog ##
    6565
     66### 0.5.7 ###
     67
     68* Added append value to return string
     69
    6670### 0.5.6 ###
    6771
  • advanced-custom-fields-number-slider/tags/0.5.7/readme.txt

    r2371244 r2415078  
    11=== Advanced Custom Fields: Number Slider ===
    2 Contributors: qlstudio
    3 Tags: acf, advanced custom field, number, slider, slide, select, integer
    4 Requires at least: 4.0.0
    5 Tested up to: 5.5.0
    6 Stable tag: 0.5.6
    7 License: GPLv3 or later
     2Contributors: qlstudio 
     3Tags: acf, advanced custom field, number, slider, slide, select, integer 
     4Requires at least: 4.0.0 
     5Tested up to: 5.5.
     6Stable tag: 0.5.
     7License: GPLv3 or later 
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
    99
     
    6161== Changelog ==
    6262
     63= 0.5.7 =
     64
     65* Added append value to return string
     66
    6367= 0.5.6 =
    6468
  • advanced-custom-fields-number-slider/trunk/acf-number-slider.php

    r2371244 r2415078  
    22
    33/*
    4 Plugin Name:    Advanced Custom Fields: Number Slider
    5 Plugin URI:     http://www.qstudio.us/plugins/
    6 Description:    Number Slider field for Advanced Custom Fields
    7 Version:        0.5.6
    8 Author:         Q Studio
    9 Author URI:     http://www.qstudio.us
    10 License:        GPLv2 or later
    11 License URI:    http://www.gnu.org/licenses/gpl-2.0.html
     4 * Plugin Name:         Advanced Custom Fields: Number Slider
     5 * Plugin URI:          https://qstudio.us
     6 * Description:         Number Slider field for Advanced Custom Fields
     7 * Version:             0.5.7
     8 * Author:              Q Studio
     9 * Author URI:          https://qstudio.us
     10 * License:             GPLv3 or later
     11 * License URI:         http://www.gnu.org/licenses/gpl-2.0.html
     12 * GitHub Plugin URI:   qstudio/advanced-custom-fields-number-slider
    1213*/
    1314
     
    1718 */
    1819
    19 class acf_field_number_slider_plugin
    20 {
     20class acf_field_number_slider_plugin{
    2121   
    2222    /*
     
    2626    *  @since: 0.1
    2727    */
    28     function __construct()
    29     {
     28    public function __construct(){
    3029       
    3130        // set text domain
    32         $domain = 'acf-number_slider';
    33         $mofile = trailingslashit( dirname(__FILE__)) . 'lang/' . $domain . '-' . get_locale() . '.mo';
    34         load_textdomain( $domain, $mofile );
     31        $mo_file = trailingslashit( dirname(__FILE__)) . 'lang/' . 'acf-number_slider' . '-' . get_locale() . '.mo';
     32        load_textdomain( 'acf-number_slider', $mo_file );
    3533
    3634        // version 4+
     
    3937        // version 3-
    4038        add_action( 'init', array( $this, 'init' ));
    41        
     39       
     40        // add config ##
    4241        add_action('acf/include_field_types', array($this, 'include_field_types_number_slider'));   
    4342       
     
    5251    *  @created: 1/04/13
    5352    */
    54     function init()
    55     {
     53    public function init(){
     54
    5655        if ( function_exists('register_field') ) {
    5756           
     
    6261    }
    6362
     63   
    6464    /*
    6565    *  register_fields
     
    6969    *  @created: 1/04/13
    7070    */
    71     function register_fields()
    72     {
    73         include_once('number-slider-v4.php');
     71    public function register_fields(){
     72
     73        include_once('number-slider-v4.php');
     74       
    7475    }
    7576   
    76     function include_field_types_number_slider( $version ) {
     77    public function include_field_types_number_slider( $version ) {
    7778   
    7879        include_once('number-slider-v5.php');
  • advanced-custom-fields-number-slider/trunk/number-slider-v5.php

    r2371244 r2415078  
    5151            'increment_value' => 1,
    5252            'slider_units' => "%",
     53            'slider_append' => "",
    5354            'default_value' => 0,
    5455        );
     
    111112            'name'          => 'default_value',
    112113        ));
    113 
    114114       
    115115        acf_render_field_setting( $field, array(
     
    133133            'name'          => 'increment_value',
    134134        ));
     135
     136        acf_render_field_setting( $field, array(
     137            'label'         => __('Append','acf-number_slider'),
     138            'instructions'  => __('Appears after the input','acf-number_slider'),
     139            'type'          => 'text',
     140            'name'          => 'slider_append',
     141        ));
    135142       
    136143
     
    155162   
    156163    function render_field( $field ) {
    157        
    158        
    159         // create a random ID ##
    160164           
    161165        $default = ( intval($field['default_value'] ) < intval($field['slider_min_value'] ) ) ? intval($field['default_value']) : intval($field['slider_min_value']);
     
    166170        <input type="text" value="<?php echo $value; ?>" name="<?php echo $field['name'] ?> " class="simple_slider" title="<?php echo $field['label'] ?>" data-slider="true" data-slider-highlight="true" data-slider-range="<?php echo $field['slider_min_value'] ?>,<?php echo $field['slider_max_value']; ?>" data-slider-step="<?php echo $field['increment_value']; ?>" data-slider-snap="true" data-units="<?php echo $field['slider_units']; ?>"/>
    167171       
    168         <p class="description slide"><?php echo $value; ?><?php echo $field['slider_units']; ?></p>
     172        <p class="description slide"><?php echo $value; ?> <?php echo $field['slider_units']; ?></p>
    169173   
    170174<?php
     
    191195    function input_admin_enqueue_scripts() {
    192196       
     197        // get plugin directory ##
    193198        $dir = plugin_dir_url( __FILE__ );
    194199       
    195         /*
    196    
    197         // register & include JS
    198         wp_register_script( 'acf-input-number_slider', "{$dir}js/input.js" );
    199         wp_enqueue_script('acf-input-number_slider');
    200        
    201        
    202         // register & include CSS
    203         wp_register_style( 'acf-input-number_slider', "{$dir}css/input.css" );
    204         wp_enqueue_style('acf-input-number_slider');
    205         */
    206        
    207        
    208       // add JS ##
     200        // add ACF JS ##
    209201        wp_enqueue_script( 'ss-input', $dir . 'js/input.js', array( 'jquery' ), $this->version, false );
    210202       
    211 
     203        // add simple slider ##
    212204        wp_enqueue_script( 'jquery-simple-slider', $dir . 'js/simple-slider.js', array( 'jquery' ), $this->version, false );
    213205
     
    217209       
    218210    }
    219    
    220    
    221    
    222     /*
    223     *  input_admin_head()
    224     *
    225     *  This action is called in the admin_head action on the edit screen where your field is created.
    226     *  Use this action to add CSS and JavaScript to assist your render_field() action.
    227     *
    228     *  @type    action (admin_head)
    229     *  @since   3.6
    230     *  @date    23/01/13
    231     *
    232     *  @param   n/a
    233     *  @return  n/a
    234     */
    235 
    236     /*
    237        
    238     function input_admin_head() {
    239    
    240        
    241        
    242     }
    243    
    244     */
    245    
    246    
    247     /*
    248     *  input_form_data()
    249     *
    250     *  This function is called once on the 'input' page between the head and footer
    251     *  There are 2 situations where ACF did not load during the 'acf/input_admin_enqueue_scripts' and
    252     *  'acf/input_admin_head' actions because ACF did not know it was going to be used. These situations are
    253     *  seen on comments / user edit forms on the front end. This function will always be called, and includes
    254     *  $args that related to the current screen such as $args['post_id']
    255     *
    256     *  @type    function
    257     *  @date    6/03/2014
    258     *  @since   5.0.0
    259     *
    260     *  @param   $args (array)
    261     *  @return  n/a
    262     */
    263    
    264     /*
    265    
    266     function input_form_data( $args ) {
    267        
    268        
    269    
    270     }
    271    
    272     */
    273    
    274    
    275     /*
    276     *  input_admin_footer()
    277     *
    278     *  This action is called in the admin_footer action on the edit screen where your field is created.
    279     *  Use this action to add CSS and JavaScript to assist your render_field() action.
    280     *
    281     *  @type    action (admin_footer)
    282     *  @since   3.6
    283     *  @date    23/01/13
    284     *
    285     *  @param   n/a
    286     *  @return  n/a
    287     */
    288 
    289     /*
    290        
    291     function input_admin_footer() {
    292    
    293        
    294        
    295     }
    296    
    297     */
    298    
    299    
    300     /*
    301     *  field_group_admin_enqueue_scripts()
    302     *
    303     *  This action is called in the admin_enqueue_scripts action on the edit screen where your field is edited.
    304     *  Use this action to add CSS + JavaScript to assist your render_field_options() action.
    305     *
    306     *  @type    action (admin_enqueue_scripts)
    307     *  @since   3.6
    308     *  @date    23/01/13
    309     *
    310     *  @param   n/a
    311     *  @return  n/a
    312     */
    313 
    314     /*
    315    
    316     function field_group_admin_enqueue_scripts() {
    317        
    318     }
    319    
    320     */
    321 
    322    
    323     /*
    324     *  field_group_admin_head()
    325     *
    326     *  This action is called in the admin_head action on the edit screen where your field is edited.
    327     *  Use this action to add CSS and JavaScript to assist your render_field_options() action.
    328     *
    329     *  @type    action (admin_head)
    330     *  @since   3.6
    331     *  @date    23/01/13
    332     *
    333     *  @param   n/a
    334     *  @return  n/a
    335     */
    336     /*
    337    
    338     function field_group_admin_head() {
    339    
    340     }
    341    
    342     */
    343211
    344212
     
    381249    function update_value( $value, $post_id, $field ) {
    382250
    383             #logger($field['name']);
    384             #logger($value);
    385 
    386             return (int)$value;
     251        #logger($field['name']);
     252        #logger($value);
     253
     254        return (int)$value;
    387255
    388256    }
     
    408276   
    409277    function format_value( $value, $post_id, $field ) {
    410        
    411          return (int)$value;
    412     }
    413    
    414    
    415    
    416     /*
    417     *  validate_value()
    418     *
    419     *  This filter is used to perform validation on the value prior to saving.
    420     *  All values are validated regardless of the field's required setting. This allows you to validate and return
    421     *  messages to the user if the value is not correct
    422     *
    423     *  @type    filter
    424     *  @date    11/02/2014
    425     *  @since   5.0.0
    426     *
    427     *  @param   $valid (boolean) validation status based on the value and the field's required setting
    428     *  @param   $value (mixed) the $_POST value
    429     *  @param   $field (array) the field array holding all the field options
    430     *  @param   $input (string) the corresponding input name for $_POST value
    431     *  @return  $valid
    432     */
    433    
    434     /*
    435    
    436     function validate_value( $valid, $value, $field, $input ){
    437        
    438         // Basic usage
    439         if( $value < $field['custom_minimum_setting'] )
    440         {
    441             $valid = false;
    442         }
    443        
    444        
    445         // Advanced usage
    446         if( $value < $field['custom_minimum_setting'] )
    447         {
    448             $valid = __('The value is too little!','acf-number_slider'),
    449         }
    450        
    451        
    452         // return
    453         return $valid;
    454        
    455     }
    456    
    457     */
    458    
    459    
    460     /*
    461     *  delete_value()
    462     *
    463     *  This action is fired after a value has been deleted from the db.
    464     *  Please note that saving a blank value is treated as an update, not a delete
    465     *
    466     *  @type    action
    467     *  @date    6/03/2014
    468     *  @since   5.0.0
    469     *
    470     *  @param   $post_id (mixed) the $post_id from which the value was deleted
    471     *  @param   $key (string) the $meta_key which the value was deleted
    472     *  @return  n/a
    473     */
    474    
    475     /*
    476    
    477     function delete_value( $post_id, $key ) {
    478        
    479        
    480        
    481     }
    482    
    483     */
     278
     279        // \willow\core\helper::log( $field );
     280
     281        // check if we need to append a value ##
     282        $append = isset( $field['slider_append'] ) ? $field['slider_append'] : '';
     283       
     284        // kick back value, with append - if set ##
     285        return ( (int)$value ).' '.$append;
     286
     287    }
     288   
    484289   
    485290   
     
    497302    */
    498303   
    499     /*
    500    
    501304    function load_field( $field ) {
    502        
     305
    503306        return $field;
    504307       
    505308    }   
    506    
    507     */
    508    
    509    
    510     /*
    511     *  update_field()
    512     *
    513     *  This filter is applied to the $field before it is saved to the database
    514     *
    515     *  @type    filter
    516     *  @date    23/01/2013
    517     *  @since   3.6.0
    518     *
    519     *  @param   $field (array) the field array holding all the field options
    520     *  @return  $field
    521     */
    522    
    523     /*
    524    
    525     function update_field( $field ) {
    526        
    527         return $field;
    528        
    529     }   
    530    
    531     */
    532    
    533    
    534     /*
    535     *  delete_field()
    536     *
    537     *  This action is fired after a field is deleted from the database
    538     *
    539     *  @type    action
    540     *  @date    11/02/2014
    541     *  @since   5.0.0
    542     *
    543     *  @param   $field (array) the field array holding all the field options
    544     *  @return  n/a
    545     */
    546    
    547     /*
    548    
    549     function delete_field( $field ) {
    550        
    551        
    552        
    553     }   
    554    
    555     */
    556309   
    557310   
  • advanced-custom-fields-number-slider/trunk/readme.md

    r2371244 r2415078  
    1 # Advanced Custom Fields: Number Slider #
     1# Advanced Custom Fields: Number Slider # 
    22**Contributors:** qlstudio 
    3 **Tags:** acf, advanced custom field, number, slider, slide, select, integer 
    4 **Requires at least:** 4.0.0 
    5 **Tested up to:** 5.5.0
    6 **Stable tag:** 0.5.6
     3**Tags:** acf, advanced custom field, number, slider, slide, select, integer   
     4**Requires at least:** 4.0.0   
     5**Tested up to:** 5.5.
     6**Stable tag:** 0.5.
    77**License:** GPLv2 or later 
    88**License URI:** http://www.gnu.org/licenses/gpl-2.0.html 
     
    6464## Changelog ##
    6565
     66### 0.5.7 ###
     67
     68* Added append value to return string
     69
    6670### 0.5.6 ###
    6771
  • advanced-custom-fields-number-slider/trunk/readme.txt

    r2371244 r2415078  
    11=== Advanced Custom Fields: Number Slider ===
    2 Contributors: qlstudio
    3 Tags: acf, advanced custom field, number, slider, slide, select, integer
    4 Requires at least: 4.0.0
    5 Tested up to: 5.5.0
    6 Stable tag: 0.5.6
    7 License: GPLv3 or later
     2Contributors: qlstudio 
     3Tags: acf, advanced custom field, number, slider, slide, select, integer 
     4Requires at least: 4.0.0 
     5Tested up to: 5.5.
     6Stable tag: 0.5.
     7License: GPLv3 or later 
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
    99
     
    6161== Changelog ==
    6262
     63= 0.5.7 =
     64
     65* Added append value to return string
     66
    6367= 0.5.6 =
    6468
Note: See TracChangeset for help on using the changeset viewer.