Intuitive Custom Post Order - Version 1.1.0

Version Description

  • In order to prevent the trouble due to not configuration of screen-per-page, automatically screen-per-page is configurated to 999.
  • Excluding custom query which uses 'order' or 'orderby' parameters, in 'get_posts' or 'query_posts' and so on.
Download this release

Release Info

Developer hijiri
Plugin Icon 128x128 Intuitive Custom Post Order
Version 1.1.0
Comparing to
See all releases

Code changes from version 3.0.3 to 1.1.0

admin/settings.php DELETED
@@ -1,108 +0,0 @@
1
- <?php
2
-
3
- $hicpo_options = get_option( 'hicpo_options' );
4
- $hicpo_objects = isset( $hicpo_options['objects'] ) ? $hicpo_options['objects'] : array();
5
- $hicpo_tags = isset( $hicpo_options['tags'] ) ? $hicpo_options['tags'] : array();
6
-
7
- ?>
8
-
9
- <div class="wrap">
10
-
11
- <?php screen_icon( 'plugins' ); ?>
12
-
13
- <h2><?php _e( 'Intuitive Custom Post Order Settings', 'hicpo' ); ?></h2>
14
-
15
- <?php if ( isset($_GET['msg'] )) : ?>
16
- <div id="message" class="updated below-h2">
17
- <?php if ( $_GET['msg'] == 'update' ) : ?>
18
- <p><?php _e( 'Settings saved.' ); ?></p>
19
- <?php endif; ?>
20
- </div>
21
- <?php endif; ?>
22
-
23
- <form method="post">
24
-
25
- <?php if ( function_exists( 'wp_nonce_field' ) ) wp_nonce_field( 'nonce_hicpo' ); ?>
26
-
27
- <div id="hicpo_select_objects">
28
-
29
- <table class="form-table">
30
- <tbody>
31
- <tr valign="top">
32
- <th scope="row"><?php _e( 'Sortable Post Types', 'hicpo' ) ?></th>
33
- <td>
34
- <?php
35
- $post_types = get_post_types( array (
36
- 'show_ui' => true,
37
- 'show_in_menu' => true,
38
- ), 'objects' );
39
-
40
- foreach ( $post_types as $post_type ) {
41
- if ( $post_type->name == 'attachment' ) continue;
42
- ?>
43
- <label><input type="checkbox" name="objects[]" value="<?php echo $post_type->name; ?>" <?php if ( isset( $hicpo_objects ) && is_array( $hicpo_objects ) ) { if ( in_array( $post_type->name, $hicpo_objects ) ) { echo 'checked="checked"'; } } ?>>&nbsp;<?php echo $post_type->label; ?></label><br>
44
- <?php
45
- }
46
- ?>
47
- </td>
48
- </tr>
49
- </tbody>
50
- </table>
51
-
52
- </div>
53
-
54
- <label><input type="checkbox" id="hicpo_allcheck_objects"> <?php _e( 'All Check', 'hicpo' ) ?></label>
55
-
56
- <div id="hicpo_select_tags">
57
-
58
- <table class="form-table">
59
- <tbody>
60
- <tr valign="top">
61
- <th scope="row"><?php _e( 'Sortable Taxonomies', 'hicpo' ) ?></th>
62
- <td>
63
- <?php
64
- $taxonomies = get_taxonomies( array(
65
- 'show_ui' => true,
66
- ), 'objects' );
67
-
68
- foreach( $taxonomies as $taxonomy ) {
69
- if ( $taxonomy->name == 'post_format' ) continue;
70
- ?>
71
- <label><input type="checkbox" name="tags[]" value="<?php echo $taxonomy->name; ?>" <?php if ( isset( $hicpo_tags ) && is_array( $hicpo_tags ) ) { if ( in_array( $taxonomy->name, $hicpo_tags ) ) { echo 'checked="checked"'; } } ?>>&nbsp;<?php echo $taxonomy->label ?></label><br>
72
- <?php
73
- }
74
- ?>
75
- </td>
76
- </tr>
77
- </tbody>
78
- </table>
79
-
80
- </div>
81
-
82
- <label><input type="checkbox" id="hicpo_allcheck_tags"> <?php _e( 'All Check', 'hicpo' ) ?></label>
83
-
84
- <p class="submit">
85
- <input type="submit" class="button-primary" name="hicpo_submit" value="<?php _e( 'Update', 'cptg' ); ?>">
86
- </p>
87
-
88
- </form>
89
-
90
- </div>
91
-
92
- <script>
93
- (function($){
94
-
95
- $("#hicpo_allcheck_objects").on('click', function(){
96
- var items = $("#hicpo_select_objects input");
97
- if ( $(this).is(':checked') ) $(items).prop('checked', true);
98
- else $(items).prop('checked', false);
99
- });
100
-
101
- $("#hicpo_allcheck_tags").on('click', function(){
102
- var items = $("#hicpo_select_tags input");
103
- if ( $(this).is(':checked') ) $(items).prop('checked', true);
104
- else $(items).prop('checked', false);
105
- });
106
-
107
- })(jQuery)
108
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/hicpo.css DELETED
@@ -1,10 +0,0 @@
1
- .ui-sortable tr:hover {
2
- cursor: move;
3
- }
4
- .ui-sortable tr.alternate {
5
- background-color: #F9F9F9;
6
- }
7
- .ui-sortable tr.ui-sortable-helper {
8
- background-color: #F9F9F9;
9
- border-top: 1px solid #DFDFDF;
10
- }
 
 
 
 
 
 
 
 
 
 
intuitive-custom-post-order.php CHANGED
@@ -2,561 +2,126 @@
2
  /*
3
  Plugin Name: Intuitive Custom Post Order
4
  Plugin URI: http://hijiriworld.com/web/plugins/intuitive-custom-post-order/
5
- Description: Intuitively, Order Items (Posts, Pages, and Custom Post Types and Custom Taxonomies) using a Drag and Drop Sortable JavaScript.
6
- Version: 3.0.3
7
  Author: hijiri
8
  Author URI: http://hijiriworld.com/web/
9
- License: GPLv2 or later
10
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  */
12
 
