Plugin Directory

Changeset 2870026

Timestamp:
02/23/2023 01:52:33 PM (17 months ago)
Author:
nsp-code
Message:

Version: 2.0

Location:
post-types-order
Files:
28 added
11 edited

Legend:

Unmodified
Added
Removed
  • post-types-order/trunk/css/cpt-archive-dd.css

    r2717158 r2870026  
    1 #the-list.ui-sortable tr:hover { cursor: move;}
     1#the-list.ui-sortable tr:hover { cursor: move;}
    22#the-list.ui-sortable tr.alternate { background-color: #F9F9F9; }
    33#the-list.ui-sortable tr.ui-sortable-helper { background-color: #ffffff;  outline: 1px solid #dfdfdf;}
    44#the-list.ui-sortable .ui-sortable-placeholder td{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;}
     5
     6
     7
     8
     9
     10
     11
     12
     13
     14
  • post-types-order/trunk/include/class.cpto.php

    r2717158 r2870026  
    3434                    include_once(CPTPATH . '/include/class.walkers.php');
    3535                   
    36                     add_action( 'admin_init',                               array(&$this, 'registerFiles'), 11 );
     36                    add_action( 'admin_init',                               array(&$this, 'registerFiles'), 11 );
    3737                    add_action( 'admin_init',                               array(&$this, 'admin_init'), 10 );
    3838                    add_action( 'admin_menu',                               array(&$this, 'addMenu') );
     
    161161                        return( $orderBy );
    162162                   
    163                     if (is_admin())
     163                    if ()
    164164                            {
    165165                               
    166                                 if ( $options['adminsort'] == "1" || (defined('DOING_AJAX') && isset($_REQUEST['action']) && $_REQUEST['action'] == 'query-attachments') )
     166                                if ( $options['adminsort'] == "1" || () && isset($_REQUEST['action']) && $_REQUEST['action'] == 'query-attachments') )
    167167                                    {
    168168                                       
     
    233233                    $options_interface->check_options_update();
    234234                   
    235                     add_options_page('Post Types Order', '<img class="menu_pto" src="'. CPTURL .'/images/menu-icon.png" alt="" />Post Types Order', 'manage_options', 'cpto-options', array($options_interface, 'plugin_options_interface'));
    236                    
     235                    add_options_page('Post Types Order', '<img class="menu_pto" src="'. CPTURL .'/images/menu-icon.png" alt="" />Post Types Order', 'manage_options', 'cpto-options', array($options_interface, 'plugin_options_interface'));
     236                   
    237237                }   
    238238           
     239
     240
     241
     242
     243
    239244               
    240245           
     
    265270                        return;
    266271                   
     272
     273
     274
     275
     276
     277
    267278                    //check if post type is sortable
    268279                    if(isset($options['show_reorder_interfaces'][$screen->post_type]) && $options['show_reorder_interfaces'][ $screen->post_type ] != 'show')
     
    310321                }   
    311322           
    312             function registerFiles()
    313                 {
    314                     if ( $this->current_post_type != null )
    315                         {
    316                             wp_enqueue_script('jQuery');
    317                             wp_enqueue_script('jquery-ui-sortable');
    318                         }
    319                        
    320                     wp_register_style('CPTStyleSheets', CPTURL . '/css/cpt.css');
    321                     wp_enqueue_style( 'CPTStyleSheets');
    322                 }
     323
    323324           
    324325            function admin_init()
     
    530531                           
    531532                            if ( $post_type_name == 'post' )
    532                                 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, 'SortPage') );
     533                                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, 'SortPage') );
    533534                            elseif ($post_type_name == 'attachment')
    534                                 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, 'SortPage') );
     535                                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, 'SortPage') );
    535536                            else
    536537                                {
    537                                     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, 'SortPage') );   
     538                                    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, 'SortPage') );   
    538539                                }
    539                         }
     540                           
     541                            add_action('admin_print_styles-' . $hookID ,    array($this, 'admin_reorder_print_styles'));
     542                        }
     543                }
     544               
     545           
     546            function admin_reorder_print_styles()
     547                {
     548                   
     549                    if ( $this->current_post_type != null )
     550                        {
     551                            wp_enqueue_script('jQuery');
     552                            wp_enqueue_script('jquery-ui-sortable');
     553                        }
     554                       
     555                    wp_register_style('CPTStyleSheets', CPTURL . '/css/cpt.css');
     556                    wp_enqueue_style( 'CPTStyleSheets');
    540557                }
    541558           
  • post-types-order/trunk/include/class.functions.php

    r2648455 r2870026  
    4242                   
    4343                    $defaults   = array (
    44                                             'show_reorder_interfaces'   =>  array(),
    45                                             'autosort'                  =>  1,
    46                                             'adminsort'                 =>  1,
    47                                             'use_query_ASC_DESC'        =>  '',
    48                                             'archive_drag_drop'         =>  1,
    49                                             'capability'                =>  'manage_options',
    50                                             'navigation_sort_apply'     =>  1,
     44                                            'show_reorder_interfaces'           =>  array(),
     45                                            'allow_reorder_default_interfaces'  =>  array(),
     46                                            'autosort'                          =>  1,
     47                                            'adminsort'                         =>  1,
     48                                            'use_query_ASC_DESC'                =>  '',
     49                                            'archive_drag_drop'                 =>  1,
     50                                            'capability'                        =>  'manage_options',
     51                                            'navigation_sort_apply'             =>  1,
    5152                                           
    5253                                        );
     
    7071                            <h4><?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/wordpress-plugins/advanced-post-types-order/"><?php _e('Read more', 'post-types-order') ?></a></h4>
    7172                            <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>
    72                             <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('the easy way to completely hide your WordPress core files, theme 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 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(' and plugins', 'post-types-order') ?>.</p>
    7374                           
    7475                            <div class="clear"></div>
  • post-types-order/trunk/include/class.options.php

    r2599896 r2870026  
    2626                        {
    2727                           
    28                             $options['show_reorder_interfaces'] = (array) $_POST['show_reorder_interfaces'];
    29                             $options['show_reorder_interfaces'] =   array_map( 'sanitize_key', $options['show_reorder_interfaces'] );
     28                            $options['show_reorder_interfaces'] ;
     29                            $options['_interfaces'] );
    3030                               
    3131                            $options['capability']              = sanitize_key($_POST['capability']);
     
    105105                                                <?php  } ?>
    106106                                            </td>
     107
    107108                                        </tr>
    108109                                        <tr valign="top">
     
    156157                                                <input type="checkbox" <?php checked( '1', $options['archive_drag_drop'] ); ?> id="archive_drag_drop" value="1" name="archive_drag_drop">
    157158                                                <?php esc_html_e("Allow sortable drag & drop functionality within default WordPress post type archive. Admin Sort need to be active.", 'post-types-order') ?>.</p>
    158                                             </td>
     159                                                <br />
     160                                                <?php
     161                                               
     162                                                    $post_types = get_post_types();
     163                                                    foreach( $post_types as $post_type_name )
     164                                                        {
     165                                                            //ignore list
     166                                                            $ignore_post_types  =   array(
     167                                                                                            'reply',
     168                                                                                            'topic',
     169                                                                                            'report',
     170                                                                                            'status' 
     171                                                                                            );
     172                                                           
     173                                                            if( in_array($post_type_name, $ignore_post_types) )
     174                                                                continue;
     175             
     176                                                               
     177                                                            $post_type_data = get_post_type_object( $post_type_name );
     178                                                            if($post_type_data->show_ui === FALSE)
     179                                                                continue;
     180                                                ?>
     181                                                <p><label>
     182                                                    <select name="allow_reorder_default_interfaces[<?php echo esc_attr($post_type_name) ?>]">
     183                                                        <option value="yes" <?php if(isset($options['allow_reorder_default_interfaces'][$post_type_name]) && $options['allow_reorder_default_interfaces'][$post_type_name] == 'yes') {echo ' selected="selected"';} ?>><?php esc_html_e( "Yes", 'post-types-order' ) ?></option>
     184                                                        <option value="no" <?php if(isset($options['allow_reorder_default_interfaces'][$post_type_name]) && $options['allow_reorder_default_interfaces'][$post_type_name] == 'no') {echo ' selected="selected"';} ?>><?php esc_html_e( "No", 'post-types-order' ) ?></option>
     185                                                    </select> &nbsp;&nbsp;<?php echo esc_html ( $post_type_data->labels->singular_name ); ?>
     186                                                </label><br />&nbsp;</p>
     187                                                <?php  } ?>
     188                                               
     189                                            </td>
     190                                           
    159191                                        </tr>
    160192                                       
  • post-types-order/trunk/js/cpt.js

    r2717158 r2870026  
    3333               
    3434                                                        'items': 'tr',
     35
    3536                                                        'axis': 'y',
    3637                                                        'update' : function(e, ui) {
  • post-types-order/trunk/languages/post-types-order.po

    r1697481 r2870026  
    33"Project-Id-Version: Post Types Order\n"
    44"POT-Creation-Date: 2017-07-17 16:03+0200\n"
    5 "PO-Revision-Date: 2017-07-17 16:03+0200\n"
     5"PO-Revision-Date: 203+0200\n"
    66"Last-Translator: NspCode <contact@nsp-code.com>\n"
    77"Language-Team: \n"
     8
    89"MIME-Version: 1.0\n"
    910"Content-Type: text/plain; charset=UTF-8\n"
    1011"Content-Transfer-Encoding: 8bit\n"
    11 "X-Generator: Poedit 1.5.5\n"
    12 "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
    13 "X-Poedit-Basepath: ../\n"
     12"Plural-Forms: nplurals=2; plural=(n != 1);\n"
     13"X-Generator: Poedit 3.2\n"
     14"X-Poedit-KeywordsList: __;_e\n"
     15"X-Poedit-Basepath: ..\n"
    1416"X-Poedit-SearchPath-0: .\n"
    1517
  • post-types-order/trunk/post-types-order.php

    r2823437 r2870026  
    66Author: Nsp Code
    77Author URI: http://www.nsp-code.com
    8 Version: 1.9.9.2
     8Version:
    99Text Domain: post-types-order
    1010Domain Path: /languages/
  • post-types-order/trunk/readme.txt

    r2823437 r2870026  
    55Requires at least: 2.8
    66Tested up to: 6.1.1
    7 Stable tag: 1.9.9.2
     7Stable tag:
    88
    99Sort Posts and custom Post Type Objects (custom post types) using a Drag and Drop Sortable JavaScript AJAX interface or default WordPress dashboard.
     
    9494
    9595== Change Log ==
     96
     97
     98
     99
     100
     101
     102
    96103
    97104= 1.9.9.2 =
Note: See TracChangeset for help on using the changeset viewer.