Plugin Directory

Changeset 1549687


Ignore:
Timestamp:
12/08/2016 07:03:41 PM (9 years ago)
Author:
optune
Message:

New release 1.1

Location:
optune/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • optune/trunk/README.txt

    r1542275 r1549687  
    4040== Changelog ==
    4141
     42= 1.1 =
     43- Sort Gigs by Date
     44- Set default post type to "post"(no more select box for post type)
     45- Auto update Gigs if settings in admin panel is changed
     46
    4247= 1.0 =
    4348First release
  • optune/trunk/index.php

    r1542285 r1549687  
    44 * Plugin URI: https://github.com/optune/wordpress-gig-calendar
    55 * Description: This plugin adds Optune.me gigs to your website
    6  * Version: 1.0
     6 * Version: 1.1
    77 * Author: Sergei Pestin
    88 * Author URI: https://www.upwork.com/fl/sergeypestin
  • optune/trunk/optune.php

    r1542275 r1549687  
    7070            'gig_setting_section_id'
    7171        );     
    72          
    73           // Default post type
    74         add_settings_field(
    75             'optune_gig_post_type',
    76             'Default Post Type',
    77             array( $this, 'optune_gig_post_type' ),
    78             'gig-settings-admin',
    79             'gig_setting_section_id'
    80         );     
    8172    }
    8273
     
    8475    public function optune_sanitize( $input )
    8576    {
     77        $this->options = get_option( 'gig_option_name' );
     78          if( $input['gig_username'] != $this->options['gig_username'] || $input['gig_post_status'] != $this->options['gig_post_status'] )
     79              {
     80                    if ( get_option( 'gig_last_update' ) !== false ) {
     81                        update_option( 'gig_last_update', $date );
     82                    } else {
     83                        add_option( 'gig_last_update', $date, '', 'yes' );
     84                    }
     85              }
     86
    8687        $new_input = array();
    8788        if( isset( $input['gig_username'] ) )
     
    9091        if( isset( $input['gig_post_status'] ) )
    9192            $new_input['gig_post_status'] = sanitize_text_field( $input['gig_post_status'] );
    92 
    93         if( isset( $input['gig_post_type'] ) )
    94             $new_input['gig_post_type'] = sanitize_text_field( $input['gig_post_type'] );
    9593
    9694        return $new_input;
     
    114112                </select>';
    115113    }
    116 
    117     // Print post type field
    118     public function optune_gig_post_type(){
    119         echo
    120                 '<select type="option" id="gig_post_type" name="gig_option_name[gig_post_type]">
    121                     <option ', ( $this->options['gig_post_type'] == 'post' ? 'selected' : '' ), ' value="post">post</option>
    122                     <option ', ( $this->options['gig_post_type'] == 'gig' ? 'selected' : '' ), ' value="gig">gig</option>
    123                 </select>';
    124     }
    125 
    126114}
    127115
     
    181169                (
    182170                    'post_title'        => wp_strip_all_tags( $gig['title'] ),
    183                     'post_type'         => $this->options['gig_post_type'],
     171                    'post_type'         => 'post',
    184172                    'post_content'      => self::SPEC,
    185173                    'post_author'       => get_current_user_id(),
     
    244232    // Display HTML formatted info about available Gigs
    245233    public function displayGigs( $gigs ){
     234        asort( $gigs );
    246235        foreach( $gigs as $gig ){
    247236            $venue = get_post_meta( $gig->ID, 'venue', TRUE );
Note: See TracChangeset for help on using the changeset viewer.