13
- /**
14
- * Define
15
- */
 
 
16
 
17
- define( 'HICPO_URL', plugins_url( '', __FILE__ ) );
18
- define( 'HICPO_DIR', plugin_dir_path( __FILE__ ) );
19
- load_plugin_textdomain( 'hicpo', false, basename( dirname( __FILE__ ) ).'/lang' );
 
20
 
21
- /**
22
- * Uninstall hook
 
23
  */
24
 
25
- register_uninstall_hook( __FILE__, 'hicpo_uninstall' );
26
- function hicpo_uninstall()
27
- {
28
- global $wpdb;
29
- if ( function_exists( 'is_multisite' ) && is_multisite() ) {
30
- $curr_blog = $wpdb->blogid;
31
- $blogids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
32
- foreach( $blogids as $blog_id ) {
33
- switch_to_blog( $blog_id );
34
- hicpo_uninstall_db();
35
- }
36
- switch_to_blog( $curr_blog );
37
- } else {
38
- hicpo_uninstall_db();
39
- }
40
- }
41
- function hicpo_uninstall_db()
42
- {
43
- global $wpdb;
44
- $result = $wpdb->query( "DESCRIBE $wpdb->terms `term_order`" );
45
- if ( $result ){
46
- $query = "ALTER TABLE $wpdb->terms DROP `term_order`";
47
- $result = $wpdb->query( $query );
48
- }
49
- delete_option( 'hicpo_activation' );
50
- }
51
 
52
- /**
53
- * Class & Method
54
- */
55
 
56
- $hicpo = new Hicpo();
57
 
