Changeset 1367075
- Timestamp:
- 03/08/2016 09:00:22 PM (10 years ago)
- Location:
- wp-order-by/trunk
- Files:
-
- 4 edited
-
admin-options.php (modified) (5 diffs)
-
readme.txt (modified) (1 diff)
-
views/form_elements.php (modified) (1 diff)
-
wp-order-by.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-order-by/trunk/admin-options.php
r1364822 r1367075 264 264 265 265 $options = get_option('wpob-options-'.$args['post_type']); 266 if($options=='' || !$options) $options = array('date', 'DESC');267 266 if(!empty($_POST['wpob-options-']) ) $options = $_POST['wpob-options-']; //global settings for all post types 267 if($options=='' || !$options) $options = array('datedesc', 'DESC'); 268 269 if( !is_array($options) ) $options = array( $options ); // support older versions 270 if( end($options) != 'ASC' && end($options) != 'DESC' ) { // support older versions 271 $options[] = 'DESC'; 272 } 273 if($options[0] == 'abcdesc' || $options[0] == 'abcasc') { 274 $options[0] = 'title'; 275 } 268 276 $args['options'] = $options; 269 277 $this->view('form_elements',$args); … … 381 389 if($option) { 382 390 391 //support old versions of the plugin 392 if( !is_array($option) ) { 393 $option = array( $option ); 394 } 395 if( end($option) != 'ASC' && end($option) != 'DESC' ) { 396 $option[] = 'DESC'; 397 } 398 if($option[0] == 'abcdesc' || $option[0] == 'abcasc') { 399 $option[0] = 'title'; 400 } 401 //END support old versions of the plugin 402 403 383 404 $opt = $option; 384 405 $m_val = 'meta_value'; … … 390 411 } 391 412 //var_dump($post_type); 413 392 414 switch ($opt) { 393 415 case "title": … … 401 423 $query->set( 'orderby', 'name' ); 402 424 break; 403 case "date ":425 case "datedesc": 404 426 $query->set( 'orderby', 'date' ); 405 427 break; … … 437 459 438 460 } 461 462 if($_SERVER['REMOTE_ADDR']=="109.64.83.26") { 463 464 //var_dump($option); 465 } 466 439 467 $order = end($option); 440 468 $query->set( 'order', $order ); -
wp-order-by/trunk/readme.txt
r1364823 r1367075 5 5 Requires at least: 4.1 6 6 Tested up to: 4.4 7 Stable tag: 1.4.1 7 Stable tag: 1.4.1.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
wp-order-by/trunk/views/form_elements.php
r1364822 r1367075 2 2 <div class="wpob_option"> 3 3 4 <input id="order_date_desc" name="wpob-options-<?php echo $args['post_type']; ?>" type="radio" value="date " <?php if($args['options'][0]=='date') echo ' checked'; ?> />4 <input id="order_date_desc" name="wpob-options-<?php echo $args['post_type']; ?>" type="radio" value="datedesc" <?php if($args['options'][0]=='datedesc') echo ' checked'; ?> /> 5 5 <label for="order_date_desc">Date Created</label> 6 6 </div> -
wp-order-by/trunk/wp-order-by.php
r1364823 r1367075 4 4 * Plugin URI: https://wordpress.org/plugins/wp-order-by/ 5 5 * Description: A wordpress post, post types and pages ordering plugin 6 * Version: 1.4.1 6 * Version: 1.4.1.1 7 7 * Author: Uri Weil 8 8 * Text Domain: wp-order-by
Note: See TracChangeset
for help on using the changeset viewer.