Changeset 830637
- Timestamp:
- 12/31/2013 05:18:58 AM (12 years ago)
- File:
-
- 1 edited
-
dishsoap/trunk/dishsoap.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dishsoap/trunk/dishsoap.php
r648851 r830637 5 5 Plugin URI: http://withan.es/dishsoap 6 6 Description: Cleanup those old posts with DishSoap. DishSoap is an post unpublishing plugin for those that want to automatically unpublish or unsticky a post on a specified date and time. 7 Version: 1. 07 Version: 1.1 8 8 Author: Mark Thomes (with an Es) 9 9 Author URI: http://withan.es/dishsoap … … 20 20 $dishsoap_debug = false; 21 21 22 // CHOOSE to display DISHSOAP COLORS 23 $dishsoap_color = false; 22 // TARGET different Post Type 23 $ds_post_type = "post"; // LEAVE blank "" if you want it to apply to all post_types 24 // WARNING -- Changing this after expirations have 25 // already been set for a post will that 26 // expiraton will no longer be editable. 24 27 25 28 … … 85 88 function dishsoap_add_meta_boxes() { 86 89 87 // STYLE the dishsoap meta_box 88 global $dishsoap_color; 89 $dishsoap_id = 'dishsoap-meta'; 90 if(!$dishsoap_color) { 91 $dishsoap_id = 'dishsoap-meta-style'; 92 } 90 global $ds_post_type; 93 91 94 92 add_meta_box( 95 "$dishsoap_id",96 esc_html__( 'Dishsoap', ' example' ),97 'dishsoap_meta_ meta_box',98 'post',93 'dishsoap-meta', 94 esc_html__( 'Dishsoap', 'dishsoap' ), 95 'dishsoap_meta_box', 96 "$ds_post_type", 99 97 'side', 100 98 'default' … … 133 131 //////////////////////////// 134 132 135 function dishsoap_meta_ meta_box( $object, $box ) {133 function dishsoap_meta_box( $object, $box ) { 136 134 137 135 // SET timezone … … 143 141 144 142 // SESSION START (used to display errors and maintain form) 145 session_start();143 @session_start(); 146 144 147 145 wp_nonce_field( basename( __FILE__ ), 'dishsoap_meta_nonce' ); ?> 148 146 149 147 <p> 150 <label for="dishsoap-meta" class="ds_calendar">Unpublush post on specified date and time</label>148 Unpublish post on... 151 149 152 150 <?php … … 259 257 > 260 258 <br> 261 <label for="ds_option" >Option:259 <label for="ds_option" id="ds_option_select">Option: 262 260 <select id="ds_option" name="dishsoap-meta-option" tabindex="4"> 263 261 <?php … … 301 299 <?php } ?> 302 300 </p> 303 <?php } // <-- END dishsoap_meta_ meta_box301 <?php } // <-- END dishsoap_meta_box 304 302 305 303 … … 317 315 318 316 // Start SESSION for validation ERRORS 319 session_start();317 @session_start(); 320 318 321 319 // CHECK origin of post data … … 423 421 424 422 // QUERY wp_postmeta 425 $query = "SELECT * FROM wp_postmeta WHERE (meta_key='dishsoap_meta' AND SUBSTRING_INDEX(meta_value,':',1) <= $tnow AND SUBSTRING(meta_value,-1) = 0) OR (meta_key='dishsoap_meta' AND SUBSTRING_INDEX(meta_value,':',1) <= $tnow AND SUBSTRING(meta_value,-1) = 2)";423 $query = "SELECT * FROM $wpdb->postmeta WHERE (meta_key='dishsoap_meta' AND SUBSTRING_INDEX(meta_value,':',1) <= $tnow AND SUBSTRING(meta_value,-1) = 0) OR (meta_key='dishsoap_meta' AND SUBSTRING_INDEX(meta_value,':',1) <= $tnow AND SUBSTRING(meta_value,-1) = 2)"; 426 424 427 425 // LOOP through results
Note: See TracChangeset
for help on using the changeset viewer.