ba4770c9 by Jeff Balicki

post order

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent 404e4df6
1 <?php
2
3 /**
4 * Compatibility : LiteSpeed Cache
5 * Introduced at :
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
9
10 class PTO_LiteSpeed_Cache
11 {
12
13 function __construct()
14 {
15 if( ! $this->is_plugin_active())
16 return FALSE;
17
18 add_action( 'PTO/order_update_complete', array( $this, 'order_update_complete') );
19 }
20
21
22 function is_plugin_active()
23 {
24 include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
25
26 if ( is_plugin_active( 'litespeed-cache/litespeed-cache.php' ) )
27 return TRUE;
28 else
29 return FALSE;
30 }
31
32 function order_update_complete()
33 {
34
35 if( method_exists( 'LiteSpeed_Cache_API', 'purge_all' ) )
36 {
37 LiteSpeed_Cache_API::purge_all() ;
38 }
39
40 }
41
42 }
43
44 new PTO_LiteSpeed_Cache();
45
46
47 ?>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2
3
4 /**
5 * Compatibility : Events Calendar
6 * Introduced at :
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
10
11 class PTO_Events_calendar
12 {
13
14 function __construct()
15 {
16
17 add_filter( 'pto/posts_orderby/ignore', array ( $this, 'ignore_post_types_order_sort' ), 10, 3 );
18 }
19
20
21 function ignore_post_types_order_sort( $ignore, $orderBy, $query )
22 {
23 if ( isset($query->query_vars) && !empty( $query->query_vars['post_type'] ))
24 {
25 $query_post_types = array();
26 foreach ( (array)$query->query_vars['post_type'] as $_post_type )
27 {
28 $query_post_types[] = $_post_type;
29 }
30
31 if ( in_array("tribe_events", $query_post_types ) )
32 $ignore = TRUE;
33
34 }
35
36 return $ignore;
37 }
38
39 }
40
41 new PTO_Events_calendar();
42
43
44
45 ?>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2
3 /**
4 * Compatibility : Endfold
5 * Introduced at : 5.6.2
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
9
10 class PTO_Enfold
11 {
12
13 function __construct()
14 {
15
16 add_filter( 'pto/posts_orderby/ignore', array ( $this, 'ignore_post_types_order_sort' ), 10, 3 );
17 }
18
19
20 function ignore_post_types_order_sort( $ignore, $orderBy, $query )
21 {
22 if ( isset($query->query_vars) && !empty( $query->query_vars['post_type'] ))
23 {
24 $query_post_types = array();
25 foreach ( (array)$query->query_vars['post_type'] as $_post_type )
26 {
27 $query_post_types[] = $_post_type;
28 }
29
30 if ( in_array("avia_framework_post", $query_post_types ) )
31 $ignore = TRUE;
32 }
33
34 return $ignore;
35 }
36
37 }
38
39 new PTO_Enfold();
40
41
42 ?>
...\ No newline at end of file ...\ No newline at end of file
1 {
2 "name" : "nsp-code/post-types-order",
3 "description" : "Posts Order and Post Types Objects Order using a Drag and Drop Sortable javascript capability",
4 "keywords" : ["post order" , "posts order", "sort", "post sort", "posts sort", "post type order", "custom order", "admin posts order"],
5 "homepage" : "http://www.nsp-code.com/",
6 "authors" : [
7 {
8 "name": "Nsp Code",
9 "email": "contact@nsp-code.com",
10 "homepage": "http://www.nsp-code.com/"
11 }
12 ],
13 "type" : "wordpress-plugin",
14 "repositories" :[
15 {
16 "type":"composer",
17 "url":"https://wpackagist.org",
18 "only": [
19 "wpackagist-plugin/*",
20 "wpackagist-theme/*"
21 ]
22 }
23 ],
24 "require" : {
25 "composer/installers": "~1.0"
26 }
27 }
1 #the-list.ui-sortable tr .check-column:hover { cursor: move;}
2 #the-list.ui-sortable tr.alternate { background-color: #F9F9F9; }
3 #the-list.ui-sortable tr.ui-sortable-helper { background-color: #ffffff; outline: 1px solid #dfdfdf;}
4 #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 #the-list.ui-sortable > tr > th:first-child:after {position: absolute; color: #959595; content: "\f475"; transform: rotate(-90deg); margin: 4px 0 0 6px; display: block; font-family: dashicons;
8 line-height: 1;
9 font-weight: 400;
10 font-style: normal;
11 text-transform: none;
12 text-rendering: auto;
13 font-size: 20px;
14 text-align: center;}
...\ No newline at end of file ...\ No newline at end of file
1 #form_data td {vertical-align: top; padding-top: 20px}
2 #cpto #cpt_info_box {padding: 0 10px; border: 1px dashed #6aadcc; background-color: #FFF; margin-top: 10px;-webkit-box-shadow: 1px 1px 7px rgba(50, 50, 50, 0.17);-moz-box-shadow: 1px 1px 7px rgba(50, 50, 50, 0.17);box-shadow: 1px 1px 7px rgba(50, 50, 50, 0.17);}
3 #cpto #cpt_info_box a {text-decoration: none}
4 #cpto #cpt_info_box #donate_form { padding: 20px 0 17px; text-align: center; width: 100%;}
...\ No newline at end of file ...\ No newline at end of file
1 #order-post-type #sortable { list-style-type: none; margin: 10px 0 0; padding: 0; width: 100%; }
2 #order-post-type #sortable ul { margin-left:20px; list-style: none; }
3 #order-post-type #sortable li { padding: 10px; margin: 3px 0px; border-bottom: 1px solid #f4f4f4;border-left: 4px solid #ccd0d4; cursor: move; background-color: #FFF}
4 #order-post-type #sortable li:nth-child(2n+1) { background-color: #f9f9f9 !important;}
5 #order-post-type #sortable li span { display: block; font-size:14px;}
6 #order-post-type #sortable li.placeholder{border: dashed 2px #ccc;height:18px; background-color: #FFF;}
7
8 #cpto h2.subtitle {font-size: 15px; font-style: italic; font-weight: bold; padding-left: 0px}
9 .wrap .example { color: #666666; font-size: 11px; font-weight: bold}
10
11
12 #cpto #cpt_info_box {padding: 0 10px; border: 1px dashed #6aadcc; background-color: #FFF; margin-top: 10px;-webkit-box-shadow: 1px 1px 7px rgba(50, 50, 50, 0.17);-moz-box-shadow: 1px 1px 7px rgba(50, 50, 50, 0.17);box-shadow: 1px 1px 7px rgba(50, 50, 50, 0.17);}
13 #cpto #cpt_info_box a {text-decoration: none}
14 #cpto #cpt_info_box #donate_form { padding: 20px 0 17px; text-align: center; width: 100%;}
15 .menu_pto {margin-right: 4px; display: inline; vertical-align: middle; margin-top: -1px;}
16
17 #cpto #p_right {float: right; background-color:#f5f5f5; border: 1px dashed #6aadcc; padding: 0px 10px; margin-top: 10px}
18 #cpto .p_s_item {float: right; padding: 0px 5px; margin-top: 10px; margin-bottom: 5px; }
19
20 .clear {clear: both}
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" standalone="no"?>
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
3 "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
4 <svg version="1.0" xmlns="http://www.w3.org/2000/svg"
5 width="11.000000pt" height="29.000000pt" viewBox="0 0 11.000000 29.000000"
6 preserveAspectRatio="xMidYMid meet">
7
8 <g transform="translate(0.000000,29.000000) scale(0.100000,-0.100000)"
9 fill="#000000" stroke="none">
10 <path d="M17 272 c-14 -15 -17 -40 -17 -129 0 -129 10 -147 77 -140 l38 4 -41
11 1 c-22 1 -45 7 -52 14 -17 17 -17 232 1 246 7 6 30 12 52 15 l40 4 -41 1 c-29
12 1 -46 -4 -57 -16z"/>
13 <path d="M30 245 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0
14 -15 -7 -15 -15z"/>
15 <path d="M70 245 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0
16 -15 -7 -15 -15z"/>
17 <path d="M30 195 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0
18 -15 -7 -15 -15z"/>
19 <path d="M70 195 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0
20 -15 -7 -15 -15z"/>
21 <path d="M30 145 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0
22 -15 -7 -15 -15z"/>
23 <path d="M70 145 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0
24 -15 -7 -15 -15z"/>
25 <path d="M30 95 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0 -15
26 -7 -15 -15z"/>
27 <path d="M70 95 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0 -15
28 -7 -15 -15z"/>
29 <path d="M30 45 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0 -15
30 -7 -15 -15z"/>
31 <path d="M70 45 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0 -15
32 -7 -15 -15z"/>
33 </g>
34 </svg>
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
5 class CPT_Compatibility
6 {
7
8 function __construct()
9 {
10
11 $this->init();
12
13 }
14
15
16
17 function init()
18 {
19
20 $CompatibilityFiles = array(
21 'the-events-calendar.php',
22 'LiteSpeed_Cache.php',
23
24 );
25 foreach( $CompatibilityFiles as $CompatibilityFile )
26 {
27 if ( is_file( CPTPATH . 'compatibility/' . $CompatibilityFile ) )
28 include_once( CPTPATH . 'compatibility/' . $CompatibilityFile );
29 }
30
31 /**
32 * Themes
33 */
34
35 $theme = wp_get_theme();
36
37 if( ! $theme instanceof WP_Theme )
38 return FALSE;
39
40 $compatibility_themes = array(
41 'enfold' => 'enfold.php',
42 );
43
44 if (isset( $theme->template ) )
45 {
46 foreach ( $compatibility_themes as $theme_slug => $compatibility_file )
47 {
48 if ( strtolower( $theme->template ) == $theme_slug || strtolower( $theme->name ) == $theme_slug )
49 {
50 include_once( CPTPATH . 'compatibility/themes/' . $compatibility_file );
51 }
52 }
53 }
54
55
56 do_action('cpt/compatibility/init');
57
58 }
59
60
61
62 }
63
64
65 new CPT_Compatibility();
66
67 ?>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
5 class Post_Types_Order_Walker extends Walker
6 {
7
8 var $db_fields = array (
9 'parent' => 'post_parent',
10 'id' => 'ID'
11 );
12
13
14 function start_lvl(&$output, $depth = 0, $args = array())
15 {
16 $indent = str_repeat("\t", $depth);
17 $output .= "\n$indent<ul class='children'>\n";
18 }
19
20
21 function end_lvl(&$output, $depth = 0, $args = array())
22 {
23 $indent = str_repeat("\t", $depth);
24 $output .= "$indent</ul>\n";
25 }
26
27
28 function start_el(&$output, $page, $depth = 0, $args = array(), $id = 0)
29 {
30 if ( $depth )
31 $indent = str_repeat("\t", $depth);
32 else
33 $indent = '';
34
35 extract($args, EXTR_SKIP);
36
37 $item_details = apply_filters( 'the_title', $page->post_title, $page->ID );
38
39 //Deprecated, rely on pto/interface_itme_data
40 $item_details = apply_filters('cpto/interface_itme_data', $item_details, $page);
41
42 $item_details = apply_filters('pto/interface_item_data', $item_details, $page);
43
44 $output .= $indent . '<li id="item_'.$page->ID.'"><span>'. $item_details .'</span>';
45
46 }
47
48
49 function end_el(&$output, $page, $depth = 0, $args = array())
50 {
51 $output .= "</li>\n";
52 }
53
54 }
55
56
57
58 ?>
...\ No newline at end of file ...\ No newline at end of file
1
2
3 var getUrlParameter = function getUrlParameter(sParam)
4 {
5 var sPageURL = decodeURIComponent(window.location.search.substring(1)),
6 sURLVariables = sPageURL.split('&'),
7 sParameterName,
8 i;
9
10 for (i = 0; i < sURLVariables.length; i++) {
11 sParameterName = sURLVariables[i].split('=');
12
13 if (sParameterName[0] === sParam) {
14 return sParameterName[1] === undefined ? true : sParameterName[1];
15 }
16 }
17 };
18
19 jQuery(document).ready(function()
20 {
21
22 jQuery('table.wp-list-table #the-list').sortable({
23
24 placeholder: {
25 element: function(currentItem) {
26 var cols = jQuery(currentItem).children('td:visible').length + 1;
27 return jQuery('<tr class="ui-sortable-placeholder"><td colspan="' + cols + '">&nbsp;</td></tr>')[0];
28 },
29 update: function(container, p) {
30 return;
31 }
32 },
33
34 'items': 'tr',
35 'handle': ".check-column",
36 'axis': 'y',
37 'update' : function(e, ui) {
38
39 var post_type = CPTO.post_type;
40 var order = jQuery('#the-list').sortable('serialize');
41
42 var paged = getUrlParameter('paged');
43 if(typeof paged === 'undefined')
44 paged = 1;
45
46 var queryString = { "action": "update-custom-type-order-archive", "post_type" : post_type, "order" : order ,"paged": paged, "archive_sort_nonce" : CPTO.archive_sort_nonce};
47 //send the data through ajax
48 jQuery.ajax({
49 type: 'POST',
50 url: ajaxurl,
51 data: queryString,
52 cache: false,
53 dataType: "html",
54 success: function(data){
55
56 },
57 error: function(html){
58
59 }
60 });
61
62 }
63 });
64
65
66 });
1 msgid ""
2 msgstr ""
3 "Project-Id-Version: Post Types Order\n"
4 "POT-Creation-Date: 2017-07-17 16:03+0200\n"
5 "PO-Revision-Date: 2023-02-23 15:43+0200\n"
6 "Last-Translator: NspCode <contact@nsp-code.com>\n"
7 "Language-Team: \n"
8 "Language: en_US\n"
9 "MIME-Version: 1.0\n"
10 "Content-Type: text/plain; charset=UTF-8\n"
11 "Content-Transfer-Encoding: 8bit\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"
16 "X-Poedit-SearchPath-0: .\n"
17
18 #: include/class.cpto.php:207
19 msgid "Post Types Order must be configured. Please go to"
20 msgstr ""
21
22 #: include/class.cpto.php:207
23 msgid "Settings Page"
24 msgstr ""
25
26 #: include/class.cpto.php:207
27 msgid "make the configuration and save"
28 msgstr ""
29
30 #: include/class.cpto.php:485 include/class.cpto.php:487
31 #: include/class.cpto.php:490 include/class.cpto.php:501
32 msgid "Re-Order"
33 msgstr ""
34
35 #: include/class.cpto.php:509
36 msgid ""
37 "This plugin can't work without javascript, because it's use drag and drop "
38 "and AJAX."
39 msgstr ""
40
41 #: include/class.cpto.php:522
42 msgid "Update"
43 msgstr ""
44
45 #: include/class.cpto.php:543
46 msgid "Items Order Updated"
47 msgstr ""
48
49 #: include/class.functions.php:104
50 msgid ""
51 "Did you find this plugin useful? Please support our work by purchasing the "
52 "advanced version or write an article about this plugin in your blog with a "
53 "link to our site"
54 msgstr ""
55
56 #: include/class.functions.php:105
57 msgid "Did you know there is available an Advanced version of this plug-in?"
58 msgstr ""
59
60 #: include/class.functions.php:105
61 msgid "Read more"
62 msgstr ""
63
64 #: include/class.functions.php:106
65 msgid "Check our"
66 msgstr ""
67
68 #: include/class.functions.php:106
69 msgid ""
70 "plugin which allow to custom sort categories and custom taxonomies terms"
71 msgstr ""
72
73 #: include/class.functions.php:107
74 msgid "Check out"
75 msgstr ""
76
77 #: include/class.functions.php:107
78 msgid ""
79 "the easy way to completely hide your WordPress core files, theme and plugins"
80 msgstr ""
81
82 #: include/class.functions.php:142 include/class.functions.php:221
83 #, php-format
84 msgid "Use commas instead of %s to separate excluded terms."
85 msgstr ""
86
87 #: include/class.options.php:40
88 msgid "Settings Saved"
89 msgstr ""
90
91 #: include/class.options.php:57
92 msgid "General Settings"
93 msgstr ""
94
95 #: include/class.options.php:63
96 msgid "General"
97 msgstr ""
98
99 #: include/class.options.php:67
100 msgid "Show / Hide re-order interface"
101 msgstr ""
102
103 #: include/class.options.php:94
104 msgid "Show"
105 msgstr ""
106
107 #: include/class.options.php:95
108 msgid "Hide"
109 msgstr ""
110
111 #: include/class.options.php:102
112 msgid "Minimum Level to use this plugin"
113 msgstr ""
114
115 #: include/class.options.php:105
116 msgid "Subscriber"
117 msgstr ""
118
119 #: include/class.options.php:106
120 msgid "Contributor"
121 msgstr ""
122
123 #: include/class.options.php:107
124 msgid "Author"
125 msgstr ""
126
127 #: include/class.options.php:108
128 msgid "Editor"
129 msgstr ""
130
131 #: include/class.options.php:109
132 msgid "Administrator"
133 msgstr ""
134
135 #: include/class.options.php:116
136 msgid "Auto Sort"
137 msgstr ""
138
139 #: include/class.options.php:118
140 msgid ""
141 "If checked, the plug-in automatically update the WordPress queries to use "
142 "the new order (<b>No code update is necessarily</b>)"
143 msgstr ""
144
145 #: include/class.options.php:119
146 msgid ""
147 "If only certain queries need to use the custom sort, keep this unchecked and "
148 "include 'orderby' => 'menu_order' into query parameters"
149 msgstr ""
150
151 #: include/class.options.php:121
152 msgid "Additional Description and Examples"
153 msgstr ""
154
155 #: include/class.options.php:128
156 msgid "Admin Sort"
157 msgstr ""
158
159 #: include/class.options.php:132
160 msgid ""
161 "To affect the admin interface, to see the post types per your new sort, this "
162 "need to be checked"
163 msgstr ""
164
165 #: include/class.options.php:137
166 msgid "Use query ASC / DESC parameter "
167 msgstr ""
168
169 #: include/class.options.php:141
170 msgid ""
171 "If the query include an Ascending or Descending order paramether, use that. "
172 "If query order is set to DESC the order will be reversed."
173 msgstr ""
174
175 #: include/class.options.php:146
176 msgid "Archive Drag&Drop "
177 msgstr ""
178
179 #: include/class.options.php:150
180 msgid ""
181 "Allow sortable drag & drop functionality within default WordPress post type "
182 "archive. Admin Sort need to be active."
183 msgstr ""
184
185 #: include/class.options.php:155
186 msgid "Next / Previous Apply"
187 msgstr ""
188
189 #: include/class.options.php:159
190 msgid "Apply the sort on Next / Previous site-wide navigation."
191 msgstr ""
192
193 #: include/class.options.php:159
194 msgid "This can also be controlled through"
195 msgstr ""
196
197 #: include/class.options.php:159
198 msgid "code"
199 msgstr ""
200
201 #: include/class.options.php:167
202 msgid "Save Settings"
203 msgstr ""
1 <?php
2 /*
3 Plugin Name: Post Types Order
4 Plugin URI: http://www.nsp-code.com
5 Description: Posts Order and Post Types Objects Order using a Drag and Drop Sortable javascript capability
6 Author: Nsp Code
7 Author URI: http://www.nsp-code.com
8 Version: 2.1
9 Text Domain: post-types-order
10 Domain Path: /languages/
11 */
12
13 define('CPTPATH', plugin_dir_path(__FILE__));
14 define('CPTURL', plugins_url('', __FILE__));
15
16 include_once(CPTPATH . '/include/class.cpto.php');
17 include_once(CPTPATH . '/include/class.functions.php');
18
19
20 add_action( 'plugins_loaded', 'cpto_class_load');
21 function cpto_class_load()
22 {
23
24 global $CPTO;
25 $CPTO = new CPTO();
26 }
27
28
29 add_action( 'plugins_loaded', 'cpto_load_textdomain');
30 function cpto_load_textdomain()
31 {
32 load_plugin_textdomain('post-types-order', FALSE, dirname( plugin_basename( __FILE__ ) ) . '/languages');
33 }
34
35
36 add_action('wp_loaded', 'initCPTO' );
37 function initCPTO()
38 {
39 global $CPTO;
40
41 $options = $CPTO->functions->get_options();
42
43 if (is_admin())
44 {
45 if(isset($options['capability']) && !empty($options['capability']))
46 {
47 if( current_user_can($options['capability']) )
48 $CPTO->init();
49 }
50 else if (is_numeric($options['level']))
51 {
52 if ( $CPTO->functions->userdata_get_user_level(true) >= $options['level'] )
53 $CPTO->init();
54 }
55 else
56 {
57 $CPTO->init();
58 }
59 }
60 }
61
62
63
64 ?>
...\ No newline at end of file ...\ No newline at end of file