58
- class Hicpo
59
- {
60
- function __construct()
61
- {
62
- if ( !get_option( 'hicpo_activation' ) ) $this->hicpo_activation();
63
-
64
- add_action( 'admin_menu', array( $this, 'admin_menu') );
65
-
66
- add_action( 'admin_init', array( $this, 'refresh' ) );
67
-
68
- add_action( 'admin_init', array( $this, 'update_options') );
69
- add_action( 'admin_init', array( $this, 'load_script_css' ) );
70
-
71
- // sortable ajax action
72
- add_action( 'wp_ajax_update-menu-order', array( $this, 'update_menu_order' ) );
73
- add_action( 'wp_ajax_update-menu-order-tags', array( $this, 'update_menu_order_tags' ) );
74
-
75
- // reorder post types
76
- add_filter( 'pre_get_posts', array( $this, 'hicpo_filter_active' ) );
77
- add_filter( 'pre_get_posts', array( $this, 'hicpo_pre_get_posts' ) );
78
-
79
- add_filter( 'get_previous_post_where', array( $this, 'hicpo_previous_post_where' ) );
80
- add_filter( 'get_previous_post_sort', array( $this, 'hicpo_previous_post_sort' ) );
81
- add_filter( 'get_next_post_where', array( $this, 'hocpo_next_post_where' ) );
82
- add_filter( 'get_next_post_sort', array( $this, 'hicpo_next_post_sort' ) );
83
-
84
- // reorder taxonomies
85
- add_filter( 'get_terms_orderby', array( $this, 'hicpo_get_terms_orderby' ), 10, 3 );
86
- add_filter( 'wp_get_object_terms', array( $this, 'hicpo_get_object_terms' ), 10, 3 );
87
- add_filter( 'get_terms', array( $this, 'hicpo_get_object_terms' ), 10, 3 );
88
- }
89
-
90
- function hicpo_activation()
91
- {
92
- global $wpdb;
93
- $result = $wpdb->query( "DESCRIBE $wpdb->terms `term_order`" );
94
- if ( !$result ) {
95
- $query = "ALTER TABLE $wpdb->terms ADD `term_order` INT( 4 ) NULL DEFAULT '0'";
96
- $result = $wpdb->query( $query );
97
- }
98
- update_option( 'hicpo_activation', 1 );
99
- }
100
 
101
- function admin_menu()
102
- {
103
- add_options_page( __( 'Intuitive CPO', 'hicpo' ), __( 'Intuitive CPO', 'hicpo' ), 'manage_options', 'hicpo-settings', array( $this,'admin_page' ));
104
- }
105
-
106
- function admin_page()
107
- {
108
- require HICPO_DIR.'admin/settings.php';
109
- }
110
 
111
- function _check_load_script_css()
112
- {
113
- $active = false;
114
-
115
- $objects = $this->get_hicpo_options_objects();
116
- $tags = $this->get_hicpo_options_tags();
117
-
118
- if ( empty( $objects ) && empty( $tags ) ) return false;
119
-
120
- // exclude (sorting, addnew page, edit page)
121
- if ( isset( $_GET['orderby'] ) || strstr( $_SERVER["REQUEST_URI"], 'action=edit' ) || strstr( $_SERVER["REQUEST_URI"], 'wp-admin/post-new.php' ) ) return false;
122
-
123
- // check post_type
124
- if ( !empty( $objects ) ) {
125
- // if page or custom post types
126
- if ( isset( $_GET['post_type'] ) && in_array( $_GET['post_type'], $objects ) ) {
127
- $active = true;
128
- // if post
129
- } else if ( strstr( $_SERVER["REQUEST_URI"], 'wp-admin/edit.php' ) && in_array( 'post', $objects ) ) {
130
- $active = true;
131
- }
132
- }
133
-
134
- // check taxonomy
135
- if ( !empty( $tags ) ) {
136
- if ( isset( $_GET['taxonomy'] ) && in_array( $_GET['taxonomy'], $tags ) ) {
137
- $active = true;
138
- }
139
- }
140
-
141
- return $active;
142
- }
143
 
144
- function load_script_css()
145
- {
146
- if ( $this->_check_load_script_css() ) {
147
-
148
- // load JavaScript
149
- wp_enqueue_script( 'jquery' );
150
- wp_enqueue_script( 'jquery-ui-sortable' );
151
- wp_enqueue_script( 'hicpojs', HICPO_URL.'/js/hicpo.js', array( 'jquery' ), null, true );
152
-
153
- // load CSS
154
- wp_enqueue_style( 'hicpo', HICPO_URL.'/css/hicpo.css', array(), null );
155
- }
156
- }
157
-
158
- function refresh()
159
- {
160
- global $wpdb;
161
-
162
- $objects = $this->get_hicpo_options_objects();
163
- $tags = $this->get_hicpo_options_tags();
164
-
165
- if ( !empty( $objects ) ) {
166
- foreach( $objects as $object) {
167
- $result = $wpdb->get_results( "
168
- SELECT count(*) as cnt, max(menu_order) as max, min(menu_order) as min
169
- FROM $wpdb->posts
170
- WHERE post_type = '".$object."' AND post_status IN ('publish', 'pending', 'draft', 'private', 'future')
171
- " );
172
-
173
- /**
174
- * アイテム数が 0、もしくはアイテム数とmaxが同じでminが0以外の場合は、再構築処理をスキップ
175
- */
176
- if ( $result[0]->cnt == 0 ) continue;
177
- if ( count( $result ) > 0 && $result[0]->cnt == $result[0]->max && $result[0]->min != 0 ) continue;
178
-
179
- $results = $wpdb->get_results( "
180
- SELECT ID
181
- FROM $wpdb->posts
182
- WHERE post_type = '".$object."' AND post_status IN ('publish', 'pending', 'draft', 'private', 'future')
183
- ORDER BY menu_order ASC
184
- " );
185
- // 新規追加した場合 menu_order=0 で登録されるため、常に1からはじまるように振っておく
186
- foreach( $results as $key => $result ) {
187
- $wpdb->update( $wpdb->posts, array( 'menu_order' => $key+1 ), array( 'ID' => $result->ID ) );
188
- }
189
- }
190
- }
191
-
192
- if ( !empty( $tags ) ) {
193
- foreach( $tags as $taxonomy ) {
194
- $result = $wpdb->get_results( "
195
- SELECT count(*) as cnt, max(term_order) as max, min(term_order) as min
196
- FROM $wpdb->terms AS terms
197
- INNER JOIN $wpdb->term_taxonomy AS term_taxonomy ON ( terms.term_id = term_taxonomy.term_id )
198
- WHERE term_taxonomy.taxonomy = '".$taxonomy."'
199
- " );
200
-
201
- if ( $result[0]->cnt == 0 ) continue;
202
- if ( count( $result ) > 0 && $result[0]->max == $result[0]->cnt && $result[0]->min != 0 ) continue;
203
-
204
- $results = $wpdb->get_results( "
205
- SELECT terms.term_id
206
- FROM $wpdb->terms AS terms
207
- INNER JOIN $wpdb->term_taxonomy AS term_taxonomy ON ( terms.term_id = term_taxonomy.term_id )
208
- WHERE term_taxonomy.taxonomy = '".$taxonomy."'
209
- ORDER BY name ASC
210
- " );
211
- foreach( $results as $key => $result ) {
212
- $wpdb->update( $wpdb->terms, array( 'term_order' => $key+1 ), array( 'term_id' => $result->term_id ) );
213
- }
214
- }
215
- }
216
- }
217
-
218
- function update_menu_order()
219
- {
220
- global $wpdb;
221
 
222
- parse_str( $_POST['order'], $data );
223
-
224
- if ( !is_array( $data ) ) return false;
225
-
226
- // get objects per now page
227
- $id_arr = array();
228
- foreach( $data as $key => $values ) {
229
- foreach( $values as $position => $id ) {
230
- $id_arr[] = $id;
231
- }
232
- }
233
-
234
- // get menu_order of objects per now page
235
- $menu_order_arr = array();
236
- foreach( $id_arr as $key => $id ) {
237
- $results = $wpdb->get_results( "SELECT menu_order FROM $wpdb->posts WHERE ID = ".intval( $id ) );
238
- foreach( $results as $result ) {
239
- $menu_order_arr[] = $result->menu_order;
240
- }
241
- }
242
-
243
- // maintains key association = no
244
- sort( $menu_order_arr );
245
-
246
- foreach( $data as $key => $values ) {
247
- foreach( $values as $position => $id ) {
248
- $wpdb->update( $wpdb->posts, array( 'menu_order' => $menu_order_arr[$position] ), array( 'ID' => intval( $id ) ) );
249
- }
250
- }
251
  }
252
 
253
- function update_menu_order_tags()
254
- {
255
- global $wpdb;
256
-
257
- parse_str( $_POST['order'], $data );
258
-
259
- if ( !is_array( $data ) ) return false;
260
-
261
- $id_arr = array();
262
- foreach( $data as $key => $values ) {
263
- foreach( $values as $position => $id ) {
264
- $id_arr[] = $id;
265
- }
266
- }
267
-
268
- $menu_order_arr = array();
269
- foreach( $id_arr as $key => $id ) {
270
- $results = $wpdb->get_results( "SELECT term_order FROM $wpdb->terms WHERE term_id = ".intval( $id ) );
271
- foreach( $results as $result ) {
272
- $menu_order_arr[] = $result->term_order;
273
- }
274
- }
275
- sort( $menu_order_arr );
276
-
277
- foreach( $data as $key => $values ) {
278
- foreach( $values as $position => $id ) {
279
- $wpdb->update( $wpdb->terms, array( 'term_order' => $menu_order_arr[$position] ), array( 'term_id' => intval( $id ) ) );
280
- }
281
  }
282
  }
283
 
284
- function update_options()
285
- {
286
  global $wpdb;
287
-
288
- if ( isset( $_POST['hicpo_submit'] ) ) {
289
-
290
- check_admin_referer( 'nonce_hicpo' );
291
-
292
- $input_options = array();
293
- $input_options['objects'] = isset( $_POST['objects'] ) ? $_POST['objects'] : '';
294
- $input_options['tags'] = isset( $_POST['tags'] ) ? $_POST['tags'] : '';
295
-
296
- update_option( 'hicpo_options', $input_options );
297
-
298
- /**
299
- * はじめて有効化されたオブジェクトの場合、ディフォルトの order に従って order 値をセットしておく。
300
- *
301
- * post type: orderby=date, order=desc
302
- * taxonomy: orderby=name, order=asc
303
- */
304
-
305
- $objects = $this->get_hicpo_options_objects();
306
- $tags = $this->get_hicpo_options_tags();
307
-
308
- if ( !empty( $objects ) ) {
309
- foreach( $objects as $object ) {
310
- /**
311
- * アイテム数が 0 以上で order 値がセットされていないオブジェクトが対象
312
- */
313
- $result = $wpdb->get_results( "
314
- SELECT count(*) as cnt, max(menu_order) as max, min(menu_order) as min
315
- FROM $wpdb->posts
316
- WHERE post_type = '".$object."' AND post_status IN ('publish', 'pending', 'draft', 'private', 'future')
317
- " );
318
- if ( count( $result ) > 0 && $result[0]->max == 0 ) {
319
- $results = $wpdb->get_results( "
320
- SELECT ID
321
- FROM $wpdb->posts
322
- WHERE post_type = '".$object."' AND post_status IN ('publish', 'pending', 'draft', 'private', 'future')
323
- ORDER BY post_date DESC
324
- " );
325
- foreach( $results as $key => $result ) {
326
- $wpdb->update( $wpdb->posts, array( 'menu_order' => $key+1 ), array( 'ID' => $result->ID ) );
327
- }
328
- }
329
- }
330
- }
331
-
332
- if ( !empty( $tags ) ) {
333
- foreach( $tags as $taxonomy ) {
334
- $result = $wpdb->get_results( "
335
- SELECT count(*) as cnt, max(term_order) as max, min(term_order) as min
336
- FROM $wpdb->terms AS terms
337
- INNER JOIN $wpdb->term_taxonomy AS term_taxonomy ON ( terms.term_id = term_taxonomy.term_id )
338
- WHERE term_taxonomy.taxonomy = '".$taxonomy."'
339
- " );
340
- if ( count( $result ) > 0 && $result[0]->max == 0 ) {
341
- $results = $wpdb->get_results( "
342
- SELECT terms.term_id
343
- FROM $wpdb->terms AS terms
344
- INNER JOIN $wpdb->term_taxonomy AS term_taxonomy ON ( terms.term_id = term_taxonomy.term_id )
345
- WHERE term_taxonomy.taxonomy = '".$taxonomy."'
346
- ORDER BY name ASC
347
- " );
348
- foreach( $results as $key => $result ) {
349
- $wpdb->update( $wpdb->terms, array( 'term_order' => $key+1 ), array( 'term_id' => $result->term_id ) );
350
- }
351
- }
352
  }
353
  }
354
-
355
- wp_redirect( 'admin.php?page=hicpo-settings&msg=update' );
356
  }
357
  }
358
-
359
- function hicpo_previous_post_where( $where )
360
- {
361
- global $post;
362
 
363
- $objects = $this->get_hicpo_options_objects();
364
- if ( empty( $objects ) ) return $where;
365
-
366
- if ( isset( $post->post_type ) && in_array( $post->post_type, $objects ) ) {
367
- $current_menu_order = $post->menu_order;
368
- $where = "WHERE p.menu_order > '".$current_menu_order."' AND p.post_type = '". $post->post_type ."' AND p.post_status = 'publish'";
369
- }
370
- return $where;
371
- }
372
-
373
- function hicpo_previous_post_sort( $orderby )
374
- {
375
- global $post;
376
-
377
- $objects = $this->get_hicpo_options_objects();
378
- if ( empty( $objects ) ) return $orderby;
379
-
380
- if ( isset( $post->post_type ) && in_array( $post->post_type, $objects ) ) {
381
- $orderby = 'ORDER BY p.menu_order ASC LIMIT 1';
382
- }
383
- return $orderby;
384
- }
385
-
386
- function hocpo_next_post_where( $where )
387
- {
388
- global $post;
389
 
390
- $objects = $this->get_hicpo_options_objects();
391
- if ( empty( $objects ) ) return $where;
392
-
393
- if ( isset( $post->post_type ) && in_array( $post->post_type, $objects ) ) {
394
- $current_menu_order = $post->menu_order;
395
- $where = "WHERE p.menu_order < '".$current_menu_order."' AND p.post_type = '". $post->post_type ."' AND p.post_status = 'publish'";
396
- }
397
- return $where;
398
- }
399
-
400
- function hicpo_next_post_sort( $orderby )
401
- {
402
- global $post;
403
-
404
- $objects = $this->get_hicpo_options_objects();
405
- if ( empty( $objects ) ) return $orderby;
406
-
407
- if ( isset( $post->post_type ) && in_array( $post->post_type, $objects ) ) {
408
- $orderby = 'ORDER BY p.menu_order DESC LIMIT 1';
409
- }
410
- return $orderby;
411
- }
412
 
413
- function hicpo_filter_active( $wp_query )
414
- {
415
- // get_postsの場合 suppress_filters=true となる為、フィルタリングを有効にする
416
- if ( isset($wp_query->query['suppress_filters']) ) $wp_query->query['suppress_filters'] = false;
417
- if ( isset($wp_query->query_vars['suppress_filters']) ) $wp_query->query_vars['suppress_filters'] = false;
418
- return $wp_query;
419
  }
420
 
421
- function hicpo_pre_get_posts( $wp_query )
422
- {
423
- global $args;
424
-
425
- $objects = $this->get_hicpo_options_objects();
426
-
427
- if ( !is_array( $objects ) ) return false;
428
-
429
- /**
430
- * for Admin
431
- */
432
 
433
- if ( is_admin() && !defined( 'DOING_AJAX' ) ) {
434
-
435
- /**
436
- * adminの場合 post_type=post も渡される
437
- * ゆえに $_GET['post_type] での判定はダメ
438
- */
439
-
440
- if ( isset( $wp_query->query['post_type'] ) && !isset( $_GET['orderby'] ) ) {
441
- if ( in_array( $wp_query->query['post_type'], $objects ) ) {
442
- $wp_query->set( 'orderby', 'menu_order' );
443
- $wp_query->set( 'order', 'ASC' );
444
- }
445
- }
446
-
447
- /**
448
- * for Front
449
- */
450
-
451
- } else {
452
-
453
- /**
454
- * $wp_query->query['post_type'] でオブジェクト判別
455
- * ディフォルトのクエリの場合 $args が渡ってこないので可能
456
- */
457
-
458
- $active = false;
459
-
460
- // post_typeが指定されている場合
461
-
462
- if ( isset( $wp_query->query['post_type'] ) ) {
463
- // 複数指定の場合は、いずれかひとつでも該当すれば有効とする
464
- if ( is_array( $wp_query->query['post_type'] ) ) {
465
- $post_types = $wp_query->query['post_type'];
466
- foreach( $post_types as $post_type ) {
467
- if ( in_array( $post_type, $objects ) ) {
468
- $active = true;
469
- }
470
- }
471
- } else {
472
- if ( in_array( $wp_query->query['post_type'], $objects ) ) {
473
- $active = true;
474
- }
475
- }
476
- // post_typeが指定されていなければ post_type=post
477
-
478
- } else {
479
- if ( in_array( 'post', $objects ) ) {
480
- $active = true;
481
- }
482
- }
483
-
484
- /**
485
- * $args が存在した場合はそちらを優先する
486
- */
487
-
488
- if ( !$active ) return false;
489
-
490
- if ( isset( $args ) ) {
491
- // args = Array
492
- if ( is_array( $args ) ) {
493
- if ( !isset( $args['orderby'] ) ) $wp_query->set( 'orderby', 'menu_order' );
494
- if ( !isset( $args['order'] ) ) $wp_query->set( 'order', 'ASC' );
495
- // args = String
496
- } else {
497
- if ( !strstr( $args, 'orderby=' ) ) $wp_query->set( 'orderby', 'menu_order' );
498
- if ( !strstr( $args, 'order=' ) ) $wp_query->set( 'order', 'ASC' );
499
- }
500
- } else {
501
- if ( !$wp_query->get( 'orderby' ) ) $wp_query->set( 'orderby', 'menu_order' );
502
- if ( !$wp_query->get( 'order' ) && $wp_query->get( 'orderby' ) == 'menu_order') $wp_query->set( 'order', 'ASC' );;
503
- }
504
- }
505
- }
506
-
507
- function hicpo_get_terms_orderby( $orderby, $args )
508
- {
509
- if ( is_admin() ) return $orderby;
510
-
511
- $tags = $this->get_hicpo_options_tags();
512
-
513
- if( !isset( $args['taxonomy'] ) ) return $orderby;
514
-
515
- $taxonomy = $args['taxonomy'];
516
- if ( !in_array( $taxonomy, $tags ) ) return $orderby;
517
-
518
- $orderby = 't.term_order';
519
- return $orderby;
520
- }
521
 
522
- function hicpo_get_object_terms( $terms )
523
- {
524
- $tags = $this->get_hicpo_options_tags();
525
-
526
- if ( is_admin() && isset( $_GET['orderby'] ) ) return $terms;
527
-
528
- foreach( $terms as $key => $term ) {
529
- if ( is_object( $term ) && isset( $term->taxonomy ) ) {
530
- $taxonomy = $term->taxonomy;
531
- if ( !in_array( $taxonomy, $tags ) ) return $terms;
532
- } else {
533
- return $terms;
534
- }
535
- }
536
-
537
- usort( $terms, array( $this, 'taxcmp' ) );
538
- return $terms;
539
- }
540
-
541
- function taxcmp( $a, $b )
542
- {
543
- if ( $a->term_order == $b->term_order ) return 0;
544
- return ( $a->term_order < $b->term_order ) ? -1 : 1;
545
- }
546
 
547
- function get_hicpo_options_objects()
548
- {
549
- $hicpo_options = get_option( 'hicpo_options' ) ? get_option( 'hicpo_options' ) : array();
550
- $objects = isset( $hicpo_options['objects'] ) && is_array( $hicpo_options['objects'] ) ? $hicpo_options['objects'] : array();
551
- return $objects;
552
- }
553
- function get_hicpo_options_tags()
554
- {
555
- $hicpo_options = get_option( 'hicpo_options' ) ? get_option( 'hicpo_options' ) : array();
556
- $tags = isset( $hicpo_options['tags'] ) && is_array( $hicpo_options['tags'] ) ? $hicpo_options['tags'] : array();
557
- return $tags;
558
  }
559
-
560
  }
561
-
562
  ?>
2
  /*
3
  Plugin Name: Intuitive Custom Post Order
4
  Plugin URI: http://hijiriworld.com/web/plugins/intuitive-custom-post-order/
5
+ Description: Intuitively, Order posts(posts, any custom post types) using a Drag and Drop Sortable JavaScript.
 
6
  Author: hijiri
7
  Author URI: http://hijiriworld.com/web/
8
+ Version: 1.1.0
 
9
  */
10
 
11
+ /* Copyright 2012 hijiri
12
+
13
+ This program is free software; you can redistribute it and/or modify
14
+ it under the terms of the GNU General Public License, version 2, as
15
+ published by the Free Software Foundation.
16
 
17
+ This program is distributed in the hope that it will be useful,
18
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
+ GNU General Public License for more details.
21
 
22
+ You should have received a copy of the GNU General Public License
23
+ along with this program; if not, write to the Free Software
24
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
+ /***************************************************************
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
+ define
 
 
30
 
31
+ ***************************************************************/
32
 
33
+ define( 'hicpo_URL', plugins_url('', __FILE__) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
 
 
 
 
 
 
 
 
 
35
 
36
+ /***************************************************************
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
+ init
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
 
40
+ ***************************************************************/
41
+
42
+ add_action( 'wp_loaded', 'hicpo_init' );
43
+ function hicpo_init() {
44
+ global $custom_post_type_order, $userdata;
45
+ $custom_post_type_order = new hicpo();
46
+ }
47
+
48
+
49
+ class hicpo {
50
+ var $current_post_type = null;
51
+ function hicpo() {
52
+ add_action( 'admin_init', array( &$this, 'regist_files' ), 11 );
53
+ add_action( 'wp_ajax_update-menu-order', array( &$this, 'save_menu_order' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  }
55
 
56
+ function regist_files() {
57
+ // 投稿、カスタム投稿のみ対象、固定ページは除外
58
+ $post_list_url = substr($_SERVER["REQUEST_URI"], -18, 18);
59
+ if ( (isset($_GET['post_type']) && $_GET['post_type'] != 'page') || $post_list_url == '/wp-admin/edit.php' ) {
60
+ wp_enqueue_script( 'jQuery' );
61
+ wp_enqueue_script( 'jquery-ui-sortable' );
62
+ wp_enqueue_script( 'hicpojs', hicpo_URL.'/js/hicpo.js', null, true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  }
64
  }
65
 
66
+ function save_menu_order() {
 
67
  global $wpdb;
68
+ // serialize文字列を menu_order に登録
69
+ parse_str($_POST['order'], $data);
70
+ if ( is_array($data) ) {
71
+ foreach( $data as $key => $values ) {
72
+ foreach( $values as $position => $id ) {
73
+ $wpdb->update( $wpdb->posts, array( 'menu_order' => $position, 'post_parent' => 0 ), array( 'ID' => $id ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  }
75
  }
 
 
76
  }
77
  }
78
+ }
 
 
 
79
 
80
+ /***************************************************************
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
 
82
+ edit posts per page hook
83
+
84
+ ***************************************************************/
85
+
86
+ add_filter( 'edit_posts_per_page', 'hicpo_edit_post_per_page' );
87
+ function hicpo_edit_post_per_page( $per_page, $post_type ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
 
89
+ $post_list_url = substr($_SERVER["REQUEST_URI"], -18, 18);
90
+ if ( (isset($_GET['post_type']) && $_GET['post_type'] != 'page') || $post_list_url == '/wp-admin/edit.php' ) {
91
+ $per_page = 999;
 
 
 
92
  }
93
 
94
+ return $per_page;
95
+ }
 
 
 
 
 
 
 
 
 
96
 
97
+ /***************************************************************
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
 
99
+ output filter hook
100
+
101
+ ***************************************************************/
102
+
103
+ add_filter( 'pre_get_posts', 'hicpo_pre_get_posts' );
104
+ function hicpo_pre_get_posts( $query ) {
105
+ // get_postsの場合 suppress_filters=true となる為、フィルタリングを有効にする
106
+ if ( isset($query->query['suppress_filters']) ) $query->query['suppress_filters'] = false;
107
+ if ( isset($query->query_vars['suppress_filters']) ) $query->query_vars['suppress_filters'] = false;
108
+ return $query;
109
+ }
110
+
111
+ add_filter( 'posts_orderby', 'hicpo_posts_orderby' );
112
+ function hicpo_posts_orderby( $orderBy ) {
113
+ global $wpdb;
 
 
 
 
 
 
 
 
 
114
 
115
+ // for admin
116
+ if ( is_admin() ) {
117
+ $orderBy = "{$wpdb->posts}.menu_order, {$wpdb->posts}.post_date DESC";
118
+ // for site
119
+ } else {
120
+ // orderおよびorderBy引数をユーザが指定していない場合のみ適用する
121
+ if ( $orderBy == "{$wpdb->posts}.post_date DESC" ) {
122
+ $orderBy = "{$wpdb->posts}.menu_order, {$wpdb->posts}.post_date DESC";
123
+ }
 
 
124
  }
125
+ return( $orderBy );
126
  }
 
127
  ?>
js/hicpo.js CHANGED
@@ -1,40 +1,12 @@
1
- (function($){
2
-
3
- // posts
4
-
5
- $('table.posts #the-list, table.pages #the-list').sortable({
6
  'items': 'tr',
7
- 'axis': 'y',
8
- 'helper': fixHelper,
9
- 'update' : function(e, ui) {
10
- $.post( ajaxurl, {
11
- action: 'update-menu-order',
12
- order: $('#the-list').sortable('serialize'),
13
  });
14
  }
15
  });
16
- //$("#the-list").disableSelection();
17
-
18
- // tags
19
-
20
- $('table.tags #the-list').sortable({
21
- 'items': 'tr',
22
- 'axis': 'y',
23
- 'helper': fixHelper,
24
- 'update' : function(e, ui) {
25
- $.post( ajaxurl, {
26
- action: 'update-menu-order-tags',
27
- order: $('#the-list').sortable('serialize'),
28
- });
29
- }
30
- });
31
- //$("#the-list").disableSelection();
32
-
33
- var fixHelper = function(e, ui) {
34
- ui.children().children().each(function() {
35
- $(this).width($(this).width());
36
- });
37
- return ui;
38
- };
39
-
40
- })(jQuery)
1
+ jQuery(document).ready(function() {
2
+ jQuery("#the-list").sortable({
 
 
 
3
  'items': 'tr',
4
+ 'update' : function(e, u) {
5
+ jQuery.post( ajaxurl, {
6
+ action:'update-menu-order',
7
+ order:jQuery("#the-list").sortable("serialize")
 
 
8
  });
9
  }
10
  });
11
+ jQuery("#the-list").disableSelection();
12
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lang/default.pot DELETED
@@ -1,44 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: \n"
4
- "POT-Creation-Date: 2015-01-26 21:02+0900\n"
5
- "PO-Revision-Date: 2015-01-26 21:02+0900\n"
6
- "Last-Translator: hijiri <hijiriworld@gmail.com>\n"
7
- "Language-Team: \n"
8
- "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=UTF-8\n"
10
- "Content-Transfer-Encoding: 8bit\n"
11
- "X-Generator: Poedit 1.5.7\n"
12
- "X-Poedit-KeywordsList: __;_e\n"
13
-
14
- #: intuitive-custom-post-order/intuitive-custom-post-order.php:140
15
- msgid "Intuitive CPO"
16
- msgstr ""
17
-
18
- #: intuitive-custom-post-order/admin/settings.php:12
19
- msgid "Intuitive Custom Post Order Settings"
20
- msgstr ""
21
-
22
- #: intuitive-custom-post-order/admin/settings.php:17
23
- msgid "Settings saved."
24
- msgstr ""
25
-
26
- #: intuitive-custom-post-order/admin/settings.php:31
27
- msgid "Sortable Post Types"
28
- msgstr ""
29
-
30
- #: intuitive-custom-post-order/admin/settings.php:53
31
- msgid "All Check"
32
- msgstr ""
33
-
34
- #: intuitive-custom-post-order/admin/settings.php:60
35
- msgid "Sortable Taxonomies"
36
- msgstr ""
37
-
38
- #: intuitive-custom-post-order/admin/settings.php:62
39
- msgid "Custom Taxonomies Order becomes always effective."
40
- msgstr ""
41
-
42
- #: intuitive-custom-post-order/admin/settings.php:71
43
- msgid "Update"
44
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lang/hicpo-ja.mo DELETED
Binary file
lang/hicpo-ja.po DELETED
@@ -1,44 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: \n"
4
- "POT-Creation-Date: 2015-01-26 21:02+0900\n"
5
- "PO-Revision-Date: 2015-01-26 21:05+0900\n"
6
- "Last-Translator: hijiri <hijiriworld@gmail.com>\n"
7
- "Language-Team: \n"
8
- "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=UTF-8\n"
10
- "Content-Transfer-Encoding: 8bit\n"
11
- "X-Generator: Poedit 1.5.7\n"
12
- "X-Poedit-KeywordsList: __;_e\n"
13
-
14
- #: intuitive-custom-post-order/intuitive-custom-post-order.php:140
15
- msgid "Intuitive CPO"
16
- msgstr "並び替え設定"
17
-
18
- #: intuitive-custom-post-order/admin/settings.php:12
19
- msgid "Intuitive Custom Post Order Settings"
20
- msgstr "並び替え設定"
21
-
22
- #: intuitive-custom-post-order/admin/settings.php:17
23
- msgid "Settings saved."
24
- msgstr ""
25
-
26
- #: intuitive-custom-post-order/admin/settings.php:31
27
- msgid "Sortable Post Types"
28
- msgstr "並び替える投稿タイプ"
29
-
30
- #: intuitive-custom-post-order/admin/settings.php:53
31
- msgid "All Check"
32
- msgstr "すべて選択"
33
-
34
- #: intuitive-custom-post-order/admin/settings.php:60
35
- msgid "Sortable Taxonomies"
36
- msgstr "並び替えるカスタム分類"
37
-
38
- #: intuitive-custom-post-order/admin/settings.php:62
39
- msgid "Custom Taxonomies Order becomes always effective."
40
- msgstr "カスタム分類は常に並び替えが有効になります。"
41
-
42
- #: intuitive-custom-post-order/admin/settings.php:71
43
- msgid "Update"
44
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lang/hicpo-sv_SE.mo DELETED
Binary file
lang/hicpo-sv_SE.po DELETED
@@ -1,45 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Intuitive Custom Post Order v2.0.6\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: \n"
6
- "PO-Revision-Date: 2013-11-23 17:40+0100\n"
7
- "Last-Translator: Thomas Persson <info@ajfix.se>\n"
8
- "Language-Team: \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 1.5.7\n"
14
- "X-Poedit-SourceCharset: utf-8\n"
15
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
16
- "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
17
- "X-Poedit-Basepath: ../\n"
18
- "X-Textdomain-Support: yes\n"
19
- "Language: sv_SE\n"
20
- "X-Poedit-SearchPath-0: .\n"
21
-
22
- # @ hicpo
23
- #: admin/settings.php:12
24
- msgid "Intuitive Custom Post Order Settings"
25
- msgstr "Intuitive CPO Inst&auml;llningar"
26
-
27
- # @ hicpo
28
- #: admin/settings.php:17
29
- msgid "Settings saved."
30
- msgstr "Inst&auml;llningar sparade"
31
-
32
- # @ hicpo
33
- #: admin/settings.php:29
34
- msgid "Sortable Objects"
35
- msgstr "Sorteringsbara objekt"
36
-
37
- # @ cptg
38
- #: admin/settings.php:50
39
- msgid "Update"
40
- msgstr "Uppdatera"
41
-
42
- # @ hicpo
43
- #: intuitive-custom-post-order.php:117
44
- msgid "Intuitive CPO"
45
- msgstr "Intuitive CPO"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -1,138 +1,36 @@
1
  === Intuitive Custom Post Order ===
2
  Contributors: hijiri
3
- Tags: post order, posts order, order post, order posts, custom post type order, custom taxonomy order
4
- Requires at least: 3.5.0
5
- Tested up to: 4.1.0
6
- Stable tag: 3.0.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
- Intuitively, Order Items (Posts, Pages, and Custom Post Types, and Custom Taxonomies) using a Drag and Drop Sortable JavaScript.
11
 
12
  == Description ==
13
 
14
- Intuitively, Order Items (Posts, Pages, and Custom Post Types, and Custom Taxonomies) using a Drag and Drop Sortable JavaScript.
15
  Configuration is unnecessary.
16
  You can do directly on default WordPress administration.
17
 
18
- Your Query which uses 'order' or 'orderby' parameters is preferred. ( 'WP_Query()', 'get_posts()', 'query_posts()' )
19
-
20
  == Installation ==
21
 
22
- 1. Upload 'intuitive-custom-post-order' folder to the `/wp-content/plugins/` directory.
23
- 2. Activate the plugin through the 'Plugins' menu in WordPress.
24
- 3. Select Sortable Objects from Intuitive CPT Menu.
25
 
26
  == Screenshots ==
27
 
28
- 1. Reorder post
29
- 2. Reorder taxonomy
30
- 3. Settings
31
 
32
  == Changelog ==
33
 
34
- = 3.0.3 =
35
-
36
- * Performance improvement for Activation.
37
- * Add Initialize of Custom Taxonomy Order.
38
- * Fixed bug of refresh method.
39
- * Overwirting orderby, order improved.(Thanks @newash and @anriettec)
40
-
41
- = 3.0.1 & 3.0.2 =
42
-
43
- * Fixed bug
44
-
45
- = 3.0.0 =
46
-
47
- * Support the Custom Taxonomy Order!!
48
- ( wp_list_categories, get_categories, the_terms, the_tags, get_terms, get_the_terms, get_the_term_list, the_category, wp_dropdown_categories, the_taxonomies )
49
- * Suuport the sorting in admin UI.
50
- While having sorted, Drag and Drop Sortable Javascript don't run.
51
- * Support non public objects( show_ui=true, show_in_menu=true )
52
- * Add Japanese Translations.
53
-
54
- = 2.1.0 =
55
-
56
- * Fixed bug: Custom Query which uses 'order' or 'orderby' parameters is preferred.
57
- * It does not depend on the designation manner of arguments( Parameters ).
58
- ( $args = 'orderby=&order=' or $args = array( 'orderby' => '', 'order' => '' ) )
59
- * The trouble which exists in 2.0.7, 2.0.8, 2.0.9 was improved!
60
- * From 2.0.6 please update in 2.1.0.
61
-
62
- = 2.0.9 =
63
-
64
- * Performance improvement for Admin.
65
- Fatal performance problem was improved dramatically.
66
- * Fixed bug: Attachment objects are not broken.
67
- * Fixed bug: Alert warning on the multisite was solved.
68
- * Fixed bug: First when enabling items, 'menu order' of items are not broken.
69
- * Custom Query which uses 'order' or 'orderby' parameters is preferred.
70
-
71
- = 2.0.8 =
72
-
73
- * Performance improvement for Admin.
74
- Refresh method( re-constructing all menu order) run on only active object's List page.
75
-
76
- = 2.0.7 =
77
-
78
- * Fixed bug: for WordPress 3.8
79
- * Add Swedish Translations.(by Thomas)
80
-
81
- = 2.0.6 =
82
-
83
- * ver.2.0.5 fixed.
84
-
85
- = 2.0.5 =
86
-
87
- * Support 'next_post_link()' and 'previous_post_link()'(single to single).
88
-
89
- = 2.0.4 =
90
-
91
- * Fixed bug
92
-
93
- = 2.0.3 =
94
-
95
- * Intuitive CPO Settings Page was moved to Settings menu.
96
-
97
- = 2.0.2 =
98
-
99
- * Fixed bug
100
-
101
- = 2.0.0 =
102
-
103
- * Select Sortable Objects. (Posts, Pages, and Custom Post Types)
104
- * Support Pages and hierarchical Custom Post Types.
105
- * Sortable Item's status is not only 'publish' but also other all status('pending', 'draft', 'private', 'future').
106
- * In Paging, it's all activated normaly. So, 'screen-per-page' is User like.
107
- * In Lists which sorted any category(Category, Tag, Taxonomy), it's all activated normaly.
108
- * Support Child posts and Child pages. When you sort any item, Relation of parent item between it's child items is maintained.
109
-
110
- = 1.2.1 =
111
-
112
- * Bug fixed
113
-
114
- = 1.2.0 =
115
-
116
- * Sortable UI that Visually cleared. (Change cursor, and so on.)
117
- * Sortable items can be dragged only vertically.
118
- * Quick Edit Menu was enabled.
119
- * It is not collapse of the cell widths any more whenever dragging any items.
120
-
121
- = 1.1.1 =
122
-
123
- * Fixed bug
124
-
125
  = 1.1.0 =
126
 
127
- * screen-per-page is configurated to '999' automatically to prevent the trouble due to not setting it.
128
  * Excluding custom query which uses 'order' or 'orderby' parameters, in 'get_posts' or 'query_posts' and so on.
129
 
130
  = 1.0.0 =
131
 
132
- Initial Release
133
-
134
- == Upgrade Notice ==
135
-
136
- = 3.0.3 =
137
-
138
- Expand Database Table: wp_terms.
1
  === Intuitive Custom Post Order ===
2
  Contributors: hijiri
3
+ Tags: post order, posts order, order post, order posts, custom post type order
4
+ Requires at least: 3.3
5
+ Tested up to: 3.4.2
6
+ Stable tag: 1.1.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
+ Intuitively, Order posts(posts, any custom post types) using a Drag and Drop Sortable JavaScript.
11
 
12
  == Description ==
13
 
14
+ Intuitively, Order posts(posts, any custom post types) using a Drag and Drop Sortable JavaScript.
15
  Configuration is unnecessary.
16
  You can do directly on default WordPress administration.
17
 
 
 
18
  == Installation ==
19
 
20
+ 1. Upload 'intuitive-custom-post-order' folder to the `/wp-content/plugins/` directory
21
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
 
22
 
23
  == Screenshots ==
24
 
25
+ 1. Order posts
 
 
26
 
27
  == Changelog ==
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  = 1.1.0 =
30
 
31
+ * In order to prevent the trouble due to not configuration of screen-per-page, automatically screen-per-page is configurated to 999.
32
  * Excluding custom query which uses 'order' or 'orderby' parameters, in 'get_posts' or 'query_posts' and so on.
33
 
34
  = 1.0.0 =
35
 
36
+ Initial Release
 
 
 
 
 
 
screenshot-1.png ADDED
Binary file