Changeset 3303640
- Timestamp:
- 05/30/2025 02:31:33 PM (8 months ago)
- Location:
- post-types-order
- Files:
-
- 37 added
- 9 edited
-
assets/banner-1544x500.png (modified) (previous)
-
assets/banner-772x250.png (modified) (previous)
-
tags/2.3.7 (added)
-
tags/2.3.7/compatibility (added)
-
tags/2.3.7/compatibility/LiteSpeed_Cache.php (added)
-
tags/2.3.7/compatibility/formidable.php (added)
-
tags/2.3.7/compatibility/the-events-calendar.php (added)
-
tags/2.3.7/compatibility/themes (added)
-
tags/2.3.7/compatibility/themes/enfold.php (added)
-
tags/2.3.7/composer.json (added)
-
tags/2.3.7/composer.phar (added)
-
tags/2.3.7/css (added)
-
tags/2.3.7/css/cpt-archive-dd.css (added)
-
tags/2.3.7/css/cpt-options.css (added)
-
tags/2.3.7/css/cpt.css (added)
-
tags/2.3.7/images (added)
-
tags/2.3.7/images/gray-grad.png (added)
-
tags/2.3.7/images/logo.png (added)
-
tags/2.3.7/images/menu-icon.png (added)
-
tags/2.3.7/images/wpspin_light.gif (added)
-
tags/2.3.7/include (added)
-
tags/2.3.7/include/class.compatibility.php (added)
-
tags/2.3.7/include/class.cpto.php (added)
-
tags/2.3.7/include/class.functions.php (added)
-
tags/2.3.7/include/class.interface.php (added)
-
tags/2.3.7/include/class.options.php (added)
-
tags/2.3.7/include/class.walkers.php (added)
-
tags/2.3.7/js (added)
-
tags/2.3.7/js/cpt.js (added)
-
tags/2.3.7/languages (added)
-
tags/2.3.7/languages/post-types-order.mo (added)
-
tags/2.3.7/languages/post-types-order.po (added)
-
tags/2.3.7/post-types-order.php (added)
-
tags/2.3.7/readme.txt (added)
-
tags/2.3.7/screenshot-1.png (added)
-
tags/2.3.7/screenshot-2.png (added)
-
trunk/css/cpt.css (modified) (1 diff)
-
trunk/images/gray-grad.png (added)
-
trunk/images/wpspin_light.gif (added)
-
trunk/include/class.cpto.php (modified) (7 diffs)
-
trunk/include/class.functions.php (modified) (1 diff)
-
trunk/include/class.interface.php (added)
-
trunk/include/class.walkers.php (modified) (1 diff)
-
trunk/post-types-order.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/screenshot-1.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
post-types-order/trunk/css/cpt.css
r3164418 r3303640 1 #order-post-type tbody tr { cursor: move;}2 #order-post-type td {min-height: 25px; display: block;}3 #order-post-type tr.placeholder td {border: dashed 2px #ccc;height:3px; display: block; background-color: #FFF; min-height: 21px;}4 #order-post-type tr.ui-sortable-helper td { background-color: #FFF; }5 6 1 #cpto h2.subtitle {font-size: 15px; font-style: italic; font-weight: bold; padding-left: 0px} 7 2 .wrap .example { color: #666666; font-size: 11px; font-weight: bold} 3 4 #order-objects img {vertical-align: middle} 5 #order-objects #sortable { list-style-type: none; margin: 10px 0 0; padding: 0; width: 100%; } 6 #order-objects ul {list-style: none;} 7 #order-objects ul.children {margin-left: 25px} 8 9 #order-objects #sortable li:not(.ui-sortable-placeholder) { border: 1px solid #E6E6E6;height: auto;line-height: 27px; padding-left: 10px;position: relative; text-shadow: 0 1px 0 #FFFFFF;width: auto;word-wrap: break-word;cursor: move;background: url("../images/gray-grad.png") repeat-x scroll left top #DFDFDF;-webkit-border-radius: 4px;-moz-border-radius: 4px;border-radius: 4px;} 10 #order-objects #sortable li span { display: inline-block; line-height: 20px; padding: 5px 0; white-space: nowrap; font-weight: bold; cursor: pointer;} 11 #order-objects #sortable li .options {float: right; padding: 0 10px 0 10px; } 12 #order-objects #sortable li .options a {text-decoration: none; color: #3c434a;} 13 #order-objects #sortable li .options a:hover {color: #2271b1;} 14 #order-objects #sortable li .options span {font-weight: normal} 15 #order-objects .term_type_li ul {margin-top: 6px} 16 17 #order-objects #nav-menu-header {background: url("../images/gray-grad.png") repeat-x scroll left top #DFDFDF; -moz-border-radius-topleft: 6px; -moz-border-radius-topright: 6px;border-width: 1px 1px 0;border-color: #CCCCCC;border-style: solid; margin-bottom: 0px} 18 #order-objects #nav-menu-header .major-publishing-actions {clear: both;padding: 5px 0px;} 19 #order-objects #nav-menu-header .actions, #order-objects #nav-menu-footer .actions {padding: 0px; margin: 2px 0px; position: relative} 20 #order-objects #nav-menu-header .img_spacer {width: 18px; height: 18px;} 21 #order-objects #nav-menu-footer {background: url("../images/gray-grad.png") repeat-x scroll left top #DFDFDF; -moz-border-radius-bottomleft: 6px; -moz-border-radius-bottomright: 6px;border-width: 0 1px 1px 1px;border-color: #CCCCCC;border-style: solid;} 22 #order-objects #nav-menu-footer .major-publishing-actions {clear: both;padding: 5px 0px;} 23 #order-objects #nav-menu-footer .submit {padding: 0px;} 24 25 #order-objects .ui-sortable-placeholder{border-color:#bbb;background-color:#FCFCFC; height:32px; background-image: none; -moz-border-radius: 6px 6px 6px 6px; border: 3px dashed #E6E6E6; -webkit-border-radius: 4px;-moz-border-radius: 4px;border-radius: 4px; box-sizing: border-box;} 26 #order-objects .ui-sortable-helper{filter:alpha(opacity=75); /* for internet explorer */opacity: 0.75; /* CSS3 standard */-moz-opacity:0.75; /* for older gecko browsers */-khtml-opacity: 0.75; /* for older webkit browsers */} 27 28 #order-objects #post-body {background: none repeat scroll 0 0 #FFFFFF;border-width: 0 1px 0 1px;border-color: #CCCCCC;border-style: solid; padding: 10px;} 29 8 30 9 31 -
post-types-order/trunk/include/class.cpto.php
r3165840 r3303640 20 20 $is_configured = get_option('CPT_configured'); 21 21 if ($is_configured == '') 22 add_action( 'admin_notices', array ($this, 'admin_configure_notices'));23 24 25 add_filter('init', array ($this, 'on_init'));26 add_filter('init', array ($this, 'compatibility'));27 28 29 add_filter('pre_get_posts', array ($this, 'pre_get_posts'));30 add_filter('posts_orderby', array ($this, 'posts_orderby'), 99, 2);22 add_action( 'admin_notices', array ( $this, 'admin_configure_notices')); 23 24 25 add_filter('init', array ( $this, 'on_init')); 26 add_filter('init', array ( $this, 'compatibility')); 27 28 29 add_filter('pre_get_posts', array ( $this, 'pre_get_posts')); 30 add_filter('posts_orderby', array ( $this, 'posts_orderby'), 99, 2); 31 31 } 32 32 … … 39 39 { 40 40 41 include_once(CPTPATH . '/include/class.walkers.php'); 42 43 //add_action( 'admin_init', array(&$this, 'registerFiles'), 11 ); 44 add_action( 'admin_init', array(&$this, 'admin_init'), 10 ); 45 add_action( 'admin_menu', array(&$this, 'add_menu') ); 46 47 add_action('admin_menu', array(&$this, 'plugin_options_menu')); 41 add_action( 'admin_init', array ( $this, 'admin_init'), 10 ); 42 add_action( 'admin_menu', array ( $this, 'add_menu') ); 43 44 add_action( 'admin_menu', array ( $this, 'plugin_options_menu')); 48 45 49 46 //load archive drag&drop sorting dependencies 50 add_action( 'admin_enqueue_scripts', array(&$this, 'archiveDragDrop'), 10 ); 51 52 add_action( 'wp_ajax_update-custom-type-order', array(&$this, 'saveAjaxOrder') ); 53 add_action( 'wp_ajax_update-custom-type-order-archive', array(&$this, 'saveArchiveAjaxOrder') ); 54 47 add_action( 'admin_enqueue_scripts', array ( $this, 'archiveDragDrop'), 10 ); 48 49 add_action( 'wp_ajax_update-custom-type-order', array ( $this, 'saveAjaxOrder') ); 50 add_action( 'wp_ajax_update-custom-type-order-archive', array ( $this, 'saveArchiveAjaxOrder') ); 55 51 56 52 } … … 81 77 return; 82 78 83 add_filter('get_previous_post_where', array ($this->functions, 'cpto_get_previous_post_where'), 99, 3);84 add_filter('get_previous_post_sort', array ($this->functions, 'cpto_get_previous_post_sort') );85 add_filter('get_next_post_where', array ($this->functions, 'cpto_get_next_post_where'), 99, 3);86 add_filter('get_next_post_sort', array ($this->functions, 'cpto_get_next_post_sort') );79 add_filter('get_previous_post_where', array ( $this->functions, 'cpto_get_previous_post_where'), 99, 3); 80 add_filter('get_previous_post_sort', array ( $this->functions, 'cpto_get_previous_post_sort') ); 81 add_filter('get_next_post_where', array ( $this->functions, 'cpto_get_next_post_where'), 99, 3); 82 add_filter('get_next_post_sort', array ( $this->functions, 'cpto_get_next_post_sort') ); 87 83 88 84 } … … 516 512 function add_menu() 517 513 { 514 515 include_once ( CPTPATH . '/include/class.interface.php' ); 516 include_once ( CPTPATH . '/include/class.walkers.php' ); 517 518 518 global $userdata; 519 519 //put a menu for all custom_type … … 536 536 } 537 537 538 $PTO_Interface = new PTO_Interface(); 539 538 540 foreach( $post_types as $post_type_name ) 539 541 { … … 558 560 559 561 if ( $post_type_name == 'post' ) 560 $hookID = add_submenu_page('edit.php', __('Re-Order', 'post-types-order'), __('Re-Order', 'post-types-order'), $required_capability, 'order-post-types-'.$post_type_name, array( &$this, 'sort_page') );562 $hookID = add_submenu_page('edit.php', __('Re-Order', 'post-types-order'), __('Re-Order', 'post-types-order'), $required_capability, 'order-post-types-'.$post_type_name, array( $PTO_Interface, 'sort_page') ); 561 563 elseif ($post_type_name == 'attachment') 562 $hookID = add_submenu_page('upload.php', __('Re-Order', 'post-types-order'), __('Re-Order', 'post-types-order'), $required_capability, 'order-post-types-'.$post_type_name, array( &$this, 'sort_page') );564 $hookID = add_submenu_page('upload.php', __('Re-Order', 'post-types-order'), __('Re-Order', 'post-types-order'), $required_capability, 'order-post-types-'.$post_type_name, array( $PTO_Interface, 'sort_page') ); 563 565 else 564 566 { 565 $hookID = add_submenu_page('edit.php?post_type='.$post_type_name, __('Re-Order', 'post-types-order'), __('Re-Order', 'post-types-order'), $required_capability, 'order-post-types-'.$post_type_name, array( &$this, 'sort_page') );567 $hookID = add_submenu_page('edit.php?post_type='.$post_type_name, __('Re-Order', 'post-types-order'), __('Re-Order', 'post-types-order'), $required_capability, 'order-post-types-'.$post_type_name, array( $PTO_Interface, 'sort_page') ); 566 568 } 567 569 … … 588 590 } 589 591 590 591 /** 592 * Sort interfaces 593 * 594 */ 595 function sort_page() 596 { 597 598 $options = $this->functions->get_options(); 599 600 ?> 601 <div id="cpto" class="wrap"> 602 <div class="icon32" id="icon-edit"><br></div> 603 <h2><?php echo esc_html( $this->current_post_type->labels->singular_name . ' - '. esc_html__('Re-Order', 'post-types-order') ); ?></h2> 604 605 <?php $this->functions->cpt_info_box(); ?> 606 607 <div id="ajax-response"></div> 608 609 <noscript> 610 <div class="error message"> 611 <p><?php esc_html_e('This plugin can\'t work without javascript, because it\'s use drag and drop and AJAX.', 'post-types-order'); ?></p> 612 </div> 613 </noscript> 614 615 <p> </p> 616 617 618 <table id="order-post-type" class="wp-list-table widefat fixed striped table-view-list<?php if ( $options['edit_view_links'] === 1 ) { echo ' extended-view'; } ?>"> 619 <thead> 620 <tr> 621 <th scope="col" id="title" class="manage-column column-title column-primary sortable" abbr="Title"><a><span>Title</span></a></th> 622 623 </tr> 624 <?php do_action('pto/interface/table/thead', $this->current_post_type->name ) ?> 625 </thead> 626 627 <tbody id="sortable" class="ui-sortable"> 628 629 <?php $this->list_pages('hide_empty=0&title_li=&post_type=' . $this->current_post_type->name ); ?> 630 631 632 </tbody> 633 634 <tfoot> 635 <tr> 636 <th scope="col" class="manage-column column-title column-primary sortable desc" abbr="Title"><a><span>Title</span></a></th> 637 </tr> 638 <?php do_action('pto/interface/table/tfoot', $this->current_post_type->name ) ?> 639 </tfoot> 640 641 </table> 642 643 644 <p class="submit"> 645 <a href="javascript: void(0)" id="save-order" class="button-primary"><?php esc_html_e('Update', 'post-types-order' ); ?></a> 646 </p> 647 648 <?php wp_nonce_field( 'interface_sort_nonce', 'interface_sort_nonce' ); ?> 649 650 <script type="text/javascript"> 651 jQuery(document).ready(function() { 652 jQuery("#sortable").sortable({ 653 'tolerance':'intersect', 654 'cursor':'pointer', 655 'items':'tr', 656 'placeholder':'placeholder', 657 'nested': 'ul' 658 }); 659 660 jQuery("#sortable").disableSelection(); 661 jQuery("#save-order").bind( "click", function() { 662 663 jQuery("html, body").animate({ scrollTop: 0 }, "fast"); 664 665 jQuery.post( ajaxurl, { action:'update-custom-type-order', order:jQuery("#sortable").sortable("serialize"), 'interface_sort_nonce' : jQuery('#interface_sort_nonce').val() }, function() { 666 jQuery("#ajax-response").html('<div class="message updated fade"><p><?php esc_html_e('Items Order Updated', 'post-types-order') ?></p></div>'); 667 jQuery("#ajax-response div").delay(3000).hide("slow"); 668 }); 669 }); 670 }); 671 </script> 672 673 674 675 676 </div> 677 <?php 678 } 679 680 681 /** 682 * List pages 683 * 684 * @param mixed $args 685 */ 686 function list_pages($args = '') 687 { 688 $defaults = array( 689 'depth' => -1, 690 'date_format' => get_option('date_format'), 691 'child_of' => 0, 692 'sort_column' => 'menu_order', 693 'post_status' => 'any' 694 ); 695 696 $r = wp_parse_args( $args, $defaults ); 697 extract( $r, EXTR_SKIP ); 698 699 $output = ''; 700 701 $r['exclude'] = implode( ',', apply_filters('wp_list_pages_excludes', array()) ); 702 703 // Query pages. 704 $r['hierarchical'] = 0; 705 $args = array( 706 'sort_column' => 'menu_order', 707 'post_type' => $post_type, 708 'posts_per_page' => -1, 709 'post_status' => 'any', 710 'orderby' => array( 711 'menu_order' => 'ASC', 712 'post_date' => 'DESC' 713 ) 714 ); 715 716 //allow customisation of the query if necesarelly 717 $args = apply_filters('pto/interface/query/args', $args ); 718 719 $the_query = new WP_Query( $args ); 720 $pages = $the_query->posts; 721 722 if ( !empty($pages) ) 723 { 724 $output .= $this->walk_tree($pages, $r['depth'], $r); 725 } 726 727 echo wp_kses_post ( $output ); 728 } 729 730 /** 731 * Tree walker 732 * 733 * @param mixed $pages 734 * @param mixed $depth 735 * @param mixed $r 736 */ 737 function walk_tree($pages, $depth, $r) 738 { 739 $walker = new Post_Types_Order_Walker; 740 741 $args = array($pages, $depth, $r); 742 return call_user_func_array(array(&$walker, 'walk'), $args); 743 } 592 744 593 } -
post-types-order/trunk/include/class.functions.php
r3188404 r3303640 71 71 <h4><a href="https://www.nsp-code.com/premium-plugins/advanced-post-types-order/" target="_blank"><img width="151" src="<?php echo CPTURL ?>/images/logo.png" class="attachment-large size-large wp-image-36927" alt=""></a> <?php esc_html_e('Did you know there is available an Advanced version of this plug-in?', 'post-types-order') ?> <a target="_blank" href="https://www.nsp-code.com/premium-plugins/advanced-post-types-order/"><?php _e('Read more', 'post-types-order') ?></a></h4> 72 72 <p><?php esc_html_e('Check our', 'post-types-order') ?> <a target="_blank" href="https://wordpress.org/plugins/taxonomy-terms-order/">Category Order - Taxonomy Terms Order</a> <?php esc_html_e('plugin which allow to custom sort categories and custom taxonomies terms', 'post-types-order') ?> </p> 73 <p><span style="color:#CC0000" class="dashicons dashicons-megaphone" alt="f488"> </span> <?php esc_html_e('Check ou t', 'post-types-order') ?> <a href="https://wordpress.org/plugins/wp-hide-security-enhancer/" target="_blank"><b>WP Hide & Security Enhancer</b></a> <?php esc_html_e('an extra layer of security for your site. The easy way to completely hide your WordPress core files, themes and plugins', 'post-types-order') ?>.</p>73 <p><span style="color:#CC0000" class="dashicons dashicons-megaphone" alt="f488"> </span> <?php esc_html_e('Check our', 'post-types-order') ?> <a href="https://wordpress.org/plugins/wp-hide-security-enhancer/" target="_blank"><b>WP Hide & Security Enhancer</b></a> <?php esc_html_e('an extra layer of security for your site. The easy way to completely hide your WordPress core files, themes and plugins', 'post-types-order') ?>.</p> 74 74 75 75 <div class="clear"></div> -
post-types-order/trunk/include/class.walkers.php
r3164418 r3303640 37 37 38 38 $item_details = apply_filters('pto/interface_item_data', '', $object ); 39 40 41 $output .= $indent . '<tr id="item_' . $object->ID . '"> 42 <td> 43 <strong><a class="row-title" href="'. get_edit_post_link( $object ) .'">' . $item_title .'</a> ' . $item_details .'</strong>'; 39 40 $output .= $indent . '<li id="item_' . $object->ID . '"> 41 <span>' . $item_title . ' ' . $item_details .'</span>'; 44 42 45 43 if ( $options['edit_view_links'] === 1 ) 46 $output .= '< div class="row-actions"><span class="edit"><a href="' . get_edit_post_link( $object ) .'">Edit</a> | </span><span class="view"><a target="_blank" href="'. get_permalink( $object ) .'">View</a></span></div>';44 $output .= '<span class="options ui-sortable-handle"><a href="' . get_edit_post_link( $object ) .'"><span class="dashicons dashicons-edit"></span></a></span>'; 47 45 48 $output .= '</ td>';46 $output .= '</li>'; 49 47 50 48 $output .= apply_filters( 'pto/interface/table/tbody', '', $object ); -
post-types-order/trunk/post-types-order.php
r3275418 r3303640 6 6 * Author: Nsp Code 7 7 * Author URI: http://www.nsp-code.com 8 * Version: 2.3. 58 * Version: 2.3.7 9 9 * Text Domain: post-types-order 10 10 * Domain Path: /languages/ … … 14 14 define('CPTURL', plugins_url('', __FILE__)); 15 15 16 define('PTO_VERSION', '2.3. 5');16 define('PTO_VERSION', '2.3.7'); 17 17 18 18 include_once(CPTPATH . '/include/class.cpto.php'); -
post-types-order/trunk/readme.txt
r3275418 r3303640 4 4 Tags: post order, posts order, post sort, posts sort, post types order 5 5 Requires at least: 2.8 6 Tested up to: 6.8 7 Stable tag: 2.3. 56 Tested up to: 6.8.2 7 Stable tag: 2.3.7 8 8 Requires PHP: 5.6 9 9 License: GPLv2 or later … … 118 118 == Changelog == 119 119 120 = 2.3.7 = 121 - Code improvements. 122 - Reduce the outputted HTML for the ReOrder interface to avoid memory limitation on very long lists. 123 - Re-Order interface style updates. 124 - WordPress 6.82 compatibility check and tag update. 125 120 126 = 2.3.5 = 121 127 - WordPress 6.8 compatibility check and tag update.
Note: See TracChangeset
for help on using the changeset viewer.