Plugin Directory

Changeset 3303640


Ignore:
Timestamp:
05/30/2025 02:31:33 PM (8 months ago)
Author:
nsp-code
Message:

Version: 2.3.7

Location:
post-types-order
Files:
37 added
9 edited

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 
    61#cpto h2.subtitle {font-size: 15px; font-style: italic; font-weight: bold; padding-left: 0px}
    72.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
    830
    931
  • post-types-order/trunk/include/class.cpto.php

    r3165840 r3303640  
    2020                    $is_configured = get_option('CPT_configured');
    2121                    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);                       
    3131                }
    3232               
     
    3939                {
    4040                   
    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'));
    4845                   
    4946                    //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') );
    5551               
    5652                }
     
    8177                        return;
    8278                   
    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')              );
    8783               
    8884                }   
     
    516512            function add_menu()
    517513                {
     514                   
     515                    include_once ( CPTPATH . '/include/class.interface.php' );
     516                    include_once ( CPTPATH . '/include/class.walkers.php' );
     517                   
    518518                    global $userdata;
    519519                    //put a menu for all custom_type
     
    536536                            }
    537537                   
     538                    $PTO_Interface =    new PTO_Interface();
     539                   
    538540                    foreach( $post_types as $post_type_name )
    539541                        {
     
    558560                           
    559561                            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') );
    561563                            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') );
    563565                            else
    564566                                {
    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') );   
    566568                                }
    567569                           
     
    588590                }
    589591           
    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>&nbsp;</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           
    744593        }
  • post-types-order/trunk/include/class.functions.php

    r3188404 r3303640  
    7171                            <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>
    7272                            <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">&nbsp;</span> <?php esc_html_e('Check out', '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">&nbsp;</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>
    7474                           
    7575                            <div class="clear"></div>
  • post-types-order/trunk/include/class.walkers.php

    r3164418 r3303640  
    3737                   
    3838                    $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>';
    4442                   
    4543                    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>';               
    4745                   
    48                     $output .=  '</td>';
     46                    $output .=  '</li>';
    4947                   
    5048                    $output .=  apply_filters( 'pto/interface/table/tbody', '', $object );
  • post-types-order/trunk/post-types-order.php

    r3275418 r3303640  
    66* Author: Nsp Code
    77* Author URI: http://www.nsp-code.com
    8 * Version: 2.3.5
     8* Version: 2.3.7
    99* Text Domain: post-types-order
    1010* Domain Path: /languages/
     
    1414    define('CPTURL',    plugins_url('', __FILE__));
    1515   
    16     define('PTO_VERSION',          '2.3.5');
     16    define('PTO_VERSION',          '2.3.7');
    1717   
    1818    include_once(CPTPATH . '/include/class.cpto.php');
  • post-types-order/trunk/readme.txt

    r3275418 r3303640  
    44Tags: post order, posts order, post sort, posts sort, post types order
    55Requires at least: 2.8
    6 Tested up to: 6.8
    7 Stable tag: 2.3.5
     6Tested up to: 6.8.2
     7Stable tag: 2.3.7
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    118118== Changelog ==
    119119
     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
    120126= 2.3.5 =
    121127 - WordPress 6.8 compatibility check and tag update.
Note: See TracChangeset for help on using the changeset viewer.