Post Types Order - Version 1.5.1

Version Description

  • Updates/Fixes
Download this release

Release Info

Developer nsp-code
Plugin Icon 128x128 Post Types Order
Version 1.5.1
Comparing to
See all releases

Code changes from version 1.4.6 to 1.5.1

css/cpt.css ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #sortable { list-style-type: none; margin: 10px 0 0; padding: 0; width: 100%; }
2
+ #sortable ul { margin-left:20px; list-style: none; }
3
+ #sortable li { padding: 2px 0px; margin: 4px 0px; border: 1px solid #DDDDDD; cursor: move; -moz-border-radius:6px}
4
+ #sortable li span { display: block; background: #f7f7f7; padding: 5px; color:#808080; font-size: font-size:14px; font-weight:bold;}
5
+ #sortable li.placeholder{border: dashed 2px #ccc;background-color:#FFF;height:20px;}
6
+
7
+ #icon-settings {background-image:url("../images/admin-icon-settings.gif");background-repeat:no-repeat;}
8
+ h2.subtitle {font-size: 15px; font-style: italic; font-weight: bold}
9
+ .wrap .example { color: #666666; font-size: 11px; font-weight: bold}
10
+
11
+ #cpt_info_box {padding: 0 10px; border: 1px dashed #21759B; background-color: #F1F1F1}
12
+ #cpt_info_box p {font-size: 12px}
13
+ #cpt_info_box #donate_form {float: right; padding: 10px 0 10px 10px}
14
+
15
+ .menu_pto {margin-bottom: -2px; display: inline; padding-right: 2px}
16
+
17
+ #p_right {float: right; width: 170px; }
18
+ .p_s_item {float: left; padding: 0px 5px; margin-top: 15px; margin-bottom: 5px}
19
+ .p_s_item.s_gp {padding-top: 2px; margin-left: 10px}
20
+
21
+ .clear {clear: both}
images/admin-icon-settings.gif ADDED
Binary file
images/menu-icon.gif ADDED
Binary file
include/functions.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function userdata_get_user_level($return_as_numeric = FALSE)
4
+ {
5
+ global $userdata;
6
+
7
+ $user_level = '';
8
+ for ($i=10; $i >= 0;$i--)
9
+ {
10
+ if (current_user_can('level_' . $i) === TRUE)
11
+ {
12
+ $user_level = $i;
13
+ if ($return_as_numeric === FALSE)
14
+ $user_level = 'level_'.$i;
15
+ break;
16
+ }
17
+ }
18
+ return ($user_level);
19
+ }
20
+
21
+
22
+ function cpt_info_box()
23
+ {
24
+ ?>
25
+ <div id="cpt_info_box">
26
+ <div id="p_right">
27
+
28
+ <div id="p_socialize">
29
+ <div class="p_s_item s_gp">
30
+ <!-- Place this tag in your head or just before your close body tag -->
31
+ <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
32
+
33
+ <!-- Place this tag where you want the +1 button to render -->
34
+ <div class="g-plusone" data-size="small" data-annotation="none" data-href="http://nsp-code.com/"></div>
35
+ </div>
36
+ <div class="p_s_item s_t">
37
+ <a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.nsp-code.com" data-text="Define custom order for your taxonomies terms through an easy to use javascript AJAX drag and drop interface. No theme code updates are necessarily, this plugin will take care of query update." data-count="none">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
38
+ </div>
39
+
40
+ <div class="p_s_item s_f">
41
+ <iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.nsp-code.com%2F&amp;send=false&amp;layout=button_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:21px;" allowTransparency="true"></iframe>
42
+ </div>
43
+
44
+ <div class="clear"></div>
45
+ </div>
46
+ <div class="clear"></div>
47
+
48
+ <div id="donate_form">
49
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
50
+ <input type="hidden" name="cmd" value="_s-xclick">
51
+ <input type="hidden" name="hosted_button_id" value="CU22TFDKJMLAE">
52
+ <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
53
+ <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
54
+ </form>
55
+ </div>
56
+ </div>
57
+
58
+ <p>Did you found useful this plug-in? Please support our work with a donation or write an article about this plugin in your blog with a link to our site <strong>http://www.nsp-code.com/</strong>.</p>
59
+ <h4>Did you know there is available a more advanced version of this plug-in? <a target="_blank" href="http://www.nsp-code.com/wordpress-plugins/post-types-order">Read more</a></h4>
60
+ <p>Check our <a target="_blank" href="http://wordpress.org/extend/plugins/taxonomy-terms-order/">Category Order - Taxonomy Terms Order</a> plugin which allow to custom sort all categories and custom taxonomies terms </p>
61
+ </div>
62
+
63
+ <?php
64
+ }
65
+
66
+ ?>
include/options.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ function cpt_plugin_options()
5
+ {
6
+ $options = get_option('cpto_options');
7
+
8
+ if (isset($_POST['form_submit']))
9
+ {
10
+
11
+ $options['level'] = $_POST['level'];
12
+
13
+ $options['autosort'] = isset($_POST['autosort']) ? $_POST['autosort'] : '';
14
+ $options['adminsort'] = isset($_POST['adminsort']) ? $_POST['adminsort'] : '';
15
+
16
+ echo '<div class="updated fade"><p>' . __('Settings Saved', 'cpt') . '</p></div>';
17
+
18
+ update_option('cpto_options', $options);
19
+ update_option('CPT_configured', 'TRUE');
20
+
21
+ }
22
+
23
+ $queue_data = get_option('ce_queue');
24
+
25
+ ?>
26
+ <div class="wrap">
27
+ <div id="icon-settings" class="icon32"></div>
28
+ <h2>General Settings</h2>
29
+
30
+ <?php cpt_info_box(); ?>
31
+
32
+ <form id="form_data" name="form" method="post">
33
+ <br />
34
+ <h2 class="subtitle">General</h2>
35
+ <table class="form-table">
36
+ <tbody>
37
+
38
+ <tr valign="top">
39
+ <th scope="row" style="text-align: right;"><label>Minimum Level to use this plugin</label></th>
40
+ <td>
41
+ <select id="role" name="level">
42
+ <option value="0" <?php if ($options['level'] == "0") echo 'selected="selected"'?>><?php _e('Subscriber', 'cpt') ?></option>
43
+ <option value="1" <?php if ($options['level'] == "1") echo 'selected="selected"'?>><?php _e('Contributor', 'cpt') ?></option>
44
+ <option value="2" <?php if ($options['level'] == "2") echo 'selected="selected"'?>><?php _e('Author', 'cpt') ?></option>
45
+ <option value="5" <?php if ($options['level'] == "5") echo 'selected="selected"'?>><?php _e('Editor', 'cpt') ?></option>
46
+ <option value="8" <?php if ($options['level'] == "8") echo 'selected="selected"'?>><?php _e('Administrator', 'cpt') ?></option>
47
+ </select>
48
+ </td>
49
+ </tr>
50
+
51
+ <tr valign="top">
52
+ <th scope="row" style="text-align: right;"><label>Auto Sort</label></th>
53
+ <td>
54
+ <label for="users_can_register">
55
+ <input type="checkbox" <?php if ($options['autosort'] == "1") {echo ' checked="checked"';} ?> value="1" name="autosort">
56
+ <?php _e("If checked, the plug-in will automatically update the wp-queries to use the new order (<b>No code update is necessarily</b>).<br /> If you need more order customizations you will need to uncheck this and include 'menu_order' into your theme queries", 'cpt') ?>.</label>
57
+
58
+ <p><a href="javascript:;" onclick="jQuery('#example1').slideToggle();;return false;">Show Examples</a></p>
59
+ <div id="example1" style="display: none">
60
+
61
+ <p class="example"><br /><?php _e('The following PHP code will still return the post in the set-up Order', 'cpt') ?>:</p>
62
+ <pre class="example">
63
+ $args = array(
64
+ 'post_type' => 'feature'
65
+ );
66
+
67
+ $my_query = new WP_Query($args);
68
+ while ($my_query->have_posts())
69
+ {
70
+ $my_query->the_post();
71
+ (..your code..)
72
+ }
73
+ </pre>
74
+ <p class="example"><br /><?php _e('Or', 'cpt') ?>:</p>
75
+ <pre class="example">
76
+ $posts = get_posts($args);
77
+ foreach ($posts as $post)
78
+ {
79
+ (..your code..)
80
+ }
81
+ </pre>
82
+
83
+ <p class="example"><br /><?php _e('If the Auto Sort is uncheck you will need to use the "orderby" and "order" parameters', 'cpt') ?>:</p>
84
+ <pre class="example">
85
+ $args = array(
86
+ 'post_type' => 'feature',
87
+ 'orderby' => 'menu_order',
88
+ 'order' => 'ASC'
89
+ );
90
+ </pre>
91
+
92
+ </div>
93
+ </td>
94
+ </tr>
95
+
96
+
97
+ <tr valign="top">
98
+ <th scope="row" style="text-align: right;"><label>Admin Sort</label></th>
99
+ <td>
100
+ <label for="users_can_register">
101
+ <input type="checkbox" <?php if ($options['adminsort'] == "1") {echo ' checked="checked"';} ?> value="1" name="adminsort">
102
+ <?php _e("To affect the admin interface, to see the post types per your new sort, this need to be checked", 'cpt') ?>.</label>
103
+ </td>
104
+ </tr>
105
+
106
+ </tbody>
107
+ </table>
108
+
109
+ <p class="submit">
110
+ <input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Settings', 'cpt') ?>">
111
+ </p>
112
+
113
+ <input type="hidden" name="form_submit" value="true" />
114
+
115
+
116
+ </form>
117
+
118
+ <br />
119
+
120
+ <?php
121
+ echo '</div>';
122
+
123
+
124
+ }
125
+
126
+ ?>
lang/cpt-pt_BR.po ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Post Types Order\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-11-29 09:26-0300\n"
6
+ "PO-Revision-Date: 2010-11-29 19:14-0300\n"
7
+ "Last-Translator: Gabriel Reguly <gabriel@ppgr.com.br>\n"
8
+ "Language-Team: http://ppgr.com.br/\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: __;_e\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "X-Poedit-Language: Portuguese\n"
15
+ "X-Poedit-Country: BRAZIL\n"
16
+ "X-Poedit-SearchPath-0: post-types-order\n"
17
+
18
+ #: post-types-order/post-types-order.php:41
19
+ msgid "Post Types Order"
20
+ msgstr "Ordenar Posts"
21
+
22
+ #: post-types-order/post-types-order.php:176
23
+ msgid "Invalid post type"
24
+ msgstr "Type de post inválido"
25
+
26
+ #: post-types-order/post-types-order.php:216
27
+ #: post-types-order/post-types-order.php:218
28
+ msgid "Re-Order"
29
+ msgstr "Reordenar"
30
+
31
+ #: post-types-order/post-types-order.php:229
32
+ #, php-format
33
+ msgid "%s - Re-order "
34
+ msgstr "Reordenar %s"
35
+
36
+ #: post-types-order/post-types-order.php:233
37
+ msgid "This plugin can't work without javascript, because it use drag and drop and AJAX."
38
+ msgstr "Este plugin precisa de JavaScript para funcionar."
39
+
40
+ #: post-types-order/post-types-order.php:242
41
+ msgid "Update"
42
+ msgstr "Atualizar"
43
+
44
+ #: post-types-order/post-types-order.php:257
45
+ msgid "Item order updated"
46
+ msgstr "Ordem alterada"
47
+
48
+ #: post-types-order/post-types-order.php:263
49
+ msgid "Did you found this plug-in useful? Please support our work with a donation."
50
+ msgstr "Você considera útil este plugin? Por favor, faça uma doação para o autor."
51
+
52
+ #: post-types-order/post-types-order.php:283
53
+ msgid "Pages"
54
+ msgstr "Páginas"
55
+
56
+ #: post-types-order/include/options.php:6
57
+ msgid "Settings Saved"
58
+ msgstr "Configuração salva"
59
+
60
+ #: post-types-order/include/options.php:13
61
+ msgid "General Setings"
62
+ msgstr "Configuração geral"
63
+
64
+ #: post-types-order/include/options.php:16
65
+ msgid "General"
66
+ msgstr "Geral"
67
+
68
+ #: post-types-order/include/options.php:21
69
+ msgid "Minimum Level to use this plugin"
70
+ msgstr "Nível minimo para utilizar este plugin"
71
+
72
+ #: post-types-order/include/options.php:25
73
+ msgid "Subscriber"
74
+ msgstr "Assinante"
75
+
76
+ #: post-types-order/include/options.php:26
77
+ msgid "Contributor"
78
+ msgstr "Contribuidor"
79
+
80
+ #: post-types-order/include/options.php:27
81
+ msgid "Author"
82
+ msgstr "Author"
83
+
84
+ #: post-types-order/include/options.php:28
85
+ msgid "Editor"
86
+ msgstr "Editor"
87
+
88
+ #: post-types-order/include/options.php:29
89
+ msgid "Administrator"
90
+ msgstr "Administrador"
91
+
92
+ #: post-types-order/include/options.php:36
93
+ msgid "Save Settings"
94
+ msgstr "Salvar configuração"
95
+
post-types-order.php CHANGED
@@ -2,10 +2,10 @@
2
  /*
3
  Plugin Name: Post Types Order
4
  Plugin URI: http://www.nsp-code.com
5
- Description: Order Post Types Objects using a Drag and Drop Sortable javascript capability
6
  Author: NSP CODE
7
  Author URI: http://www.nsp-code.com
8
- Version: 1.4.6
9
  */
10
 
11
  define('CPTPATH', ABSPATH.'wp-content/plugins/post-types-order');
@@ -98,7 +98,7 @@ function CPTO_admin_notices()
98
  }
