Version Description
Make sure you get the latest version
Download this release
Release Info
Developer | nsp-code |
Plugin | Category Order and Taxonomy Terms Order |
Version | 1.2.6 |
Comparing to | |
See all releases |
Version 1.2.6
- css/to.css +37 -0
- images/admin-icon-settings.gif +0 -0
- images/menu-icon.gif +0 -0
- images/wpspin_light.gif +0 -0
- include/interface.php +241 -0
- include/options.php +140 -0
- include/terms_walker.php +48 -0
- js/to-javascript.js +135 -0
- lang/to-nl_NL.mo +0 -0
- lang/to-nl_NL.po +130 -0
- lang/to-ro_RO.mo +0 -0
- lang/to-ro_RO.po +125 -0
- lang/to.mo +0 -0
- lang/to.po +125 -0
- readme.txt +66 -0
- screenshot-1.gif +0 -0
- screenshot-2.gif +0 -0
- taxonomy-terms-order.php +179 -0
css/to.css
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
h2.subtitle {font-size: 15px; font-style: italic; font-weight: bold}
|
3 |
+
|
4 |
+
#order-terms img {vertical-align: middle}
|
5 |
+
#order-terms #tto_sortable { list-style-type: none; margin: 20px 0 0; padding: 0; width: 100%; }
|
6 |
+
#order-terms ul {list-style: none;}
|
7 |
+
#order-terms ul.children {margin-left: 25px}
|
8 |
+
.term_type_li .item {border: 1px solid #DDDDDD; border-radius: 6px 6px 6px 6px; cursor: move; margin: 4px 0; padding: 2px 0;line-height: 140%;margin-bottom: 6px;}
|
9 |
+
.term_type_li .item span { background: none repeat scroll 0 0 #F7F7F7; color: #808080; display: block; font-weight: bold; padding: 5px;}
|
10 |
+
.term_type_li .item span.edit {position: absolute; right: 10px; top: 6px; padding: 0px; margin: 0px}
|
11 |
+
#order-terms .placeholder{border-color:#bbb;background-color:#f5f5f5; height:30px; background-image: none; -moz-border-radius: 6px 6px 6px 6px; border: 1px solid #E6E6E6;}
|
12 |
+
.term_type_li ul {margin-top: 6px}
|
13 |
+
#dragHelper li, #dragHelper ul {background: transparent !important;}
|
14 |
+
#dragHelper ul {list-style: none;}
|
15 |
+
|
16 |
+
.wp-list-taxonomy {width: 100%}
|
17 |
+
.wp-list-taxonomy thead tr th{padding-bottom: 7px}
|
18 |
+
.wp-list-taxonomy tr {background-color: #FCFCFC;}
|
19 |
+
.wp-list-taxonomy tbody th.check-column { padding: 9px 0 22px;}
|
20 |
+
.wp-list-taxonomy td { color: #555555;}
|
21 |
+
.wp-list-taxonomy td, .wp-list-taxonomy th { border-bottom-color: #DFDFDF; border-top-color: #FFFFFF;}
|
22 |
+
.wp-list-taxonomy th, .wp-list-taxonomy td { overflow: hidden;}
|
23 |
+
.wp-list-taxonomy td { font-size: 12px; padding: 9px 7px 4px 7px; vertical-align: top;}
|
24 |
+
.wp-list-taxonomy td, .wp-list-taxonomy th { border-style: solid; border-width: 1px 0;}
|
25 |
+
.wp-list-taxonomy * { word-wrap: break-word;}
|
26 |
+
|
27 |
+
#cpt_info_box {padding: 0 10px; border: 1px dashed #21759B; background-color: #F1F1F1}
|
28 |
+
#cpt_info_box p {font-size: 12px}
|
29 |
+
#cpt_info_box #donate_form {float: right; padding: 10px 0 10px 10px}
|
30 |
+
#icon-settings {background-image:url("../images/admin-icon-settings.gif");background-repeat:no-repeat;}
|
31 |
+
#p_right {float: right; width: 170px; }
|
32 |
+
.p_s_item {float: left; padding: 0px 5px; margin-top: 15px; margin-bottom: 5px}
|
33 |
+
.p_s_item.s_gp {padding-top: 2px; margin-left: 10px}
|
34 |
+
|
35 |
+
.clear {clear: both}
|
36 |
+
|
37 |
+
|
images/admin-icon-settings.gif
ADDED
Binary file
|
images/menu-icon.gif
ADDED
Binary file
|
images/wpspin_light.gif
ADDED
Binary file
|
include/interface.php
ADDED
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
function TOPluginInterface()
|
5 |
+
{
|
6 |
+
global $wpdb, $wp_locale;
|
7 |
+
|
8 |
+
$taxonomy = isset($_GET['taxonomy']) ? $_GET['taxonomy'] : '';
|
9 |
+
$post_type = isset($_GET['post_type']) ? $_GET['post_type'] : 'post';
|
10 |
+
|
11 |
+
$post_type_data = get_post_type_object($post_type);
|
12 |
+
|
13 |
+
if (!taxonomy_exists($taxonomy))
|
14 |
+
$taxonomy = '';
|
15 |
+
|
16 |
+
?>
|
17 |
+
<div class="wrap">
|
18 |
+
<div class="icon32" id="icon-edit"><br></div>
|
19 |
+
<h2><?php _e( "Taxonomy Order", 'to' ) ?></h2>
|
20 |
+
|
21 |
+
<div id="cpt_info_box">
|
22 |
+
<div id="p_right">
|
23 |
+
|
24 |
+
<div id="p_socialize">
|
25 |
+
<div class="p_s_item s_gp">
|
26 |
+
<!-- Place this tag in your head or just before your close body tag -->
|
27 |
+
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
|
28 |
+
|
29 |
+
<!-- Place this tag where you want the +1 button to render -->
|
30 |
+
<div class="g-plusone" data-size="small" data-annotation="none" data-href="http://nsp-code.com/"></div>
|
31 |
+
</div>
|
32 |
+
<div class="p_s_item s_t">
|
33 |
+
<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>
|
34 |
+
</div>
|
35 |
+
|
36 |
+
<div class="p_s_item s_f">
|
37 |
+
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.nsp-code.com%2F&send=false&layout=button_count&width=50&show_faces=false&action=like&colorscheme=light&font=arial&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:21px;" allowTransparency="true"></iframe>
|
38 |
+
</div>
|
39 |
+
|
40 |
+
<div class="clear"></div>
|
41 |
+
</div>
|
42 |
+
|
43 |
+
<div id="donate_form">
|
44 |
+
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
|
45 |
+
<input type="hidden" name="cmd" value="_s-xclick">
|
46 |
+
<input type="hidden" name="hosted_button_id" value="CU22TFDKJMLAE">
|
47 |
+
<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!">
|
48 |
+
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
|
49 |
+
</form>
|
50 |
+
</div>
|
51 |
+
</div>
|
52 |
+
<p><?php _e( "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", 'to' ) ?> <br /><strong>http://www.nsp-code.com/</strong>.</p>
|
53 |
+
<h4><?php _e( "Did you know there is available a more advanced version of this plug-in?", 'to' ) ?> <a target="_blank" href="http://www.nsp-code.com/premium-plugins/wordpress-plugins/advanced-taxonomy-terms-order/"><?php _e( "Read more", 'to' ) ?></a></h4>
|
54 |
+
<p><?php _e( "Check our", 'to' ) ?> <a target="_blank" href="http://wordpress.org/extend/plugins/post-types-order/">Post Types Order</a> <?php _e( "plugin which allow to custom sort all posts, pages, custom post types", 'to' ) ?> </p>
|
55 |
+
</div>
|
56 |
+
<div id="ajax-response"></div>
|
57 |
+
|
58 |
+
<noscript>
|
59 |
+
<div class="error message">
|
60 |
+
<p><?php _e( "This plugin can't work without javascript, because it's use drag and drop and AJAX.", 'to' ) ?></p>
|
61 |
+
</div>
|
62 |
+
</noscript>
|
63 |
+
|
64 |
+
<div class="clear"></div>
|
65 |
+
|
66 |
+
<form action="edit.php" method="get" id="to_form">
|
67 |
+
<input type="hidden" name="page" value="to-interface-<?php echo $post_type ?>" />
|
68 |
+
<?php
|
69 |
+
|
70 |
+
if ($post_type != 'post')
|
71 |
+
echo '<input type="hidden" name="post_type" value="'. $post_type .'" />';
|
72 |
+
|
73 |
+
//output all available taxonomies for this post type
|
74 |
+
|
75 |
+
$post_type_taxonomies = get_object_taxonomies($post_type);
|
76 |
+
|
77 |
+
foreach ($post_type_taxonomies as $key => $taxonomy_name)
|
78 |
+
{
|
79 |
+
$taxonomy_info = get_taxonomy($taxonomy_name);
|
80 |
+
if ($taxonomy_info->hierarchical !== TRUE)
|
81 |
+
unset($post_type_taxonomies[$key]);
|
82 |
+
}
|
83 |
+
|
84 |
+
//use the first taxonomy if emtpy taxonomy
|
85 |
+
if ($taxonomy == '' || !taxonomy_exists($taxonomy))
|
86 |
+
{
|
87 |
+
reset($post_type_taxonomies);
|
88 |
+
$taxonomy = current($post_type_taxonomies);
|
89 |
+
}
|
90 |
+
|
91 |
+
if (count($post_type_taxonomies) > 1)
|
92 |
+
{
|
93 |
+
|
94 |
+
?>
|
95 |
+
|
96 |
+
<h2 class="subtitle"><?php echo ucfirst($post_type_data->labels->name) ?> <?php _e( "Taxonomies", 'to' ) ?></h2>
|
97 |
+
<table cellspacing="0" class="wp-list-taxonomy">
|
98 |
+
<thead>
|
99 |
+
<tr>
|
100 |
+
<th style="" class="column-cb check-column" id="cb" scope="col"> </th><th style="" class="" id="author" scope="col"><?php _e( "Taxonomy Title", 'to' ) ?></th><th style="" class="manage-column" id="categories" scope="col"><?php _e( "Total Posts", 'to' ) ?></th> </tr>
|
101 |
+
</thead>
|
102 |
+
|
103 |
+
|
104 |
+
<tbody id="the-list">
|
105 |
+
<?php
|
106 |
+
|
107 |
+
$alternate = FALSE;
|
108 |
+
foreach ($post_type_taxonomies as $post_type_taxonomy)
|
109 |
+
{
|
110 |
+
$taxonomy_info = get_taxonomy($post_type_taxonomy);
|
111 |
+
|
112 |
+
$alternate = $alternate === TRUE ? FALSE :TRUE;
|
113 |
+
|
114 |
+
$taxonomy_terms = get_terms($key);
|
115 |
+
|
116 |
+
?>
|
117 |
+
<tr valign="top" class="<?php if ($alternate === TRUE) {echo 'alternate ';} ?>" id="taxonomy-<?php echo $taxonomy ?>">
|
118 |
+
<th class="check-column" scope="row"><input type="radio" onclick="to_change_taxonomy(this)" value="<?php echo $post_type_taxonomy ?>" <?php if ($post_type_taxonomy == $taxonomy) {echo 'checked="checked"';} ?> name="taxonomy"> </th>
|
119 |
+
<td class="categories column-categories"><b><?php echo $taxonomy_info->label ?></b> (<?php echo $taxonomy_info->labels->singular_name; ?>)</td>
|
120 |
+
<td class="categories column-categories"><?php echo count($taxonomy_terms) ?></td>
|
121 |
+
</tr>
|
122 |
+
|
123 |
+
<?php
|
124 |
+
}
|
125 |
+
?>
|
126 |
+
</tbody>
|
127 |
+
</table>
|
128 |
+
<br /><br />
|
129 |
+
<?php
|
130 |
+
}
|
131 |
+
?>
|
132 |
+
|
133 |
+
<div id="order-terms">
|
134 |
+
|
135 |
+
|
136 |
+
|
137 |
+
<div id="post-body">
|
138 |
+
|
139 |
+
<ul class="sortable" id="tto_sortable">
|
140 |
+
<?php
|
141 |
+
listTerms($taxonomy);
|
142 |
+
?>
|
143 |
+
</ul>
|
144 |
+
|
145 |
+
<div class="clear"></div>
|
146 |
+
</div>
|
147 |
+
|
148 |
+
<div class="alignleft actions">
|
149 |
+
<p class="submit">
|
150 |
+
<a href="javascript:;" class="save-order button-primary"><?php _e( "Update", 'to' ) ?></a>
|
151 |
+
</p>
|
152 |
+
</div>
|
153 |
+
|
154 |
+
</div>
|
155 |
+
|
156 |
+
</form>
|
157 |
+
|
158 |
+
<script type="text/javascript">
|
159 |
+
jQuery(document).ready(function() {
|
160 |
+
|
161 |
+
var NestedSortableSerializedData;
|
162 |
+
jQuery("ul.sortable").sortable({
|
163 |
+
'tolerance':'intersect',
|
164 |
+
'cursor':'pointer',
|
165 |
+
'items':'> li',
|
166 |
+
'axi': 'y',
|
167 |
+
'placeholder':'placeholder',
|
168 |
+
'nested': 'ul'
|
169 |
+
});
|
170 |
+
});
|
171 |
+
|
172 |
+
|
173 |
+
jQuery(".save-order").bind( "click", function() {
|
174 |
+
|
175 |
+
var mySortable = new Array();
|
176 |
+
jQuery(".sortable").each( function(){
|
177 |
+
|
178 |
+
var serialized = jQuery(this).sortable("serialize");
|
179 |
+
|
180 |
+
var parent_tag = jQuery(this).parent().get(0).tagName;
|
181 |
+
parent_tag = parent_tag.toLowerCase()
|
182 |
+
if (parent_tag == 'li')
|
183 |
+
{
|
184 |
+
//
|
185 |
+
var tag_id = jQuery(this).parent().attr('id');
|
186 |
+
mySortable[tag_id] = serialized;
|
187 |
+
}
|
188 |
+
else
|
189 |
+
{
|
190 |
+
//
|
191 |
+
mySortable[0] = serialized;
|
192 |
+
}
|
193 |
+
});
|
194 |
+
|
195 |
+
//serialize the array
|
196 |
+
var serialize_data = serialize(mySortable);
|
197 |
+
|
198 |
+
jQuery.post( ajaxurl, { action:'update-taxonomy-order', order: serialize_data, taxonomy : '<?php echo $taxonomy ?>' }, function() {
|
199 |
+
jQuery("#ajax-response").html('<div class="message updated fade"><p><?php _e( "Items Order Updates", 'to' ) ?></p></div>');
|
200 |
+
jQuery("#ajax-response div").delay(3000).hide("slow");
|
201 |
+
});
|
202 |
+
});
|
203 |
+
</script>
|
204 |
+
|
205 |
+
</div>
|
206 |
+
<?php
|
207 |
+
|
208 |
+
|
209 |
+
}
|
210 |
+
|
211 |
+
|
212 |
+
function listTerms($taxonomy)
|
213 |
+
{
|
214 |
+
|
215 |
+
// Query pages.
|
216 |
+
$args = array(
|
217 |
+
'orderby' => 'menu_order',
|
218 |
+
'depth' => 0,
|
219 |
+
'child_of' => 0,
|
220 |
+
'hide_empty' => 0
|
221 |
+
);
|
222 |
+
$taxonomy_terms = get_terms($taxonomy, $args);
|
223 |
+
|
224 |
+
$output = '';
|
225 |
+
if (count($taxonomy_terms) > 0)
|
226 |
+
{
|
227 |
+
$output = TOwalkTree($taxonomy_terms, $args['depth'], $args);
|
228 |
+
}
|
229 |
+
|
230 |
+
echo $output;
|
231 |
+
|
232 |
+
}
|
233 |
+
|
234 |
+
function TOwalkTree($taxonomy_terms, $depth, $r)
|
235 |
+
{
|
236 |
+
$walker = new TO_Terms_Walker;
|
237 |
+
$args = array($taxonomy_terms, $depth, $r);
|
238 |
+
return call_user_func_array(array(&$walker, 'walk'), $args);
|
239 |
+
}
|
240 |
+
|
241 |
+
?>
|
include/options.php
ADDED
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
function to_plugin_options()
|
5 |
+
{
|
6 |
+
$options = get_option('tto_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>' . _e('Settings Saved', 'to') . '</p></div>';
|
17 |
+
|
18 |
+
update_option('tto_options', $options);
|
19 |
+
}
|
20 |
+
|
21 |
+
?>
|
22 |
+
<div class="wrap">
|
23 |
+
<div id="icon-settings" class="icon32"></div>
|
24 |
+
<h2><?php _e( "General Settings", 'to' ) ?></h2>
|
25 |
+
|
26 |
+
<div id="cpt_info_box">
|
27 |
+
|
28 |
+
<div id="p_right">
|
29 |
+
|
30 |
+
<div id="p_socialize">
|
31 |
+
<div class="p_s_item s_gp">
|
32 |
+
<!-- Place this tag in your head or just before your close body tag -->
|
33 |
+
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
|
34 |
+
|
35 |
+
<!-- Place this tag where you want the +1 button to render -->
|
36 |
+
<div class="g-plusone" data-size="small" data-annotation="none" data-href="http://nsp-code.com/"></div>
|
37 |
+
</div>
|
38 |
+
<div class="p_s_item s_t">
|
39 |
+
<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>
|
40 |
+
</div>
|
41 |
+
|
42 |
+
<div class="p_s_item s_f">
|
43 |
+
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.nsp-code.com%2F&send=false&layout=button_count&width=50&show_faces=false&action=like&colorscheme=light&font=arial&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:21px;" allowTransparency="true"></iframe>
|
44 |
+
</div>
|
45 |
+
<div class="clear"></div>
|
46 |
+
</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 |
+
<p><?php _e( "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", 'to' ) ?> <br /><strong>http://www.nsp-code.com/</strong>.</p>
|
58 |
+
<h4><?php _e( "Did you know there is available a more advanced version of this plug-in?", 'to' ) ?> <a target="_blank" href="http://www.nsp-code.com/premium-plugins/wordpress-plugins/advanced-taxonomy-terms-order/"><?php _e( "Read more", 'to' ) ?></a></h4>
|
59 |
+
<p><?php _e( "Check our", 'to' ) ?> <a target="_blank" href="http://wordpress.org/extend/plugins/post-types-order/">Post Types Order</a> <?php _e( "plugin which allow to custom sort all posts, pages, custom post types", 'to' ) ?> </p>
|
60 |
+
</div>
|
61 |
+
|
62 |
+
<form id="form_data" name="form" method="post">
|
63 |
+
<br />
|
64 |
+
<h2 class="subtitle"><?php _e( "General", 'to' ) ?></h2>
|
65 |
+
<table class="form-table">
|
66 |
+
<tbody>
|
67 |
+
|
68 |
+
<tr valign="top">
|
69 |
+
<th scope="row" style="text-align: right;"><label><?php _e( "Minimum Level to use this plugin", 'to' ) ?></label></th>
|
70 |
+
<td>
|
71 |
+
<select id="role" name="level">
|
72 |
+
<option value="0" <?php if ($options['level'] == "0") echo 'selected="selected"'?>><?php _e('Subscriber', 'tto') ?></option>
|
73 |
+
<option value="1" <?php if ($options['level'] == "1") echo 'selected="selected"'?>><?php _e('Contributor', 'tto') ?></option>
|
74 |
+
<option value="2" <?php if ($options['level'] == "2") echo 'selected="selected"'?>><?php _e('Author', 'tto') ?></option>
|
75 |
+
<option value="5" <?php if ($options['level'] == "5") echo 'selected="selected"'?>><?php _e('Editor', 'tto') ?></option>
|
76 |
+
<option value="8" <?php if ($options['level'] == "8") echo 'selected="selected"'?>><?php _e('Administrator', 'tto') ?></option>
|
77 |
+
</select>
|
78 |
+
</td>
|
79 |
+
</tr>
|
80 |
+
|
81 |
+
|
82 |
+
<tr valign="top">
|
83 |
+
<th scope="row" style="text-align: right;"><label><?php _e( "Auto Sort", 'to' ) ?></label></th>
|
84 |
+
<td>
|
85 |
+
<select id="role" name="autosort">
|
86 |
+
<option value="0" <?php if ($options['autosort'] == "0") echo 'selected="selected"'?>><?php _e('OFF', 'tto') ?></option>
|
87 |
+
<option value="1" <?php if ($options['autosort'] == "1") echo 'selected="selected"'?>><?php _e('ON', 'tto') ?></option>
|
88 |
+
</select> *(<?php _e( "global setting", 'to' ) ?>)
|
89 |
+
</td>
|
90 |
+
</tr>
|
91 |
+
|
92 |
+
<tr valign="top">
|
93 |
+
<th scope="row" style="text-align: right;"><label><?php _e( "Admin Sort", 'to' ) ?></label></th>
|
94 |
+
<td>
|
95 |
+
<label for="users_can_register">
|
96 |
+
<input type="checkbox" <?php if ($options['adminsort'] == "1") {echo ' checked="checked"';} ?> value="1" name="adminsort">
|
97 |
+
<?php _e("This will change the order of terms within the admin interface", 'to') ?>.</label>
|
98 |
+
</td>
|
99 |
+
</tr>
|
100 |
+
|
101 |
+
<tr valign="top">
|
102 |
+
<th scope="row" style="text-align: right;"></th>
|
103 |
+
<td>
|
104 |
+
<br /><br /><br />
|
105 |
+
<p><b><u><?php _e( "Autosort OFF", 'to' ) ?></u></b></p>
|
106 |
+
<p class="example"><?php _e('No query will be changed, the terms will appear in the original order. To retrieve the terms in the required order you must use the menu_order on the orderby parameter', 'to') ?>:</p>
|
107 |
+
<pre class="example">
|
108 |
+
$argv = array(
|
109 |
+
'orderby' => 'menu_order',
|
110 |
+
'hide_empty' => false
|
111 |
+
);
|
112 |
+
get_terms('category', $argv);
|
113 |
+
</pre>
|
114 |
+
<p><?php _e( "See more info on the get_terms usage", 'to' ) ?> <a href="http://codex.wordpress.org/Function_Reference/get_terms" target="_blank"><?php _e( "here", 'to' ) ?></a></p>
|
115 |
+
|
116 |
+
<p><b><u><?php _e( "Autosort ON", 'to' ) ?></u></b></p>
|
117 |
+
<p class="example"><?php _e('The query will be updated, all terms will appear in the order you manually defined. This is recommended if you don\'t want to change any theme code to apply the terms order', 'to') ?></p>
|
118 |
+
|
119 |
+
</td>
|
120 |
+
</tr>
|
121 |
+
|
122 |
+
</tbody>
|
123 |
+
</table>
|
124 |
+
|
125 |
+
|
126 |
+
<p class="submit">
|
127 |
+
<input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Settings', 'to') ?>">
|
128 |
+
</p>
|
129 |
+
|
130 |
+
<input type="hidden" name="form_submit" value="true" />
|
131 |
+
|
132 |
+
</form>
|
133 |
+
|
134 |
+
<?php
|
135 |
+
echo '</div>';
|
136 |
+
|
137 |
+
|
138 |
+
}
|
139 |
+
|
140 |
+
?>
|
include/terms_walker.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
class TO_Terms_Walker extends Walker
|
5 |
+
{
|
6 |
+
|
7 |
+
var $db_fields = array ('parent' => 'parent', 'id' => 'term_id');
|
8 |
+
|
9 |
+
|
10 |
+
function start_lvl(&$output, $depth, $args)
|
11 |
+
{
|
12 |
+
extract($args, EXTR_SKIP);
|
13 |
+
|
14 |
+
$indent = str_repeat("\t", $depth);
|
15 |
+
$output .= "\n$indent<ul class='children sortable'>\n";
|
16 |
+
}
|
17 |
+
|
18 |
+
|
19 |
+
function end_lvl(&$output, $depth, $args)
|
20 |
+
{
|
21 |
+
extract($args, EXTR_SKIP);
|
22 |
+
|
23 |
+
$indent = str_repeat("\t", $depth);
|
24 |
+
$output .= "$indent</ul>\n";
|
25 |
+
}
|
26 |
+
|
27 |
+
|
28 |
+
function start_el(&$output, $term, $depth, $args)
|
29 |
+
{
|
30 |
+
if ( $depth )
|
31 |
+
$indent = str_repeat("\t", $depth);
|
32 |
+
else
|
33 |
+
$indent = '';
|
34 |
+
|
35 |
+
//extract($args, EXTR_SKIP);
|
36 |
+
$taxonomy = get_taxonomy($term->term_taxonomy_id);
|
37 |
+
$output .= $indent . '<li class="term_type_li" id="item_'.$term->term_id.'"><div class="item"><span>'.apply_filters( 'the_title', $term->name, $term->term_id ).' </span></div>';
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
function end_el(&$output, $post_type, $depth)
|
42 |
+
{
|
43 |
+
$output .= "</li>\n";
|
44 |
+
}
|
45 |
+
|
46 |
+
}
|
47 |
+
|
48 |
+
?>
|
js/to-javascript.js
ADDED
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
function to_change_taxonomy(element)
|
3 |
+
{
|
4 |
+
//select the default category (0)
|
5 |
+
jQuery('#to_form #cat').val(jQuery("#to_form #cat option:first").val());
|
6 |
+
jQuery('#to_form').submit();
|
7 |
+
}
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
+
function serialize(mixed_value)
|
12 |
+
{
|
13 |
+
// http://kevin.vanzonneveld.net
|
14 |
+
// + original by: Arpad Ray (mailto:arpad@php.net)
|
15 |
+
// + improved by: Dino
|
16 |
+
// + bugfixed by: Andrej Pavlovic
|
17 |
+
// + bugfixed by: Garagoth
|
18 |
+
// + input by: DtTvB (http://dt.in.th/2008-09-16.string-length-in-bytes.html)
|
19 |
+
// + bugfixed by: Russell Walker (http://www.nbill.co.uk/)
|
20 |
+
// + bugfixed by: Jamie Beck (http://www.terabit.ca/)
|
21 |
+
// + input by: Martin (http://www.erlenwiese.de/)
|
22 |
+
// + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net/)
|
23 |
+
// + improved by: Le Torbi (http://www.letorbi.de/)
|
24 |
+
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net/)
|
25 |
+
// + bugfixed by: Ben (http://benblume.co.uk/)
|
26 |
+
// - depends on: utf8_encode
|
27 |
+
// % note: We feel the main purpose of this function should be to ease the transport of data between php & js
|
28 |
+
// % note: Aiming for PHP-compatibility, we have to translate objects to arrays
|
29 |
+
// * example 1: serialize(['Kevin', 'van', 'Zonneveld']);
|
30 |
+
// * returns 1: 'a:3:{i:0;s:5:"Kevin";i:1;s:3:"van";i:2;s:9:"Zonneveld";}'
|
31 |
+
// * example 2: serialize({firstName: 'Kevin', midName: 'van', surName: 'Zonneveld'});
|
32 |
+
// * returns 2: 'a:3:{s:9:"firstName";s:5:"Kevin";s:7:"midName";s:3:"van";s:7:"surName";s:9:"Zonneveld";}'
|
33 |
+
var _utf8Size = function (str) {
|
34 |
+
var size = 0,
|
35 |
+
i = 0,
|
36 |
+
l = str.length,
|
37 |
+
code = '';
|
38 |
+
for (i = 0; i < l; i++) {
|
39 |
+
code = str.charCodeAt(i);
|
40 |
+
if (code < 0x0080) {
|
41 |
+
size += 1;
|
42 |
+
} else if (code < 0x0800) {
|
43 |
+
size += 2;
|
44 |
+
} else {
|
45 |
+
size += 3;
|
46 |
+
}
|
47 |
+
}
|
48 |
+
return size;
|
49 |
+
};
|
50 |
+
var _getType = function (inp) {
|
51 |
+
var type = typeof inp,
|
52 |
+
match;
|
53 |
+
var key;
|
54 |
+
|
55 |
+
if (type === 'object' && !inp) {
|
56 |
+
return 'null';
|
57 |
+
}
|
58 |
+
if (type === "object") {
|
59 |
+
if (!inp.constructor) {
|
60 |
+
return 'object';
|
61 |
+
}
|
62 |
+
var cons = inp.constructor.toString();
|
63 |
+
match = cons.match(/(\w+)\(/);
|
64 |
+
if (match) {
|
65 |
+
cons = match[1].toLowerCase();
|
66 |
+
}
|
67 |
+
var types = ["boolean", "number", "string", "array"];
|
68 |
+
for (key in types) {
|
69 |
+
if (cons == types[key]) {
|
70 |
+
type = types[key];
|
71 |
+
break;
|
72 |
+
}
|
73 |
+
}
|
74 |
+
}
|
75 |
+
return type;
|
76 |
+
};
|
77 |
+
var type = _getType(mixed_value);
|
78 |
+
var val, ktype = '';
|
79 |
+
|
80 |
+
switch (type) {
|
81 |
+
case "function":
|
82 |
+
val = "";
|
83 |
+
break;
|
84 |
+
case "boolean":
|
85 |
+
val = "b:" + (mixed_value ? "1" : "0");
|
86 |
+
break;
|
87 |
+
case "number":
|
88 |
+
val = (Math.round(mixed_value) == mixed_value ? "i" : "d") + ":" + mixed_value;
|
89 |
+
break;
|
90 |
+
case "string":
|
91 |
+
val = "s:" + _utf8Size(mixed_value) + ":\"" + mixed_value + "\"";
|
92 |
+
break;
|
93 |
+
case "array":
|
94 |
+
case "object":
|
95 |
+
val = "a";
|
96 |
+
/*
|
97 |
+
if (type == "object") {
|
98 |
+
var objname = mixed_value.constructor.toString().match(/(\w+)\(\)/);
|
99 |
+
if (objname == undefined) {
|
100 |
+
return;
|
101 |
+
}
|
102 |
+
objname[1] = this.serialize(objname[1]);
|
103 |
+
val = "O" + objname[1].substring(1, objname[1].length - 1);
|
104 |
+
}
|
105 |
+
*/
|
106 |
+
var count = 0;
|
107 |
+
var vals = "";
|
108 |
+
var okey;
|
109 |
+
var key;
|
110 |
+
for (key in mixed_value) {
|
111 |
+
if (mixed_value.hasOwnProperty(key)) {
|
112 |
+
ktype = _getType(mixed_value[key]);
|
113 |
+
if (ktype === "function") {
|
114 |
+
continue;
|
115 |
+
}
|
116 |
+
|
117 |
+
okey = (key.match(/^[0-9]+$/) ? parseInt(key, 10) : key);
|
118 |
+
vals += this.serialize(okey) + this.serialize(mixed_value[key]);
|
119 |
+
count++;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
val += ":" + count + ":{" + vals + "}";
|
123 |
+
break;
|
124 |
+
case "undefined":
|
125 |
+
// Fall-through
|
126 |
+
default:
|
127 |
+
// if the JS object has a property which contains a null value, the string cannot be unserialized by PHP
|
128 |
+
val = "N";
|
129 |
+
break;
|
130 |
+
}
|
131 |
+
if (type !== "object" && type !== "array") {
|
132 |
+
val += ";";
|
133 |
+
}
|
134 |
+
return val;
|
135 |
+
}
|
lang/to-nl_NL.mo
ADDED
Binary file
|
lang/to-nl_NL.po
ADDED
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: Category Order and Taxonomy Terms Order\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2011-12-06 11:55+0200\n"
|
6 |
+
"PO-Revision-Date: 2011-12-06 11:58+0200\n"
|
7 |
+
"Last-Translator: nsp-code <electronice_delphi@yahoo.com>\n"
|
8 |
+
"Language-Team: nsp-code <electronice_delphi@yahoo.com>\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: _;gettext;gettext_noop;__\n"
|
13 |
+
"X-Poedit-Basepath: c:\\2\\\n"
|
14 |
+
"X-Poedit-Language: Netherland\n"
|
15 |
+
"X-Poedit-SearchPath-0: .\n"
|
16 |
+
|
17 |
+
#: include/interface.php:19
|
18 |
+
msgid "Taxonomy Order"
|
19 |
+
msgstr "Structuur volgorde"
|
20 |
+
|
21 |
+
#: include/interface.php:52
|
22 |
+
#: include/options.php:57
|
23 |
+
msgid "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"
|
24 |
+
msgstr "Vind je dit een nuttige plugin? Ondersteun ons werk met een donatie of schrijf een artikel over deze plugin op je site met een link naar onze site."
|
25 |
+
|
26 |
+
#: include/interface.php:53
|
27 |
+
#: include/options.php:58
|
28 |
+
msgid "Did you know there is available a more advanced version of this plug-in?"
|
29 |
+
msgstr "Wist je dat er een meer uitgebreide versie van deze plugin beschikbaar is?"
|
30 |
+
|
31 |
+
#: include/interface.php:53
|
32 |
+
#: include/options.php:58
|
33 |
+
msgid "Read more"
|
34 |
+
msgstr "Meer lezen"
|
35 |
+
|
36 |
+
#: include/interface.php:54
|
37 |
+
#: include/options.php:59
|
38 |
+
msgid "Check our"
|
39 |
+
msgstr "Bezoek onze"
|
40 |
+
|
41 |
+
#: include/interface.php:54
|
42 |
+
#: include/options.php:59
|
43 |
+
msgid "plugin which allow to custom sort all posts, pages, custom post types"
|
44 |
+
msgstr "een plugin die je toestaat om alle berichten, pagina's en aangepaste berichttypen te sorteren"
|
45 |
+
|
46 |
+
#: include/interface.php:60
|
47 |
+
msgid "This plugin can't work without javascript, because it's use drag and drop and AJAX."
|
48 |
+
msgstr "Deze plugin kan niet werken zonder javascript, om dat het AJAX klik-en-sleep gebruikt."
|
49 |
+
|
50 |
+
#: include/interface.php:96
|
51 |
+
msgid "Taxonomies"
|
52 |
+
msgstr "Structuren"
|
53 |
+
|
54 |
+
#: include/interface.php:100
|
55 |
+
msgid "Taxonomy Title"
|
56 |
+
msgstr "Structuur Titel"
|
57 |
+
|
58 |
+
#: include/interface.php:100
|
59 |
+
msgid "Total Posts"
|
60 |
+
msgstr "Totale berichten"
|
61 |
+
|
62 |
+
#: include/interface.php:150
|
63 |
+
msgid "Update"
|
64 |
+
msgstr "Bijwerken"
|
65 |
+
|
66 |
+
#: include/interface.php:199
|
67 |
+
msgid "Items Order Updates"
|
68 |
+
msgstr "Bestel artikelen Updates"
|
69 |
+
|
70 |
+
#: include/options.php:16
|
71 |
+
msgid "Settings Saved"
|
72 |
+
msgstr "Instellingen bijgewerkt"
|
73 |
+
|
74 |
+
#: include/options.php:24
|
75 |
+
msgid "General Settings"
|
76 |
+
msgstr "Algemene instellingen"
|
77 |
+
|
78 |
+
#: include/options.php:64
|
79 |
+
msgid "General"
|
80 |
+
msgstr "Algemeen"
|
81 |
+
|
82 |
+
#: include/options.php:69
|
83 |
+
msgid "Minimum Level to use this plugin"
|
84 |
+
msgstr "Minimale niveau om deze plugin te gebruiken"
|
85 |
+
|
86 |
+
#: include/options.php:83
|
87 |
+
msgid "Auto Sort"
|
88 |
+
msgstr "Automatisch sorteren"
|
89 |
+
|
90 |
+
#: include/options.php:88
|
91 |
+
#, fuzzy
|
92 |
+
msgid "global setting"
|
93 |
+
msgstr "Algemene instellingen"
|
94 |
+
|
95 |
+
#: include/options.php:93
|
96 |
+
msgid "Admin Sort"
|
97 |
+
msgstr "Admin sorteren"
|
98 |
+
|
99 |
+
#: include/options.php:97
|
100 |
+
msgid "This will change the order of terms within the admin interface"
|
101 |
+
msgstr "Dit zal de volgorde wijzigen in de admin interface"
|
102 |
+
|
103 |
+
#: include/options.php:105
|
104 |
+
msgid "Autosort OFF"
|
105 |
+
msgstr ""
|
106 |
+
|
107 |
+
#: include/options.php:106
|
108 |
+
msgid "No query will be changed, the terms will appear in the original order. To retrieve the terms in the required order you must use the menu_order on the orderby parameter"
|
109 |
+
msgstr "Er word geen query gewijzigd, de termen zullen verschijnen in de originele volgorde. Om de terms in de verplichte volgorde op te halen moet de de menu_order op de orderby parameter opgehaald worden"
|
110 |
+
|
111 |
+
#: include/options.php:114
|
112 |
+
msgid "See more info on the get_terms usage"
|
113 |
+
msgstr "Meer informatie over het get_terms gebruik"
|
114 |
+
|
115 |
+
#: include/options.php:114
|
116 |
+
msgid "here"
|
117 |
+
msgstr "hier"
|
118 |
+
|
119 |
+
#: include/options.php:116
|
120 |
+
msgid "Autosort ON"
|
121 |
+
msgstr ""
|
122 |
+
|
123 |
+
#: include/options.php:117
|
124 |
+
msgid "The query will be updated, all terms will appear in the order you manually defined. This is recommended if you don't want to change any theme code to apply the terms order"
|
125 |
+
msgstr "De query wordt bijgewerkt, alle termen verschijnen in de volgorde die je handmatig instelt. Dit wordt aanbevolen als je de themacode voor de volgorde niet wilt wijzigen"
|
126 |
+
|
127 |
+
#: include/options.php:127
|
128 |
+
msgid "Save Settings"
|
129 |
+
msgstr "Instellingen opslaan"
|
130 |
+
|
lang/to-ro_RO.mo
ADDED
Binary file
|
lang/to-ro_RO.po
ADDED
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: Category Order and Taxonomy Terms Order\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2011-12-06 11:38+0200\n"
|
6 |
+
"PO-Revision-Date: 2011-12-06 11:46+0200\n"
|
7 |
+
"Last-Translator: nsp-code <electronice_delphi@yahoo.com>\n"
|
8 |
+
"Language-Team: nsp-code <electronice_delphi@yahoo.com>\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: _;gettext;gettext_noop;__\n"
|
13 |
+
"X-Poedit-Basepath: c:\\2\\\n"
|
14 |
+
"X-Poedit-Language: english\n"
|
15 |
+
"X-Poedit-SearchPath-0: .\n"
|
16 |
+
|
17 |
+
#: include/interface.php:19
|
18 |
+
msgid "Taxonomy Order"
|
19 |
+
msgstr "Taxonomy Order"
|
20 |
+
|
21 |
+
#: include/interface.php:52
|
22 |
+
#: include/options.php:57
|
23 |
+
msgid "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"
|
24 |
+
msgstr "Ai gasit util acest plug-in? Vă rugăm să sprijine munca noastră, cu o donaţie sau scrieti un articol despre acest plugin în blog cu o legătură catre site-ul nostru"
|
25 |
+
|
26 |
+
#: include/interface.php:53
|
27 |
+
#: include/options.php:58
|
28 |
+
msgid "Did you know there is available a more advanced version of this plug-in?"
|
29 |
+
msgstr "Ştiaţi că există disponibile o versiune mai avansată a acestui plug-in?"
|
30 |
+
|
31 |
+
#: include/interface.php:53
|
32 |
+
#: include/options.php:58
|
33 |
+
msgid "Read more"
|
34 |
+
msgstr "Citeste mai mult"
|
35 |
+
|
36 |
+
#: include/interface.php:54
|
37 |
+
#: include/options.php:59
|
38 |
+
msgid "Check our"
|
39 |
+
msgstr ""
|
40 |
+
|
41 |
+
#: include/interface.php:54
|
42 |
+
#: include/options.php:59
|
43 |
+
msgid "plugin which allow to custom sort all posts, pages, custom post types"
|
44 |
+
msgstr "plugin care permit să sortare particularizată toate posturile, pagini, tipuri personalizate mesaj"
|
45 |
+
|
46 |
+
#: include/interface.php:60
|
47 |
+
msgid "This plugin can't work without javascript, because it's use drag and drop and AJAX."
|
48 |
+
msgstr "Acest plugin nu poate funcţiona fără javascript, pentru ca este trageţi şi de folosit picătură şi AJAX."
|
49 |
+
|
50 |
+
#: include/interface.php:96
|
51 |
+
msgid "Taxonomies"
|
52 |
+
msgstr ""
|
53 |
+
|
54 |
+
#: include/interface.php:100
|
55 |
+
msgid "Taxonomy Title"
|
56 |
+
msgstr "Titlul Taxonomiei"
|
57 |
+
|
58 |
+
#: include/interface.php:100
|
59 |
+
msgid "Total Posts"
|
60 |
+
msgstr ""
|
61 |
+
|
62 |
+
#: include/interface.php:150
|
63 |
+
msgid "Update"
|
64 |
+
msgstr ""
|
65 |
+
|
66 |
+
#: include/interface.php:199
|
67 |
+
msgid "Items Order Updates"
|
68 |
+
msgstr "Ordinea elementelor salvata"
|
69 |
+
|
70 |
+
#: include/options.php:16
|
71 |
+
msgid "Settings Saved"
|
72 |
+
msgstr "Setari salvate"
|
73 |
+
|
74 |
+
#: include/options.php:24
|
75 |
+
msgid "General Settings"
|
76 |
+
msgstr "Setari generale"
|
77 |
+
|
78 |
+
#: include/options.php:64
|
79 |
+
msgid "General"
|
80 |
+
msgstr ""
|
81 |
+
|
82 |
+
#: include/options.php:69
|
83 |
+
msgid "Minimum Level to use this plugin"
|
84 |
+
msgstr "Nivel minim pentru a utiliza acest plugin"
|
85 |
+
|
86 |
+
#: include/options.php:83
|
87 |
+
msgid "Auto Sort"
|
88 |
+
msgstr ""
|
89 |
+
|
90 |
+
#: include/options.php:93
|
91 |
+
msgid "Admin Sort"
|
92 |
+
msgstr ""
|
93 |
+
|
94 |
+
#: include/options.php:97
|
95 |
+
msgid "This will change the order of terms within the admin interface"
|
96 |
+
msgstr "Acest lucru se va schimba ordinea termenilor în cadrul interfata de administrare"
|
97 |
+
|
98 |
+
#: include/options.php:105
|
99 |
+
msgid "Autosort OFF"
|
100 |
+
msgstr ""
|
101 |
+
|
102 |
+
#: include/options.php:106
|
103 |
+
msgid "No query will be changed, the terms will appear in the original order. To retrieve the terms in the required order you must use the menu_order on the orderby parameter"
|
104 |
+
msgstr "Nr interogarea va fi schimbat, ceea ce va apărea în ordinea iniţială. Pentru a prelua termenii în ordinea cerută trebuie să utilizaţi menu_order pe parametrul orderby"
|
105 |
+
|
106 |
+
#: include/options.php:114
|
107 |
+
msgid "See more info on the get_terms usage"
|
108 |
+
msgstr "A se vedea mai multe informaţii despre utilizarea get_terms"
|
109 |
+
|
110 |
+
#: include/options.php:114
|
111 |
+
msgid "here"
|
112 |
+
msgstr "aici"
|
113 |
+
|
114 |
+
#: include/options.php:116
|
115 |
+
msgid "Autosort ON"
|
116 |
+
msgstr ""
|
117 |
+
|
118 |
+
#: include/options.php:117
|
119 |
+
msgid "The query will be updated, all terms will appear in the order you manually defined. This is recommended if you don't want to change any theme code to apply the terms order"
|
120 |
+
msgstr "Interogarea va fi actualizat, toţi termenii vor apărea în ordinea în care manual definit. Acest lucru este recomandat dacă nu doriţi să modificaţi codul din temă pentru a aplica ordinul de termeni"
|
121 |
+
|
122 |
+
#: include/options.php:127
|
123 |
+
msgid "Save Settings"
|
124 |
+
msgstr "Salveaza Setarile"
|
125 |
+
|
lang/to.mo
ADDED
Binary file
|
lang/to.po
ADDED
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: Category Order and Taxonomy Terms Order\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2011-12-06 11:37+0200\n"
|
6 |
+
"PO-Revision-Date: 2011-12-06 11:38+0200\n"
|
7 |
+
"Last-Translator: nsp-code <electronice_delphi@yahoo.com>\n"
|
8 |
+
"Language-Team: nsp-code <electronice_delphi@yahoo.com>\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: _;gettext;gettext_noop;__\n"
|
13 |
+
"X-Poedit-Basepath: c:\\2\\\n"
|
14 |
+
"X-Poedit-Language: english\n"
|
15 |
+
"X-Poedit-SearchPath-0: .\n"
|
16 |
+
|
17 |
+
#: include/interface.php:19
|
18 |
+
msgid "Taxonomy Order"
|
19 |
+
msgstr "Taxonomy Order"
|
20 |
+
|
21 |
+
#: include/interface.php:52
|
22 |
+
#: include/options.php:57
|
23 |
+
msgid "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"
|
24 |
+
msgstr ""
|
25 |
+
|
26 |
+
#: include/interface.php:53
|
27 |
+
#: include/options.php:58
|
28 |
+
msgid "Did you know there is available a more advanced version of this plug-in?"
|
29 |
+
msgstr ""
|
30 |
+
|
31 |
+
#: include/interface.php:53
|
32 |
+
#: include/options.php:58
|
33 |
+
msgid "Read more"
|
34 |
+
msgstr ""
|
35 |
+
|
36 |
+
#: include/interface.php:54
|
37 |
+
#: include/options.php:59
|
38 |
+
msgid "Check our"
|
39 |
+
msgstr ""
|
40 |
+
|
41 |
+
#: include/interface.php:54
|
42 |
+
#: include/options.php:59
|
43 |
+
msgid "plugin which allow to custom sort all posts, pages, custom post types"
|
44 |
+
msgstr ""
|
45 |
+
|
46 |
+
#: include/interface.php:60
|
47 |
+
msgid "This plugin can't work without javascript, because it's use drag and drop and AJAX."
|
48 |
+
msgstr ""
|
49 |
+
|
50 |
+
#: include/interface.php:96
|
51 |
+
msgid "Taxonomies"
|
52 |
+
msgstr ""
|
53 |
+
|
54 |
+
#: include/interface.php:100
|
55 |
+
msgid "Taxonomy Title"
|
56 |
+
msgstr ""
|
57 |
+
|
58 |
+
#: include/interface.php:100
|
59 |
+
msgid "Total Posts"
|
60 |
+
msgstr ""
|
61 |
+
|
62 |
+
#: include/interface.php:150
|
63 |
+
msgid "Update"
|
64 |
+
msgstr ""
|
65 |
+
|
66 |
+
#: include/interface.php:199
|
67 |
+
msgid "Items Order Updates"
|
68 |
+
msgstr ""
|
69 |
+
|
70 |
+
#: include/options.php:16
|
71 |
+
msgid "Settings Saved"
|
72 |
+
msgstr ""
|
73 |
+
|
74 |
+
#: include/options.php:24
|
75 |
+
msgid "General Settings"
|
76 |
+
msgstr ""
|
77 |
+
|
78 |
+
#: include/options.php:64
|
79 |
+
msgid "General"
|
80 |
+
msgstr ""
|
81 |
+
|
82 |
+
#: include/options.php:69
|
83 |
+
msgid "Minimum Level to use this plugin"
|
84 |
+
msgstr ""
|
85 |
+
|
86 |
+
#: include/options.php:83
|
87 |
+
msgid "Auto Sort"
|
88 |
+
msgstr ""
|
89 |
+
|
90 |
+
#: include/options.php:93
|
91 |
+
msgid "Admin Sort"
|
92 |
+
msgstr ""
|
93 |
+
|
94 |
+
#: include/options.php:97
|
95 |
+
msgid "This will change the order of terms within the admin interface"
|
96 |
+
msgstr ""
|
97 |
+
|
98 |
+
#: include/options.php:105
|
99 |
+
msgid "Autosort OFF"
|
100 |
+
msgstr ""
|
101 |
+
|
102 |
+
#: include/options.php:106
|
103 |
+
msgid "No query will be changed, the terms will appear in the original order. To retrieve the terms in the required order you must use the menu_order on the orderby parameter"
|
104 |
+
msgstr ""
|
105 |
+
|
106 |
+
#: include/options.php:114
|
107 |
+
msgid "See more info on the get_terms usage"
|
108 |
+
msgstr ""
|
109 |
+
|
110 |
+
#: include/options.php:114
|
111 |
+
msgid "here"
|
112 |
+
msgstr ""
|
113 |
+
|
114 |
+
#: include/options.php:116
|
115 |
+
msgid "Autosort ON"
|
116 |
+
msgstr ""
|
117 |
+
|
118 |
+
#: include/options.php:117
|
119 |
+
msgid "The query will be updated, all terms will appear in the order you manually defined. This is recommended if you don't want to change any theme code to apply the terms order"
|
120 |
+
msgstr ""
|
121 |
+
|
122 |
+
#: include/options.php:127
|
123 |
+
msgid "Save Settings"
|
124 |
+
msgstr ""
|
125 |
+
|
readme.txt
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Category Order and Taxonomy Terms Order ===
|
2 |
+
Contributors: Nsp Code
|
3 |
+
Donate link: http://www.nsp-code.com/donate.php
|
4 |
+
Tags: category order,terms order, taxonomy order, admin order
|
5 |
+
Requires at least: 2.8
|
6 |
+
Tested up to: 3.3
|
7 |
+
Stable tag: 1.2.6
|
8 |
+
|
9 |
+
Order Categories and all custom taxonomies terms and child terms using a Drag and Drop Sortable javascript capability. No Theme update is required the code will change the query on the fly.
|
10 |
+
|
11 |
+
== Description ==
|
12 |
+
|
13 |
+
Order Categories and all custom taxonomies terms using a Drag and Drop Sortable javascript capability. <b>No Theme update is required<b/> the code will change the query on the fly.
|
14 |
+
If multiple taxonomies are created for a custom post type, a menu will allow to chose the one you need sorted. If child categories (terms) are define, tose can be sorder too using the same interface
|
15 |
+
<br />Also you can have the admin terms interface sorted per your new sort.
|
16 |
+
<br />This plugin it's developed by <a target="_blank" href="http://www.nsp-code.com">Nsp-Code</a>
|
17 |
+
|
18 |
+
== Installation ==
|
19 |
+
|
20 |
+
1. Upload `taxonomy-terms-order` folder to your `/wp-content/plugins/` directory.
|
21 |
+
2. Activate the plugin from Admin > Plugins menu.
|
22 |
+
3. Once activated you should check with Settings > Taxonomy Terms Order
|
23 |
+
4. Use Taxonomy Order link which appear into each post type section to make your sort.
|
24 |
+
|
25 |
+
|
26 |
+
== Screenshots ==
|
27 |
+
|
28 |
+
1. Category Order Interface.
|
29 |
+
2. Multiple Taxonomies Interface.
|
30 |
+
|
31 |
+
== Frequently Asked Questions ==
|
32 |
+
|
33 |
+
Feel free to contact me at electronice_delphi@yahoo.com
|
34 |
+
|
35 |
+
= I have no PHP knowledge at all, i will still be able to use this plugin? =
|
36 |
+
|
37 |
+
Yes, this is the right tool for you. The plugin come with a unique feature to update the queries on the fly and return the terms in the required ored without changing any line of code. Or as alternative you can do that manually.
|
38 |
+
|
39 |
+
= What taxonomies will allow me to sort? =
|
40 |
+
|
41 |
+
You can sort ALL taxonomies, including the default Categories.
|
42 |
+
|
43 |
+
= Is there any way i can get my admin interface to use the custom terms order? =
|
44 |
+
|
45 |
+
Absolutelly, the plugin can do that. In fact you can configure so only the admin will update and the front side template will display the terms as before.
|
46 |
+
|
47 |
+
= There is a feature that i want it implemented, can you do something about it? =
|
48 |
+
|
49 |
+
All ideas are welcome and i put them on my list to be implemented into the new versions. Anyway this may take time, but if you are in a rush, please consider a small donation and we can arrange something.
|
50 |
+
|
51 |
+
|
52 |
+
== Change Log ==
|
53 |
+
|
54 |
+
= 1.5.1 =
|
55 |
+
- Localisation Implement, Dutch and Romanian.
|
56 |
+
Many thanks to Anja Fokker http://www.werkgroepen.net/
|
57 |
+
|
58 |
+
|
59 |
+
== Upgrade Notice ==
|
60 |
+
|
61 |
+
Make sure you get the latest version
|
62 |
+
|
63 |
+
|
64 |
+
== Localization ==
|
65 |
+
|
66 |
+
Currently only available in English
|
screenshot-1.gif
ADDED
Binary file
|
screenshot-2.gif
ADDED
Binary file
|
taxonomy-terms-order.php
ADDED
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Category Order and Taxonomy Terms Order
|
4 |
+
Plugin URI: http://www.nsp-code.com
|
5 |
+
Description: Category Order and Taxonomy Terms Order
|
6 |
+
Version: 1.2.6
|
7 |
+
Author: Nsp-Code
|
8 |
+
Author URI: http://www.nsp-code.com
|
9 |
+
Author Email: electronice_delphi@yahoo.com
|
10 |
+
*/
|
11 |
+
|
12 |
+
|
13 |
+
define('TOPATH', WP_PLUGIN_DIR .'/taxonomy-terms-order');
|
14 |
+
define('TOURL', WP_PLUGIN_URL .'/taxonomy-terms-order');
|
15 |
+
|
16 |
+
load_plugin_textdomain('to', "/wp-content/plugins/taxonomy-terms-order/lang/");
|
17 |
+
|
18 |
+
register_deactivation_hook(__FILE__, 'TO_deactivated');
|
19 |
+
register_activation_hook(__FILE__, 'TO_activated');
|
20 |
+
|
21 |
+
function TO_activated()
|
22 |
+
{
|
23 |
+
global $wpdb;
|
24 |
+
|
25 |
+
//check if the menu_order column exists;
|
26 |
+
$query = "SHOW COLUMNS FROM $wpdb->terms
|
27 |
+
LIKE 'term_order'";
|
28 |
+
$result = $wpdb->query($query);
|
29 |
+
|
30 |
+
if ($result == 0)
|
31 |
+
{
|
32 |
+
$query = "ALTER TABLE $wpdb->terms ADD `term_order` INT( 4 ) NULL DEFAULT '0'";
|
33 |
+
$result = $wpdb->query($query);
|
34 |
+
}
|
35 |
+
|
36 |
+
//make sure the vars are set as default
|
37 |
+
$options = get_option('tto_options');
|
38 |
+
if (!isset($options['autosort']))
|
39 |
+
$options['autosort'] = '1';
|
40 |
+
|
41 |
+
if (!isset($options['adminsort']))
|
42 |
+
$options['adminsort'] = '1';
|
43 |
+
|
44 |
+
if (!isset($options['level']))
|
45 |
+
$options['level'] = 0;
|
46 |
+
|
47 |
+
update_option('tto_options', $options);
|
48 |
+
}
|
49 |
+
|
50 |
+
function TO_deactivated()
|
51 |
+
{
|
52 |
+
|
53 |
+
}
|
54 |
+
|
55 |
+
add_action('admin_print_scripts', 'TO_admin_scripts');
|
56 |
+
function TO_admin_scripts()
|
57 |
+
{
|
58 |
+
wp_enqueue_script('jquery');
|
59 |
+
|
60 |
+
wp_enqueue_script('jquery-ui-sortable');
|
61 |
+
|
62 |
+
$myJsFile = TOURL . '/js/to-javascript.js';
|
63 |
+
wp_register_script('to-javascript.js', $myJsFile);
|
64 |
+
wp_enqueue_script( 'to-javascript.js');
|
65 |
+
|
66 |
+
}
|
67 |
+
|
68 |
+
add_action('admin_print_styles', 'TO_admin_styles');
|
69 |
+
function TO_admin_styles()
|
70 |
+
{
|
71 |
+
$myCssFile = TOURL . '/css/to.css';
|
72 |
+
wp_register_style('to.css', $myCssFile);
|
73 |
+
wp_enqueue_style( 'to.css');
|
74 |
+
}
|
75 |
+
|
76 |
+
add_action('admin_menu', 'TOPluginMenu', 99);
|
77 |
+
|
78 |
+
function TOPluginMenu()
|
79 |
+
{
|
80 |
+
include (TOPATH . '/include/interface.php');
|
81 |
+
include (TOPATH . '/include/terms_walker.php');
|
82 |
+
|
83 |
+
include (TOPATH . '/include/options.php');
|
84 |
+
add_options_page('Taxonomy Terms Order', '<img class="menu_pto" src="'. TOURL .'/images/menu-icon.gif" alt="" />Taxonomy Terms Order', 'manage_options', 'to-options', 'to_plugin_options');
|
85 |
+
|
86 |
+
$options = get_option('tto_options');
|
87 |
+
|
88 |
+
if (!isset($options['level']))
|
89 |
+
$options['level'] = 8;
|
90 |
+
|
91 |
+
//put a menu within all custom types if apply
|
92 |
+
$post_types = get_post_types();
|
93 |
+
foreach( $post_types as $post_type)
|
94 |
+
{
|
95 |
+
|
96 |
+
//check if there are any taxonomy for this post type
|
97 |
+
$post_type_taxonomies = get_object_taxonomies($post_type);
|
98 |
+
|
99 |
+
foreach ($post_type_taxonomies as $key => $taxonomy_name)
|
100 |
+
{
|
101 |
+
$taxonomy_info = get_taxonomy($taxonomy_name);
|
102 |
+
if ($taxonomy_info->hierarchical !== TRUE)
|
103 |
+
unset($post_type_taxonomies[$key]);
|
104 |
+
}
|
105 |
+
|
106 |
+
if (count($post_type_taxonomies) == 0)
|
107 |
+
continue;
|
108 |
+
|
109 |
+
if ($post_type == 'post')
|
110 |
+
add_submenu_page('edit.php', 'Taxonomy Order', 'Taxonomy Order', 'level_'.$options['level'], 'to-interface-'.$post_type, 'TOPluginInterface' );
|
111 |
+
else
|
112 |
+
add_submenu_page('edit.php?post_type='.$post_type, 'Taxonomy Order', 'Taxonomy Order', 'level_'.$options['level'], 'to-interface-'.$post_type, 'TOPluginInterface' );
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
|
117 |
+
add_action( 'wp_ajax_update-custom-type-order-hierarchical', array(&$this, 'saveAjaxOrderHierarchical') );
|
118 |
+
|
119 |
+
|
120 |
+
function mycategoryorder_applyorderfilter($orderby, $args)
|
121 |
+
{
|
122 |
+
$options = get_option('tto_options');
|
123 |
+
|
124 |
+
//if admin make sure use the admin setting
|
125 |
+
if (is_admin())
|
126 |
+
{
|
127 |
+
if ($options['adminsort'] == "1")
|
128 |
+
return 't.term_order';
|
129 |
+
|
130 |
+
return $orderby;
|
131 |
+
}
|
132 |
+
|
133 |
+
//if autosort, then force the menu_order
|
134 |
+
if ($options['autosort'] == 1)
|
135 |
+
{
|
136 |
+
return 't.term_order';
|
137 |
+
}
|
138 |
+
|
139 |
+
return $orderby;
|
140 |
+
}
|
141 |
+
|
142 |
+
add_filter('get_terms_orderby', 'mycategoryorder_applyorderfilter', 10, 2);
|
143 |
+
|
144 |
+
|
145 |
+
add_action( 'wp_ajax_update-taxonomy-order', 'TOsaveAjaxOrder' );
|
146 |
+
function TOsaveAjaxOrder()
|
147 |
+
{
|
148 |
+
global $wpdb;
|
149 |
+
$taxonomy = stripslashes($_POST['taxonomy']);
|
150 |
+
$data = stripslashes($_POST['order']);
|
151 |
+
$unserialised_data = unserialize($data);
|
152 |
+
|
153 |
+
if (is_array($unserialised_data))
|
154 |
+
foreach($unserialised_data as $key => $values )
|
155 |
+
{
|
156 |
+
//$key_parent = str_replace("item_", "", $key);
|
157 |
+
$items = explode("&", $values);
|
158 |
+
unset($item);
|
159 |
+
foreach ($items as $item_key => $item_)
|
160 |
+
{
|
161 |
+
$items[$item_key] = trim(str_replace("item[]=", "",$item_));
|
162 |
+
}
|
163 |
+
|
164 |
+
if (is_array($items) && count($items) > 0)
|
165 |
+
foreach( $items as $item_key => $term_id )
|
166 |
+
{
|
167 |
+
/*
|
168 |
+
$args = array(
|
169 |
+
'parent' => $key_parent
|
170 |
+
);
|
171 |
+
wp_update_term( $term_id, $taxonomy, $args );
|
172 |
+
*/
|
173 |
+
$wpdb->update( $wpdb->terms, array('term_order' => ($item_key + 1)), array('term_id' => $term_id) );
|
174 |
+
}
|
175 |
+
}
|
176 |
+
}
|
177 |
+
|
178 |
+
|
179 |
+
?>
|