Changeset 1549687
- Timestamp:
- 12/08/2016 07:03:41 PM (9 years ago)
- Location:
- optune/trunk
- Files:
-
- 3 edited
-
README.txt (modified) (1 diff)
-
index.php (modified) (1 diff)
-
optune.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
optune/trunk/README.txt
r1542275 r1549687 40 40 == Changelog == 41 41 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 42 47 = 1.0 = 43 48 First release -
optune/trunk/index.php
r1542285 r1549687 4 4 * Plugin URI: https://github.com/optune/wordpress-gig-calendar 5 5 * Description: This plugin adds Optune.me gigs to your website 6 * Version: 1. 06 * Version: 1.1 7 7 * Author: Sergei Pestin 8 8 * Author URI: https://www.upwork.com/fl/sergeypestin -
optune/trunk/optune.php
r1542275 r1549687 70 70 'gig_setting_section_id' 71 71 ); 72 73 // Default post type74 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 );81 72 } 82 73 … … 84 75 public function optune_sanitize( $input ) 85 76 { 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 86 87 $new_input = array(); 87 88 if( isset( $input['gig_username'] ) ) … … 90 91 if( isset( $input['gig_post_status'] ) ) 91 92 $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'] );95 93 96 94 return $new_input; … … 114 112 </select>'; 115 113 } 116 117 // Print post type field118 public function optune_gig_post_type(){119 echo120 '<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 126 114 } 127 115 … … 181 169 ( 182 170 'post_title' => wp_strip_all_tags( $gig['title'] ), 183 'post_type' => $this->options['gig_post_type'],171 'post_type' => 'post', 184 172 'post_content' => self::SPEC, 185 173 'post_author' => get_current_user_id(), … … 244 232 // Display HTML formatted info about available Gigs 245 233 public function displayGigs( $gigs ){ 234 asort( $gigs ); 246 235 foreach( $gigs as $gig ){ 247 236 $venue = get_post_meta( $gig->ID, 'venue', TRUE );
Note: See TracChangeset
for help on using the changeset viewer.