Intuitive Custom Post Order - Version 2.0.1

Version Description

  • Bug fixed
Download this release

Release Info

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

Code changes from version 3.0.3 to 2.0.1

admin/settings.php CHANGED
@@ -1,8 +1,7 @@
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
 
@@ -10,12 +9,12 @@ $hicpo_tags = isset( $hicpo_options['tags'] ) ? $hicpo_options['tags'] : array()
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; ?>
@@ -24,85 +23,33 @@ $hicpo_tags = isset( $hicpo_options['tags'] ) ? $hicpo_options['tags'] : array()
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>
1
  <?php
2
 
3
+ $hicpo_options = get_option('hicpo_options');
4
+ $objects = $hicpo_options['objects'];
 
5
 
6
  ?>
7
 
9
 
10
  <?php screen_icon( 'plugins' ); ?>
11
 
12
+ <h2><?php _e('Intuitive Custom Post Order Settings', 'hicpo'); ?></h2>
13
 
14
  <?php if ( isset($_GET['msg'] )) : ?>
15
  <div id="message" class="updated below-h2">
16
+ <?php if ( $_GET['msg'] == 'update') : ?>
17
+ <p><?php _e('Settings saved.', 'hicpo'); ?></p>
18
  <?php endif; ?>
19
  </div>
20
  <?php endif; ?>
23
 
24
  <?php if ( function_exists( 'wp_nonce_field' ) ) wp_nonce_field( 'nonce_hicpo' ); ?>
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  <table class="form-table">
27
+ <tbody>
28
+ <tr valign="top">
29
+ <th scope="row"><label for="blogname"><?php _e('Sortable Objects', 'hicpo') ?></label></th>
30
+ <td>
31
+ <?php
32
+ $post_types = get_post_types( array (
33
+ 'public' => true
34
+ ), 'objects' );
35
+
36
+ foreach ($post_types as $post_type ) {
37
+ if ( $post_type->name != 'attachment' ) {
38
+ ?>
39
+ <label><input type="checkbox" name="objects[]" value="<?php echo $post_type->name; ?>" <?php if ( isset($objects) && is_array($objects) ) { if ( in_array($post_type->name, $objects )) { echo 'checked="checked"'; } } ?> />&nbsp;<?php echo $post_type->label; ?></label><br />
40
+ <?php
41
  }
42
+ }
43
+ ?>
44
+ </td>
45
+ </tr>
46
+ </tbody>
47
  </table>
48
 
 
 
 
 
49
  <p class="submit">
50
+ <input type="submit" class="button-primary" name="hicpo_submit" value="<?php _e('Update', 'cptg'); ?>" />
51
  </p>
52
 
53
  </form>
54
 
55
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
intuitive-custom-post-order.php CHANGED
@@ -2,215 +2,145 @@
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
  }
