WordPress.org

Plugin Directory


Ignore:
Timestamp:
07/18/17 15:11:12 (3 months ago)
Author:
bastho
Message:

Bulk edit: show markers in selector

File:
1 edited

Legend:

Unmodified
Added
Removed
  • event-post/trunk/eventpost.php

    r1698200 r1698242  
    9595        add_action( 'wp_ajax_inline-save', array(&$this, 'inline_save'), 1 ); 
    9696    add_action( 'wp_ajax_eventpost_save_bulk', array(&$this, 'save_bulkdatas') ); 
    97         add_filter( 'eventpost_inline_field', array(&$this, 'inline_field_color'), 10, 2); 
     97        add_filter( 'eventpost_inline_field', array(&$this, 'inline_field_color'), 10, 3); 
    9898 
    9999        $inc_path = plugin_dir_path(__FILE__).'inc/'; 
     
    16241624                        <span class="title"><?php echo $fieldlabel; ?></span> 
    16251625                        <span class="input-text-wrap"> 
    1626                             <?php echo $this->inline_field($fieldname); ?> 
     1626                            <?php echo $this->inline_field($fieldname, $bulk); ?> 
    16271627                        </span> 
    16281628                    </label> 
     
    16401640     * @return type 
    16411641     */ 
    1642     function inline_field($fieldname){ 
    1643         return apply_filters('eventpost_inline_field', '<input name="'.$fieldname.'" class="eventpost-inline-'.$fieldname.'" value="" type="text">', $fieldname); 
    1644     } 
    1645  
    1646     function inline_field_color($html, $fieldname){ 
     1642    function inline_field($fieldname, $bulk){ 
     1643        return apply_filters('eventpost_inline_field', '<input name="'.$fieldname.'" class="eventpost-inline-'.$fieldname.'" value="" type="text">', $fieldname, $bulk); 
     1644    } 
     1645 
     1646    function inline_field_color($html, $fieldname, $bulk){ 
    16471647        if($fieldname==$this->META_COLOR){ 
    16481648            $colors = $this->get_colors(); 
    1649             $html = '<select name="'.$fieldname.'" class="eventpost-inline-colorpicker eventpost-inline-'.$fieldname.'" >'; 
     1649            $html=''; 
     1650            if($bulk){ 
     1651                $html.= '<span class="eventpost-bulk-colorpicker-button link">'.__('No Change', 'event-post').'</span>'; 
     1652            } 
     1653            $html .= '<select name="'.$fieldname.'" class="eventpost-inline-colorpicker eventpost-inline-'.$fieldname.' '.($bulk?'is-bulk':'no-bulk').'" >'; 
     1654            if($bulk){ 
     1655                $html.='<option value="false">— '.__('No Change', 'event-post').' —</option>'; 
     1656            } 
    16501657            foreach ($colors as $color=>$image_path){ 
    16511658                $html.='<option value="'.$color.'" data-path="'.$image_path.'">'.$color.'</option>'; 
     
    17281735                foreach ($this->bulk_edit_fields as $sets) { 
    17291736                    foreach ($sets as $fieldname => $fieldlabel) { 
    1730                         if ((false !== $value = filter_input(INPUT_POST, $fieldname))) { 
     1737                        if ((false != $value = filter_input(INPUT_POST, $fieldname))) { 
    17311738                            foreach ($post_ids as $post_id) { 
    17321739                                update_post_meta($post_id, $fieldname, $value); 
Note: See TracChangeset for help on using the changeset viewer.