99
 
100
 
101
- add_action( 'plugins_loaded', 'cpto_load_textdomain', 2 );
102
  function cpto_load_textdomain()
103
  {
104
  $locale = get_locale();
@@ -127,7 +127,7 @@ function initCPTO()
127
  {
128
  if (is_numeric($options['level']))
129
  {
130
- if (userdata_get_user_level() >= $options['level'])
131
  $custom_post_type_order = new CPTO();
132
  }
133
  else
2
  /*
3
  Plugin Name: Post Types Order
4
  Plugin URI: http://www.nsp-code.com
5
+ Description: Order Posts and Post Types Objects using a Drag and Drop Sortable javascript capability
6
  Author: NSP CODE
7
  Author URI: http://www.nsp-code.com
8
+ Version: 1.5.1
9
  */
10
 
11
  define('CPTPATH', ABSPATH.'wp-content/plugins/post-types-order');
98
  }
99
 
100
 
101
+ add_action( 'plugins_loaded', 'cpto_load_textdomain', 99 );
102
  function cpto_load_textdomain()
103
  {
104
  $locale = get_locale();
127
  {
128
  if (is_numeric($options['level']))
129
  {
130
+ if (userdata_get_user_level(true) >= $options['level'])
131
  $custom_post_type_order = new CPTO();
132
  }
133
  else
readme.txt CHANGED
@@ -1,16 +1,16 @@
1
  === Post Types Order ===
2
  Contributors: Nsp Code
3
  Donate link: http://www.nsp-code.com/donate.php
4
- Tags: post type order, custom post type order, post types order, pages order, posts order, admin posts order
5
  Requires at least: 2.8
6
- Tested up to: 3.1
7
- Stable tag: 1.4.6
8
 
9
  Order Post Types Objects (posts, pages, custom post types) using a Drag and Drop Sortable javascript capability
10
 
11
  == Description ==
12
 
13
- Order Post Types Objects using a Drag and Drop Sortable javascript capability
14
  It allow to reorder the posts for any custom post types you defined, including the default Posts and Pages. Also you can have the admin posts interface sorted per your new sort.
15
  <br />This plugin it's developed by <a target="_blank" href="http://www.nsp-code.com">Nsp-Code</a>
16
 
@@ -48,13 +48,16 @@ All ideas are welcome and i put them on my list to be implemented into the new v
48
 
49
  == Change Log ==
50
 
51
- = 1.4.6
 
 
 
52
  - Get Previous / Next Posts Update
53
 
54
- = 1.4.3
55
  - Small improvments
56
 
57
- = 1.4.1
58
  - Re-Order Menu Item Appearance fix for update versions
59
 
60
  = 1.3.9 =
1
  === Post Types Order ===
2
  Contributors: Nsp Code
3
  Donate link: http://www.nsp-code.com/donate.php
4
+ Tags: posts order, post order, post type order, custom post type order, post types order, pages order, admin posts order
5
  Requires at least: 2.8
6
+ Tested up to: 3.2.1
7
+ Stable tag: 1.5.1
8
 
9
  Order Post Types Objects (posts, pages, custom post types) using a Drag and Drop Sortable javascript capability
10
 
11
  == Description ==
12
 
13
+ <strong>Over 42000 downloads in couple months and 100% ratting out of 50 reviews</strong>. A powerfull plugin, Order Posts and Post Types Objects using a Drag and Drop Sortable javascript capability
14
  It allow to reorder the posts for any custom post types you defined, including the default Posts and Pages. Also you can have the admin posts interface sorted per your new sort.
15
  <br />This plugin it's developed by <a target="_blank" href="http://www.nsp-code.com">Nsp-Code</a>
16
 
48
 
49
  == Change Log ==
50
 
51
+ = 1.5.1 =
52
+ - Updates/Fixes
53
+
54
+ = 1.4.6 =
55
  - Get Previous / Next Posts Update
56
 
57
+ = 1.4.3 =
58
  - Small improvments
59
 
60
+ = 1.4.1 =
61
  - Re-Order Menu Item Appearance fix for update versions
62
 
63
  = 1.3.9 =