@@ -218,249 +148,115 @@ class Hicpo
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 ) {
@@ -473,90 +269,39 @@ class Hicpo
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 Items (Posts, Pages, and Custom Post Types) using a Drag and Drop Sortable JavaScript.
6
+ Version: 2.0.1
7
  Author: hijiri
8
  Author URI: http://hijiriworld.com/web/
 
 
9
  */
10
 
11
+ /* Copyright 2013 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
+ define( 'HICPO_DIR', plugin_dir_path(__FILE__) );
36
+
37
+ load_plugin_textdomain( 'hicpo', false, basename(dirname(__FILE__)).'/lang' );
38
+
39
+ /***************************************************************
40
+
41
+ Class & Method
42
+
43
+ ***************************************************************/
44
+
45
+ $hicpo = new Hicpo();
46
 
47
  class Hicpo
48
  {
49
  function __construct()
50
  {
51
+ if ( !get_option('hicpo_options') ) {
52
 
53
+ $post_types = get_post_types( array (
54
+ 'public' => true
55
+ ), 'objects' );
56
+
57
+ foreach ($post_types as $post_type ) {
58
+ $init_objects[] = $post_type->name;
59
+ }
60
+ $input_options = array( 'objects' => $init_objects );
61
+
62
+ update_option( 'hicpo_options', $input_options );
63
+ }
64
 
65
+ add_action( 'admin_menu', array( &$this, 'admin_menu') );
 
 
66
 
67
+ add_action( 'admin_init', array( &$this, 'refresh' ) );
68
+ add_action( 'admin_init', array( &$this, 'update_options') );
69
+ add_action( 'init', array( &$this, 'enable_objects' ) );
 
70
 
71
+ add_action( 'wp_ajax_update-menu-order', array( &$this, 'update_menu_order' ) );
 
 
 
72
  }
73
 
 
 
 
 
 
 
 
 
 
 
 
74
  function admin_menu()
75
  {
76
+ add_utility_page( __('Intuitive CPO', 'hicpo'), __('Intuitive CPO', 'hicpo'), 'manage_options', 'hicpo-settings', array( &$this,'admin_page' ));
77
  }
78
 
79
  function admin_page()
80
  {
81
  require HICPO_DIR.'admin/settings.php';
82
  }
83
+
84
+ function enable_objects()
85
  {
86
+ $hicpo_options = get_option( 'hicpo_options' );
87
+ $objects = $hicpo_options['objects'];
 
 
 
 
88
 
89
+ $active = false;
 
90
 
91
+ // for Pages or Custom Post Types
92
+ if ( isset($_GET['post_type']) ) {
93
+ if ( in_array( $_GET['post_type'], $objects ) ) {
 
 
 
 
94
  $active = true;
95
  }
96
+ // for Posts
97
+ } else {
98
+ $post_list = strstr( $_SERVER["REQUEST_URI"], 'wp-admin/edit.php' );
99
+ if ( $post_list && in_array( 'post', $objects ) ) {
 
100
  $active = true;
101
  }
102
  }
103
 
104
+ if ( $active ) {
105
+ $this->load_script_css();
 
 
 
 
 
 
 
 
 
 
 
 
106
  }
107
  }
108
 
109
+ function load_script_css() {
110
+ // load JavaScript
111
+ wp_enqueue_script( 'jQuery' );
112
+ wp_enqueue_script( 'jquery-ui-sortable' );
113
+ wp_enqueue_script( 'hicpojs', HICPO_URL.'/js/hicpo.js', array( 'jquery' ), null, true );
114
+ // load CSS
115
+ wp_enqueue_style( 'hicpo', HICPO_URL.'/css/hicpo.css', array(), null );
116
+ }
117
+
118
  function refresh()
119
  {
120
+ // menu_orderを再構築する
121
  global $wpdb;
122
 
123
+ $hicpo_options = get_option( 'hicpo_options' );
124
+ $objects = $hicpo_options['objects'];
125
+
126
+ foreach( $objects as $object) {
127
+ $sql = "SELECT
128
+ ID,
129
+ menu_order
130
+ FROM
131
+ $wpdb->posts
132
+ WHERE
133
+ post_type = '".$object."'
134
+ AND post_status IN ('publish', 'pending', 'draft', 'private', 'future')
135
+ ORDER BY
136
+ menu_order ASC
137
+ ";
138
+
139
+ $results = $wpdb->get_results($sql);
 
 
 
 
 
 
 
 
 
 
 
 
140
 
141
+ foreach( $results as $key => $result ) {
142
+ // 新規追加した場合「menu_order=0」で登録されるため、常に1からはじまるように振っておく
143
+ $wpdb->update( $wpdb->posts, array( 'menu_order' => $key+1 ), array( 'ID' => $result->ID ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  }
145
  }
146
  }
148
  function update_menu_order()
149
  {
150
  global $wpdb;
 
 
151
 
152
+ parse_str($_POST['order'], $data);
153
+
154
+ if ( is_array($data) ) {
155
 
156
+ // ページに含まれる記事のIDをすべて取得
157
+ $id_arr = array();
158
+ foreach( $data as $key => $values ) {
159
+ foreach( $values as $position => $id ) {
160
+ $id_arr[] = $id;
161
+ }
162
  }
163
+
164
+ // ページに含まれる記事のmenu_orderをすべて取得
165
+ $menu_order_arr = array();
166
+ foreach( $id_arr as $key => $id ) {
167
+ $results = $wpdb->get_results("SELECT menu_order FROM $wpdb->posts WHERE ID = ".$id);
168
+ foreach( $results as $result ) {
169
+ $menu_order_arr[] = $result->menu_order;
170
+ }
171
  }
172
+ // menu_order配列をソート(キーと値の相関関係は維持しない)
173
+ sort($menu_order_arr);
174
+
175
+ foreach( $data as $key => $values ) {
176
+ foreach( $values as $position => $id ) {
177
+ $wpdb->update( $wpdb->posts, array( 'menu_order' => $menu_order_arr[$position] ), array( 'ID' => $id ) );
178
+ }
 
179
  }
180
  }
181
  }
182
 
183
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
 
185
  function update_options()
186
  {
 
 
187
  if ( isset( $_POST['hicpo_submit'] ) ) {
188
+
189
  check_admin_referer( 'nonce_hicpo' );
190
 
191
+ $input_options = array( 'objects' => $_POST['objects'] );
 
 
192
 
193
  update_option( 'hicpo_options', $input_options );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  wp_redirect( 'admin.php?page=hicpo-settings&msg=update' );
195
  }
196
  }
197
+ }
 
 
 
198
 
199
+ /***************************************************************
200
+
201
+ output filter hook
202
+
203
+ ***************************************************************/
204
+
205
+ add_filter( 'pre_get_posts', 'hicpo_filter_active' );
206
+
207
+ function hicpo_filter_active( $wp_query )
208
+ {
209
+ // get_postsの場合 suppress_filters=true となる為、フィルタリングを有効にする
210
+ if ( isset($wp_query->query['suppress_filters']) ) $wp_query->query['suppress_filters'] = false;
211
+ if ( isset($wp_query->query_vars['suppress_filters']) ) $wp_query->query_vars['suppress_filters'] = false;
212
+ return $wp_query;
213
+ }
214
+
215
+ add_filter( 'pre_get_posts', 'hicpo_pre_get_posts' );
216
+
217
+ function hicpo_pre_get_posts( $wp_query )
218
+ {
219
+ $hicpo_options = get_option('hicpo_options');
220
+ $objects = $hicpo_options['objects'];
221
 
222
+ // for Admin ---------------------------------------------------------------
 
 
 
 
 
 
 
 
 
 
 
223
 
224
+ if ( is_admin() && !defined( 'DOING_AJAX' ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
225
 
226
+ // post_type=post or page or custom post type
227
+ // adminの場合、post_tyope=postも渡される
228
+ if ( isset( $wp_query->query['post_type'] ) ) {
229
+ if ( in_array( $wp_query->query['post_type'], $objects ) ) {
230
+ $wp_query->set( 'orderby', 'menu_order' );
231
+ $wp_query->set( 'order', 'ASC' );
232
+ }
 
 
233
  }
 
 
234
 
235
+ // for Template ------------------------------------------------------------
 
 
 
 
 
 
236
 
237
+ } else {
 
 
238
 
239
+ $active = false;
240
 
241
+ // postsのWordpressループ ----------------
242
 
243
+ // $wp_query->queryが空配列の場合
244
+ // WordPressループでもposts以外はpost_typeが渡される
245
+
246
+ if ( empty( $wp_query->query ) ) {
247
+ if ( in_array( 'post', $objects ) ) {
248
+ $active = true;
 
 
 
 
 
 
 
 
 
 
249
  }
250
+ } else {
251
 
252
+ // get_posts() ----------------------
 
 
253
 
254
+ // 完全な判別ではないが、suppress_filtersパラメータの有無で判別
255
+ // get_posts()の場合、post_type, orderby, orderパラメータは必ず渡される
256
+
257
+ if ( isset($wp_query->query['suppress_filters']) ) {
 
 
 
 
258
 
259
+ // post_type判定
 
 
 
260
  if ( is_array( $wp_query->query['post_type'] ) ) {
261
  $post_types = $wp_query->query['post_type'];
262
  foreach( $post_types as $post_type ) {
269
  $active = true;
270
  }
271
  }
272
+
273
+ // query_posts() or WP_Query()
274
  } else {
275
+
276
+ // post_typeが指定されている場合
277
+ if ( isset( $wp_query->query['post_type'] ) ) {
278
+
279
+ // post_type判定
280
+ if ( is_array( $wp_query->query['post_type'] ) ) {
281
+ $post_types = $wp_query->query['post_type'];
282
+ foreach( $post_types as $post_type ) {
283
+ if ( in_array( $post_type, $objects ) ) {
284
+ $active = true;
285
+ }
286
+ }
287
+ } else {
288
+ if ( in_array( $wp_query->query['post_type'], $objects ) ) {
289
+ $active = true;
290
+ }
291
+ }
292
+ // post_typeが指定されてい場合はpost_type=post
293
  } else {
294
+ if ( in_array( 'post', $objects ) ) {
295
+ $active = true;
296
+ }
297
  }
298
+ }
 
 
 
299
  }
 
 
 
 
 
300
 
301
+ if ( $active ) {
302
+ if ( !isset( $wp_query->query['orderby'] ) || $wp_query->query['orderby'] == 'post_date' ) $wp_query->set( 'orderby', 'menu_order' );
303
+ if ( !isset( $wp_query->query['order'] ) || $wp_query->query['order'] == 'DESC' ) $wp_query->set( 'order', 'ASC' );
304
+ }
305
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
306
  }
 
307
  ?>
js/hicpo.js CHANGED
@@ -1,40 +1,21 @@
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
  'axis': 'y',
5
  'helper': fixHelper,
6
  'update' : function(e, ui) {
7
+ jQuery.post( ajaxurl, {
8
  action: 'update-menu-order',
9
+ order: jQuery("#the-list").sortable("serialize"),
10
  });
11
  }
12
  });
13
+ //jQuery("#the-list").disableSelection();
14
+ });
15
+
16
+ var fixHelper = function(e, ui) {
17
+ ui.children().children().each(function() {
18
+ jQuery(this).width(jQuery(this).width());
 
 
 
 
 
 
 
 
19
  });
20
+ return ui;
21
+ };
 
 
 
 
 
 
 
 
lang/default.pot CHANGED
@@ -1,44 +1,26 @@
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 ""
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: \n"
4
+ "POT-Creation-Date: 2013-02-28 17:44+0900\n"
5
+ "PO-Revision-Date: 2013-02-28 17:45+0900\n"
6
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
7
+ "Language-Team: LANGUAGE <LL@li.org>\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
 
 
11
 
12
+ #: admin/settings.php:12
 
 
 
 
13
  msgid "Intuitive Custom Post Order Settings"
14
  msgstr ""
15
 
16
+ #: admin/settings.php:17
17
  msgid "Settings saved."
18
  msgstr ""
19
 
20
+ #: admin/settings.php:29
21
+ msgid "Sortable Objects"
 
 
 
 
 
 
 
 
 
 
 
 
22
  msgstr ""
23
 
24
+ #: admin/settings.php:50
25
  msgid "Update"
26
  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,102 +1,37 @@
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
 
@@ -120,7 +55,7 @@ Your Query which uses 'order' or 'orderby' parameters is preferred. ( 'WP_Query(
120
 
121
  = 1.1.1 =
122
 
123
- * Fixed bug
124
 
125
  = 1.1.0 =
126
 
@@ -129,10 +64,4 @@ Your Query which uses 'order' or 'orderby' parameters is preferred. ( 'WP_Query(
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.0.0
5
+ Tested up to: 3.5.1
6
+ Stable tag: 2.0.0
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) using a Drag and Drop Sortable JavaScript.
11
 
12
  == Description ==
13
 
14
+ Intuitively, Order Items (Posts, Pages, and 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
+ Excluding Custom Query which uses 'order' or 'orderby' parameters, in query_posts()', 'WP_Query()', and 'get_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. (Optional) Navigate to the Intuitive CPT Menu
25
 
26
  == Screenshots ==
27
 
28
+ 1. Order items
 
 
29
 
30
  == Changelog ==
31
 
32
+ = 2.0.1 =
33
 
34
+ * Bug fixed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  = 2.0.0 =
37
 
55
 
56
  = 1.1.1 =
57
 
58
+ * Bug fixed
59
 
60
  = 1.1.0 =
61
 
64
 
65
  = 1.0.0 =
66
 
67
+ Initial Release
 
 
 
 
 
 
screenshot-1.png ADDED
Binary file