Version Description
- added support for third party plugins
- added user custom fields
- added extra image check
- bug fix with javascript (jquery) enqueue
Download this release
Release Info
Developer | codepress |
Plugin | Admin Columns |
Version | 1.2 |
Comparing to | |
See all releases |
Code changes from version 1.0 to 1.2
- assets/css/admin-column.css +21 -2
- assets/js/admin-column.js +11 -8
- codepress-admin-columns.php +928 -416
- languages/codepress-admin-columns-nl_NL.mo +0 -0
- languages/codepress-admin-columns-nl_NL.po +119 -205
- readme.txt +65 -18
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
assets/css/admin-column.css
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
#general-cpac-settings {}
|
2 |
#cpac .postbox {
|
3 |
margin: 0 10px 10px 0;
|
4 |
}
|
@@ -109,7 +108,7 @@
|
|
109 |
display: block;
|
110 |
margin-right: 30px;
|
111 |
overflow: hidden;
|
112 |
-
height:
|
113 |
}
|
114 |
#general-cpac-settings .cpac-option-list li .cpac-type-options input {
|
115 |
margin-top: 6px;
|
@@ -206,4 +205,24 @@
|
|
206 |
}
|
207 |
#restore-cpac-settings .inside .description {
|
208 |
color: #832525;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
}
|
|
|
1 |
#cpac .postbox {
|
2 |
margin: 0 10px 10px 0;
|
3 |
}
|
108 |
display: block;
|
109 |
margin-right: 30px;
|
110 |
overflow: hidden;
|
111 |
+
height: 17px;
|
112 |
}
|
113 |
#general-cpac-settings .cpac-option-list li .cpac-type-options input {
|
114 |
margin-top: 6px;
|
205 |
}
|
206 |
#restore-cpac-settings .inside .description {
|
207 |
color: #832525;
|
208 |
+
}
|
209 |
+
#likethisplugin-cpac-settings {
|
210 |
+
padding: 0 0 10px;
|
211 |
+
}
|
212 |
+
#likethisplugin-cpac-settings ul {
|
213 |
+
margin-left: 20px;
|
214 |
+
}
|
215 |
+
#likethisplugin-cpac-settings li {
|
216 |
+
list-style: square;
|
217 |
+
line-height: 16px;
|
218 |
+
}
|
219 |
+
#likethisplugin-cpac-settings li a {
|
220 |
+
text-decoration: none;
|
221 |
+
}
|
222 |
+
#likethisplugin-cpac-settings li.donate_link a {
|
223 |
+
color: green;
|
224 |
+
text-decoration: underline;
|
225 |
+
}
|
226 |
+
#likethisplugin-cpac-settings li.donate_link a:hover {
|
227 |
+
color: darkgreen;
|
228 |
}
|
assets/js/admin-column.js
CHANGED
@@ -2,7 +2,11 @@
|
|
2 |
* fires when the dom is ready
|
3 |
*
|
4 |
*/
|
5 |
-
jQuery(document).ready(function()
|
|
|
|
|
|
|
|
|
6 |
cpac_sortable();
|
7 |
cpac_checked();
|
8 |
cpac_box_events();
|
@@ -15,7 +19,7 @@ jQuery(document).ready(function(){
|
|
15 |
*
|
16 |
*/
|
17 |
function cpac_sortable()
|
18 |
-
{
|
19 |
jQuery('ul.cpac-option-list').sortable({
|
20 |
handle: 'div.cpac-sort-handle',
|
21 |
placeholder: 'cpac-placeholder',
|
@@ -38,7 +42,7 @@ function cpac_checked()
|
|
38 |
// toggle on
|
39 |
if ( value != 'on') {
|
40 |
li.addClass('active');
|
41 |
-
state.attr('value', 'on');
|
42 |
}
|
43 |
|
44 |
// toggle off
|
@@ -72,8 +76,7 @@ function cpac_box_events()
|
|
72 |
height: 0
|
73 |
}, 350, function() {
|
74 |
el.remove();
|
75 |
-
});
|
76 |
-
|
77 |
});
|
78 |
}
|
79 |
|
@@ -131,7 +134,7 @@ function cpac_add_custom_column()
|
|
131 |
if ( id )
|
132 |
ids.push(id);
|
133 |
}
|
134 |
-
});
|
135 |
});
|
136 |
|
137 |
// ...and sort them
|
@@ -168,7 +171,7 @@ function cpac_add_custom_column()
|
|
168 |
if ( attr_for ) {
|
169 |
jQuery(iv).attr('for', attr_for.replace(id, new_id) );
|
170 |
}
|
171 |
-
});
|
172 |
|
173 |
// remove description
|
174 |
clone.find('.remove-description').remove();
|
@@ -182,7 +185,7 @@ function cpac_add_custom_column()
|
|
182 |
var remove = '<p><a href="javascript:;" class="cpac-delete-custom-field-box">Remove</a>';
|
183 |
clone.find('.cpac-type-inside').append(remove);
|
184 |
}
|
185 |
-
|
186 |
// add cloned box to the list
|
187 |
list.append(clone);
|
188 |
|
2 |
* fires when the dom is ready
|
3 |
*
|
4 |
*/
|
5 |
+
jQuery(document).ready(function()
|
6 |
+
{
|
7 |
+
if (jQuery('#cpac').length == 0)
|
8 |
+
return false;
|
9 |
+
|
10 |
cpac_sortable();
|
11 |
cpac_checked();
|
12 |
cpac_box_events();
|
19 |
*
|
20 |
*/
|
21 |
function cpac_sortable()
|
22 |
+
{
|
23 |
jQuery('ul.cpac-option-list').sortable({
|
24 |
handle: 'div.cpac-sort-handle',
|
25 |
placeholder: 'cpac-placeholder',
|
42 |
// toggle on
|
43 |
if ( value != 'on') {
|
44 |
li.addClass('active');
|
45 |
+
state.attr('value', 'on');
|
46 |
}
|
47 |
|
48 |
// toggle off
|
76 |
height: 0
|
77 |
}, 350, function() {
|
78 |
el.remove();
|
79 |
+
});
|
|
|
80 |
});
|
81 |
}
|
82 |
|
134 |
if ( id )
|
135 |
ids.push(id);
|
136 |
}
|
137 |
+
});
|
138 |
});
|
139 |
|
140 |
// ...and sort them
|
171 |
if ( attr_for ) {
|
172 |
jQuery(iv).attr('for', attr_for.replace(id, new_id) );
|
173 |
}
|
174 |
+
});
|
175 |
|
176 |
// remove description
|
177 |
clone.find('.remove-description').remove();
|
185 |
var remove = '<p><a href="javascript:;" class="cpac-delete-custom-field-box">Remove</a>';
|
186 |
clone.find('.cpac-type-inside').append(remove);
|
187 |
}
|
188 |
+
|
189 |
// add cloned box to the list
|
190 |
list.append(clone);
|
191 |
|
codepress-admin-columns.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Codepress Admin Columns
|
4 |
-
Version: 1.
|
5 |
-
Description: This plugin makes it easy to
|
6 |
-
Author:
|
7 |
Author URI: http://www.codepress.nl
|
8 |
Plugin URI: http://www.codepress.nl/plugins/codepress-admin-columns/
|
9 |
Text Domain: codepress-admin-columns
|
@@ -26,14 +26,14 @@ along with this program; if not, write to the Free Software
|
|
26 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
27 |
*/
|
28 |
|
29 |
-
define( 'CPAC_VERSION', '1.
|
30 |
|
31 |
/**
|
32 |
* Init Class
|
33 |
*
|
34 |
* @since 1.0
|
35 |
*/
|
36 |
-
|
37 |
|
38 |
/**
|
39 |
* Advanced Admin Columns Class
|
@@ -47,7 +47,8 @@ class Codepress_Admin_Columns
|
|
47 |
$options,
|
48 |
$options_default,
|
49 |
$slug,
|
50 |
-
$textdomain
|
|
|
51 |
|
52 |
/**
|
53 |
* Construct
|
@@ -60,37 +61,42 @@ class Codepress_Admin_Columns
|
|
60 |
}
|
61 |
|
62 |
/**
|
63 |
-
*
|
64 |
*
|
65 |
* Loading sequence is determined and intialized.
|
66 |
*
|
67 |
* @since 1.0
|
68 |
*/
|
69 |
function init()
|
70 |
-
{
|
71 |
// vars
|
72 |
$this->post_types = $this->get_post_types();
|
73 |
-
|
74 |
-
$this->options = get_option('cpac_options');
|
75 |
-
$this->options_default = get_option('cpac_options_default');
|
76 |
-
|
77 |
// slug
|
78 |
$this->slug = 'codepress-admin-columns';
|
79 |
$this->textdomain = 'codepress-admin-columns';
|
80 |
|
|
|
|
|
|
|
81 |
// translations
|
82 |
load_plugin_textdomain( $this->textdomain, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
83 |
|
84 |
-
//
|
85 |
-
add_action( 'admin_menu', array( &$this, 'settings_menu') );
|
86 |
add_action( 'admin_init', array( &$this, 'register_settings') );
|
87 |
-
add_action( 'admin_init', array( &$this, 'register_columns' ) );
|
88 |
-
add_action( '
|
89 |
-
add_action( '
|
90 |
-
add_action( '
|
91 |
add_action( 'admin_print_styles' , array( &$this, 'column_styles') );
|
|
|
|
|
|
|
|
|
|
|
92 |
add_filter( 'request', array( &$this, 'handle_requests_orderby_column') );
|
93 |
-
add_filter( 'plugin_action_links', array( &$this, 'add_settings_link'),
|
94 |
}
|
95 |
|
96 |
/**
|
@@ -114,9 +120,10 @@ class Codepress_Admin_Columns
|
|
114 |
// Callback
|
115 |
array( &$this, 'plugin_settings_page')
|
116 |
);
|
117 |
-
|
118 |
-
//
|
119 |
add_action( "admin_print_styles-$page", array( &$this, 'admin_styles') );
|
|
|
120 |
}
|
121 |
|
122 |
/**
|
@@ -140,187 +147,143 @@ class Codepress_Admin_Columns
|
|
140 |
*/
|
141 |
public function register_columns()
|
142 |
{
|
143 |
-
|
144 |
-
|
|
|
145 |
// register column per post type
|
146 |
-
add_filter("manage_edit-{$post_type}_columns", array(&$this, '
|
147 |
|
148 |
// register column as sortable
|
149 |
-
add_filter( "manage_edit-{$post_type}_sortable_columns", array(&$this, '
|
150 |
-
}
|
|
|
|
|
|
|
|
|
151 |
}
|
152 |
|
153 |
/**
|
154 |
-
* Callback
|
155 |
*
|
156 |
* @since 1.0
|
157 |
*/
|
158 |
-
public function
|
159 |
-
{
|
160 |
global $post_type;
|
161 |
-
|
162 |
-
|
163 |
-
return $columns;
|
164 |
}
|
165 |
|
166 |
/**
|
167 |
-
* Callback
|
168 |
*
|
169 |
-
* @since 1.
|
170 |
*/
|
171 |
-
public function
|
172 |
-
{
|
173 |
-
|
174 |
-
$columns = $this->set_sortable_filter($columns, $post_type);
|
175 |
-
|
176 |
-
return $columns;
|
177 |
}
|
178 |
|
179 |
/**
|
180 |
-
*
|
181 |
-
*
|
182 |
-
* This function in conjunction with others usei the WordPress
|
183 |
-
* Settings API to create a settings page where users can adjust
|
184 |
-
* the behaviour of this plugin.
|
185 |
*
|
186 |
-
*
|
187 |
*/
|
188 |
-
|
189 |
{
|
190 |
-
//
|
191 |
-
$
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
$boxes = $this->get_column_options($post_type);
|
202 |
-
|
203 |
-
// class
|
204 |
-
$class = $this->is_menu_type_current($post_type) ? ' current' : ' hidden';
|
205 |
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
<h3 class='cpac_post_type hidden'>{$label}</h3>
|
213 |
-
{$boxes}
|
214 |
-
</td>
|
215 |
-
</tr>
|
216 |
-
";
|
217 |
}
|
218 |
|
219 |
-
|
220 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
|
222 |
-
|
223 |
-
<div id="cpac" class="wrap">
|
224 |
-
<?php screen_icon($this->slug) ?>
|
225 |
-
<h2><?php _e('Codepress Admin Columns', $this->textdomain); ?></h2>
|
226 |
-
<?php echo $menu ?>
|
227 |
-
<div class="postbox-container" style="width:70%;">
|
228 |
-
<div class="metabox-holder">
|
229 |
-
<div class="meta-box-sortables">
|
230 |
-
|
231 |
-
<div id="general-cpac-settings" class="postbox">
|
232 |
-
<div title="Click to toggle" class="handlediv"><br></div>
|
233 |
-
<h3 class="hndle">
|
234 |
-
<span><?php _e('Admin Columns', $this->textdomain ); ?></span>
|
235 |
-
</h3>
|
236 |
-
<div class="inside">
|
237 |
-
<form method="post" action="options.php">
|
238 |
-
|
239 |
-
<?php settings_fields( 'cpac-settings-group' ); ?>
|
240 |
-
|
241 |
-
<table class="form-table">
|
242 |
-
|
243 |
-
<?php echo $rows ?>
|
244 |
-
|
245 |
-
<tr class="bottom" valign="top">
|
246 |
-
<th scope="row"></th>
|
247 |
-
<td>
|
248 |
-
<p class="submit">
|
249 |
-
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
250 |
-
</p>
|
251 |
-
</td>
|
252 |
-
</tr>
|
253 |
-
</table>
|
254 |
-
</form>
|
255 |
-
</div>
|
256 |
-
</div><!-- general-settings -->
|
257 |
-
|
258 |
-
<div id="restore-cpac-settings" class="postbox">
|
259 |
-
<div title="Click to toggle" class="handlediv"><br></div>
|
260 |
-
<h3 class="hndle">
|
261 |
-
<span><?php _e('Restore defaults', $this->textdomain) ?></span>
|
262 |
-
</h3>
|
263 |
-
<div class="inside">
|
264 |
-
<form method="post" action="">
|
265 |
-
<input type="submit" class="button" name="cpac-restore-defaults" value="<?php _e('Restore default settings', $this->textdomain ) ?>" onclick="return confirm('<?php _e("Warning! ALL saved admin columns data will be deleted. This cannot be undone. \'OK\' to delete, \'Cancel\' to stop", $this->textdomain); ?>');" />
|
266 |
-
</form>
|
267 |
-
<p class="description"><?php _e('This will delete all column settings and restore the default settings.', $this->textdomain); ?></p>
|
268 |
-
</div>
|
269 |
-
</div><!-- restore-cpac-settings -->
|
270 |
-
|
271 |
-
</div>
|
272 |
-
</div>
|
273 |
-
</div><!-- .postbox-container -->
|
274 |
-
|
275 |
-
<div class="postbox-container" style="width:20%;">
|
276 |
-
<div class="metabox-holder">
|
277 |
-
<div class="meta-box-sortables">
|
278 |
-
|
279 |
-
<div id="side-cpac-settings" class="postbox">
|
280 |
-
<div title="Click to toggle" class="handlediv"><br></div>
|
281 |
-
<h3 class="hndle">
|
282 |
-
<span><?php _e('Need support?', $this->textdomain) ?></span>
|
283 |
-
</h3>
|
284 |
-
<div class="inside">
|
285 |
-
<p><?php printf(__('If you are having problems with this plugin, please talk about them in the <a href="%s">Support forums</a>.', $this->textdomain), 'http://wordpress.org/tags/codepress-admin-columns' );?></p>
|
286 |
-
<p><?php printf(__("If you're sure you've found a bug, or have a feature request, please <a href='%s'>submit your feedback</a>.", $this->textdomain), 'http://www.codepress.nl/plugins/codepress-admin-columns#feedback');?></p>
|
287 |
-
</div>
|
288 |
-
</div><!-- side-cpac-settings -->
|
289 |
-
|
290 |
-
</div>
|
291 |
-
</div>
|
292 |
-
</div><!-- .postbox-container -->
|
293 |
-
|
294 |
-
</div>
|
295 |
-
<?php
|
296 |
}
|
297 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
/**
|
299 |
* Get a list of Column options per post type
|
300 |
*
|
301 |
* @since 1.0
|
302 |
*/
|
303 |
-
private function
|
304 |
{
|
305 |
// merge all columns
|
306 |
-
$display_columns = $this->get_merged_columns($
|
307 |
-
|
308 |
// define
|
309 |
$list = '';
|
310 |
|
311 |
// loop throught the active columns
|
312 |
if ( $display_columns ) {
|
313 |
-
foreach ( $display_columns as $
|
314 |
|
315 |
// add items to the list
|
316 |
-
$list .= $this->get_box($
|
317 |
|
318 |
}
|
319 |
}
|
320 |
|
321 |
// custom field button
|
322 |
$button_add_column = '';
|
323 |
-
if ( $this->
|
324 |
$button_add_column = "<a href='javacript:;' class='cpac-add-customfield-column button'>+ " . __('Add Custom Field Column') . "</a>";
|
325 |
|
326 |
return "
|
@@ -339,60 +302,90 @@ class Codepress_Admin_Columns
|
|
339 |
*
|
340 |
* @since 1.0
|
341 |
*/
|
342 |
-
private function get_merged_columns($
|
343 |
{
|
344 |
//get saved database columns
|
345 |
-
$db_columns = $this->
|
346 |
-
|
347 |
-
|
348 |
-
$
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
|
353 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
354 |
$default_columns = wp_parse_args($wp_custom_columns, $wp_default_columns);
|
355 |
-
|
356 |
// loop throught the active columns
|
357 |
if ( $db_columns ) {
|
358 |
-
|
|
|
|
|
|
|
|
|
359 |
|
360 |
// get column meta options from custom columns
|
361 |
-
if (
|
362 |
-
$db_columns[$
|
363 |
|
364 |
// add static options
|
365 |
-
|
366 |
-
$db_columns[$
|
367 |
|
368 |
-
unset($default_columns[$
|
369 |
}
|
370 |
}
|
371 |
|
372 |
// merge all
|
373 |
-
$display_columns = wp_parse_args($db_columns, $default_columns);
|
374 |
-
|
375 |
return $display_columns;
|
376 |
}
|
377 |
-
|
378 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
379 |
/**
|
380 |
* Get checkbox
|
381 |
*
|
382 |
* @since 1.0
|
383 |
*/
|
384 |
-
private function get_box($
|
385 |
{
|
386 |
$classes = array();
|
387 |
|
388 |
// set state
|
389 |
$state = isset($values['state']) ? $values['state'] : '';
|
390 |
|
391 |
-
// set sortorder
|
392 |
-
$sortorder = isset($values['sortorder']) && $values['sortorder'] == 'on' ? 'on' : '';
|
393 |
-
|
394 |
// class
|
395 |
-
$classes[] = "cpac-box-{$
|
396 |
if ( $state )
|
397 |
$classes[] = 'active';
|
398 |
if ( ! empty($values['options']['class']) )
|
@@ -400,11 +393,17 @@ class Codepress_Admin_Columns
|
|
400 |
$class = implode(' ', $classes);
|
401 |
|
402 |
// more box options
|
403 |
-
$more_options = $this->get_additional_box_options($
|
404 |
$action = "<a class='cpac-action' href='#open'>open</a>";
|
|
|
|
|
|
|
|
|
|
|
|
|
405 |
|
406 |
// hide box options
|
407 |
-
if ( ! empty($values['options']['hide_options']) ) {
|
408 |
$action = $more_options = '';
|
409 |
}
|
410 |
|
@@ -414,17 +413,16 @@ class Codepress_Admin_Columns
|
|
414 |
<div class='cpac-type-options'>
|
415 |
|
416 |
<div class='cpac-checkbox'></div>
|
417 |
-
<input type='hidden' class='cpac-state' name='cpac_options[columns][{$
|
418 |
-
<input type='hidden' name='cpac_options[columns][{$post_type}][{$key}][sortorder]' value='{$sortorder}'/>
|
419 |
<label class='main-label'>{$values['label']}</label>
|
420 |
</div>
|
421 |
<div class='cpac-meta-title'>
|
422 |
{$action}
|
423 |
-
<span>{$
|
424 |
</div>
|
425 |
<div class='cpac-type-inside'>
|
426 |
-
<label for='cpac_options[columns][{$
|
427 |
-
<input type='text' name='cpac_options[columns][{$
|
428 |
<br/>
|
429 |
{$more_options}
|
430 |
</div>
|
@@ -439,13 +437,13 @@ class Codepress_Admin_Columns
|
|
439 |
*
|
440 |
* @since 1.0
|
441 |
*/
|
442 |
-
private function get_additional_box_options($post_type, $
|
443 |
{
|
444 |
$fields = '';
|
445 |
|
446 |
// Custom Fields
|
447 |
-
if (
|
448 |
-
$fields .= $this->get_box_options_customfields($post_type, $
|
449 |
|
450 |
return $fields;
|
451 |
}
|
@@ -455,10 +453,10 @@ class Codepress_Admin_Columns
|
|
455 |
*
|
456 |
* @since 1.0
|
457 |
*/
|
458 |
-
private function get_box_options_customfields($
|
459 |
{
|
460 |
// get post meta fields
|
461 |
-
$fields = $this->
|
462 |
|
463 |
if ( empty($fields) )
|
464 |
return false;
|
@@ -485,10 +483,13 @@ class Codepress_Admin_Columns
|
|
485 |
'library_id' => __('Media Library Icon', $this->textdomain),
|
486 |
'excerpt' => __('Excerpt'),
|
487 |
'array' => __('Multiple Values', $this->textdomain),
|
|
|
488 |
);
|
489 |
|
490 |
-
// add
|
491 |
-
$fieldtypes = apply_filters('cpac-field-types', $fieldtypes );
|
|
|
|
|
492 |
foreach ( $fieldtypes as $fkey => $fieldtype ) {
|
493 |
$fieldtype_options .= sprintf
|
494 |
(
|
@@ -499,12 +500,16 @@ class Codepress_Admin_Columns
|
|
499 |
);
|
500 |
}
|
501 |
|
|
|
|
|
|
|
|
|
502 |
if ( empty($field_options) )
|
503 |
return false;
|
504 |
|
505 |
// add remove button
|
506 |
$remove = '<p class="remove-description description">'.__('This field can not be removed', $this->textdomain).'</p>';
|
507 |
-
if ( $
|
508 |
$remove = "
|
509 |
<p>
|
510 |
<a href='javascript:;' class='cpac-delete-custom-field-box'>".__('Remove')."</a>
|
@@ -513,12 +518,18 @@ class Codepress_Admin_Columns
|
|
513 |
}
|
514 |
|
515 |
$inside = "
|
516 |
-
<label for='cpac_options[columns][{$
|
517 |
-
<select name='cpac_options[columns][{$
|
518 |
<br/>
|
519 |
-
<label for='cpac_options[columns][{$
|
520 |
-
<select name='cpac_options[columns][{$
|
521 |
<br/>
|
|
|
|
|
|
|
|
|
|
|
|
|
522 |
{$remove}
|
523 |
";
|
524 |
|
@@ -526,17 +537,27 @@ class Codepress_Admin_Columns
|
|
526 |
}
|
527 |
|
528 |
/**
|
529 |
-
* Get post meta fields by post
|
530 |
*
|
531 |
* @since 1.0
|
532 |
*/
|
533 |
-
private function
|
534 |
{
|
535 |
global $wpdb;
|
536 |
-
// get mata fields
|
537 |
-
$sql = 'SELECT DISTINCT meta_key FROM '.$wpdb->postmeta.' pm JOIN '.$wpdb->posts.' p ON pm.post_id = p.ID WHERE p.post_type = "' . mysql_real_escape_string($post_type) . '" ORDER BY 1';
|
538 |
-
$fields = $wpdb->get_results($sql, ARRAY_N);
|
539 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
540 |
// postmeta
|
541 |
if ( $fields ) {
|
542 |
$meta_fields = array();
|
@@ -546,9 +567,8 @@ class Codepress_Admin_Columns
|
|
546 |
$meta_fields[] = $field[0];
|
547 |
}
|
548 |
}
|
549 |
-
|
550 |
return $meta_fields;
|
551 |
-
}
|
552 |
|
553 |
return false;
|
554 |
}
|
@@ -558,13 +578,24 @@ class Codepress_Admin_Columns
|
|
558 |
*
|
559 |
* @since 1.0
|
560 |
*/
|
561 |
-
public function
|
562 |
{
|
563 |
-
wp_enqueue_script( 'dashboard' );
|
564 |
-
wp_enqueue_script( 'jquery-ui-sortable' );
|
565 |
-
wp_enqueue_script( 'cpac-admin', $this->plugin_url('/assets/js/admin-column.js'), array('jquery', 'jquery-ui-sortable'), CPAC_VERSION );
|
566 |
}
|
567 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
568 |
/**
|
569 |
* Get post types
|
570 |
*
|
@@ -609,7 +640,7 @@ class Codepress_Admin_Columns
|
|
609 |
public function register_settings()
|
610 |
{
|
611 |
// If we have no options in the database, let's add them now.
|
612 |
-
if ( false ===
|
613 |
add_option( 'cpac_options', array(&$this, 'get_default_plugin_options') );
|
614 |
|
615 |
register_setting( 'cpac-settings-group', 'cpac_options', array(&$this, 'options_callback') );
|
@@ -630,7 +661,7 @@ class Codepress_Admin_Columns
|
|
630 |
}
|
631 |
|
632 |
/**
|
633 |
-
*
|
634 |
*
|
635 |
* @since 1.0
|
636 |
*/
|
@@ -644,23 +675,40 @@ class Codepress_Admin_Columns
|
|
644 |
*
|
645 |
* @since 1.0
|
646 |
*/
|
647 |
-
|
648 |
{
|
649 |
// settings updated
|
650 |
-
if ( ! empty($_REQUEST['settings-updated']) )
|
651 |
-
|
652 |
-
// stores the default columns that are set by WP or set in the theme.
|
653 |
-
$wp_default_columns = array();
|
654 |
-
foreach ( $this->post_types as $post_type ) {
|
655 |
-
$wp_default_columns[$post_type] = $this->get_wp_default_columns($post_type);
|
656 |
-
}
|
657 |
-
update_option( 'cpac_options_default', $wp_default_columns );
|
658 |
-
}
|
659 |
|
660 |
// restore defaults
|
661 |
-
if ( ! empty($_REQUEST['cpac-restore-defaults']) )
|
662 |
$this->restore_defaults();
|
663 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
664 |
}
|
665 |
|
666 |
/**
|
@@ -679,15 +727,16 @@ class Codepress_Admin_Columns
|
|
679 |
*
|
680 |
* @since 1.0
|
681 |
*/
|
682 |
-
private function get_post_excerpt($post_id
|
683 |
{
|
684 |
-
global $post;
|
|
|
685 |
$save_post = $post;
|
686 |
$post = get_post($post_id);
|
687 |
$excerpt = get_the_excerpt();
|
688 |
$post = $save_post;
|
689 |
|
690 |
-
$output = $this->get_shortened_string($excerpt, $
|
691 |
|
692 |
return $output;
|
693 |
}
|
@@ -720,20 +769,20 @@ class Codepress_Admin_Columns
|
|
720 |
*
|
721 |
* @since 1.0
|
722 |
*/
|
723 |
-
public function
|
724 |
{
|
725 |
-
$type = $
|
726 |
|
727 |
// Check for taxonomies, such as column-taxonomy-[taxname]
|
728 |
if ( strpos($type, 'column-taxonomy-') !== false )
|
729 |
$type = 'column-taxonomy';
|
730 |
|
731 |
// Check for custom fields, such as column-meta-[customfieldname]
|
732 |
-
if (
|
733 |
-
$type = 'column-meta';
|
734 |
|
735 |
// Hook
|
736 |
-
do_action('cpac-manage-column', $type, $
|
737 |
|
738 |
// Switch Types
|
739 |
$result = '';
|
@@ -787,9 +836,14 @@ class Codepress_Admin_Columns
|
|
787 |
$result = get_post($post_id)->post_name;
|
788 |
break;
|
789 |
|
|
|
|
|
|
|
|
|
|
|
790 |
// Taxonomy
|
791 |
case "column-taxonomy" :
|
792 |
-
$tax = str_replace('column-taxonomy-',''
|
793 |
$tags = get_the_terms($post_id, $tax);
|
794 |
$tarr = array();
|
795 |
if ( $tax == 'post_format' && empty($tags) ) {
|
@@ -804,8 +858,8 @@ class Codepress_Admin_Columns
|
|
804 |
break;
|
805 |
|
806 |
// Custom Field
|
807 |
-
case "column-meta" :
|
808 |
-
$result = $this->get_column_value_custom_field($post_id, $
|
809 |
break;
|
810 |
|
811 |
// Attachment
|
@@ -814,7 +868,7 @@ class Codepress_Admin_Columns
|
|
814 |
break;
|
815 |
|
816 |
default :
|
817 |
-
$result = get_post_meta( $post_id, $
|
818 |
|
819 |
endswitch;
|
820 |
|
@@ -823,23 +877,93 @@ class Codepress_Admin_Columns
|
|
823 |
|
824 |
echo $result;
|
825 |
}
|
826 |
-
|
827 |
/**
|
828 |
-
*
|
829 |
*
|
830 |
-
*
|
831 |
*/
|
832 |
-
|
833 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
834 |
$result = '';
|
835 |
-
$
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
843 |
$result .= wp_get_attachment_image( $attach->ID, array(80,80), true );
|
844 |
}
|
845 |
}
|
@@ -850,19 +974,34 @@ class Codepress_Admin_Columns
|
|
850 |
* Get column value of Custom Field
|
851 |
*
|
852 |
* @since 1.0
|
853 |
-
*/
|
854 |
-
private function get_column_value_custom_field($
|
855 |
{
|
856 |
-
|
857 |
-
|
858 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
859 |
|
860 |
// Get meta field value
|
861 |
-
$meta =
|
862 |
|
863 |
// multiple meta values
|
864 |
if ( ( $fieldtype == 'array' && is_array($meta) ) || is_array($meta) ) {
|
865 |
-
$meta =
|
866 |
$meta = $this->recursive_implode(', ', $meta);
|
867 |
}
|
868 |
|
@@ -886,11 +1025,68 @@ class Codepress_Admin_Columns
|
|
886 |
|
887 |
// Excerpt
|
888 |
case "excerpt" :
|
889 |
-
$meta = $this->get_shortened_string($meta,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
890 |
break;
|
891 |
|
892 |
endswitch;
|
893 |
|
|
|
|
|
|
|
894 |
return $meta;
|
895 |
}
|
896 |
|
@@ -909,55 +1105,30 @@ class Codepress_Admin_Columns
|
|
909 |
$retVal[] = $r_pieces;
|
910 |
}
|
911 |
}
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
/**
|
916 |
-
* Set Columns for Registering
|
917 |
-
*
|
918 |
-
* @since 1.0
|
919 |
-
*/
|
920 |
-
private function set_column($columns, $post_type)
|
921 |
-
{
|
922 |
-
$db_columns = $this->get_db_columns($post_type);
|
923 |
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
// set already loaded columns by plugins
|
928 |
-
$set_columns = $this->filter_preset_columns($columns, $post_type);
|
929 |
-
|
930 |
-
// loop through columns
|
931 |
-
foreach ( $db_columns as $key => $values ) {
|
932 |
-
|
933 |
-
// is active
|
934 |
-
if ( isset($values['state']) && $values['state'] == 'on' ){
|
935 |
-
|
936 |
-
// register format
|
937 |
-
$set_columns[$key] = $values['label'];
|
938 |
-
}
|
939 |
-
}
|
940 |
-
return $set_columns;
|
941 |
-
}
|
942 |
|
943 |
/**
|
944 |
* Set columns. These columns apply either for every post or set by a plugin.
|
945 |
*
|
946 |
* @since 1.0
|
947 |
*/
|
948 |
-
private function filter_preset_columns($columns, $
|
949 |
{
|
950 |
-
$options =
|
951 |
|
952 |
if ( !$options )
|
953 |
return $columns;
|
954 |
|
955 |
// we use the wp default columns for filtering...
|
956 |
-
$
|
957 |
|
958 |
// ... the ones that are set by plugins, theme functions and such.
|
959 |
-
$dif_columns = array_diff(array_keys($columns), array_keys($
|
960 |
-
|
961 |
// we add those to the columns
|
962 |
$pre_columns = array();
|
963 |
if ( $dif_columns ) {
|
@@ -967,44 +1138,27 @@ class Codepress_Admin_Columns
|
|
967 |
}
|
968 |
|
969 |
return $pre_columns;
|
970 |
-
}
|
971 |
-
|
972 |
-
/**
|
973 |
-
* Set sortable columns
|
974 |
-
*
|
975 |
-
* @since 1.0
|
976 |
-
*/
|
977 |
-
private function set_sortable_filter($columns, $post_type)
|
978 |
-
{
|
979 |
-
$db_columns = $this->get_db_columns($post_type);
|
980 |
-
|
981 |
-
if ( !$db_columns )
|
982 |
-
return $columns;
|
983 |
-
|
984 |
-
// loop through columns
|
985 |
-
foreach ( $db_columns as $key => $values ) {
|
986 |
-
|
987 |
-
// is active
|
988 |
-
if ( isset($values['sortorder']) && $values['sortorder'] == 'on' ){
|
989 |
-
|
990 |
-
// register format
|
991 |
-
$columns[$key] = $this->sanitize_string($values['label']);
|
992 |
-
}
|
993 |
-
}
|
994 |
-
return $columns;
|
995 |
-
}
|
996 |
|
997 |
/**
|
998 |
* Get WP default supported admin columns per post type.
|
999 |
*
|
1000 |
* @since 1.0
|
1001 |
*/
|
1002 |
-
private function
|
1003 |
{
|
1004 |
-
// load
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1008 |
|
1009 |
// we need to change the current screen
|
1010 |
global $current_screen;
|
@@ -1016,12 +1170,56 @@ class Codepress_Admin_Columns
|
|
1016 |
// ...so we can get its columns
|
1017 |
$columns = WP_Posts_List_Table::get_columns();
|
1018 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1019 |
// we remove the checkbox column as an option...
|
1020 |
-
|
|
|
1021 |
|
1022 |
// change to uniform format
|
1023 |
$uniform_columns = array();
|
1024 |
-
foreach ( $columns as $
|
1025 |
$hide_options = false;
|
1026 |
$type_label = $label;
|
1027 |
|
@@ -1030,8 +1228,8 @@ class Codepress_Admin_Columns
|
|
1030 |
$type_label = __('Comments', $this->textdomain);
|
1031 |
$hide_options = true;
|
1032 |
}
|
1033 |
-
|
1034 |
-
$uniform_colums[$
|
1035 |
'label' => $label,
|
1036 |
'state' => 'on',
|
1037 |
'options' => array(
|
@@ -1041,96 +1239,78 @@ class Codepress_Admin_Columns
|
|
1041 |
)
|
1042 |
);
|
1043 |
}
|
1044 |
-
|
1045 |
-
// reset current screen
|
1046 |
-
$current_screen = $org_current_screen;
|
1047 |
-
|
1048 |
return $uniform_colums;
|
1049 |
}
|
1050 |
-
|
1051 |
/**
|
1052 |
-
*
|
1053 |
*
|
1054 |
* @since 1.0
|
1055 |
*/
|
1056 |
-
private function
|
1057 |
{
|
1058 |
$custom_columns = array();
|
1059 |
|
1060 |
-
// default arguments
|
1061 |
-
$defaults = array(
|
1062 |
-
'label' => '',
|
1063 |
-
'sortorder' => '',
|
1064 |
-
'state' => '',
|
1065 |
-
|
1066 |
-
// options are static
|
1067 |
-
'options' => array(
|
1068 |
-
'type_label' => __('Custom', $this->textdomain),
|
1069 |
-
'hide_options' => false,
|
1070 |
-
'class' => 'cpac-box-custom',
|
1071 |
-
)
|
1072 |
-
);
|
1073 |
-
|
1074 |
// Thumbnail support
|
1075 |
if ( post_type_supports($post_type, 'thumbnail') ) {
|
1076 |
-
$custom_columns['column-featured_image'] =
|
1077 |
'label' => __('Featured Image', $this->textdomain),
|
1078 |
'options' => array(
|
1079 |
'type_label' => __('Image', $this->textdomain)
|
1080 |
)
|
1081 |
-
)
|
1082 |
}
|
1083 |
|
1084 |
// Excerpt support
|
1085 |
if ( post_type_supports($post_type, 'editor') ) {
|
1086 |
-
$custom_columns['column-excerpt'] =
|
1087 |
'label' => __('Excerpt', $this->textdomain),
|
1088 |
'options' => array(
|
1089 |
'type_label' => __('Excerpt', $this->textdomain)
|
1090 |
)
|
1091 |
-
)
|
1092 |
}
|
1093 |
|
1094 |
// Sticky support
|
1095 |
if ( $post_type == 'post' ) {
|
1096 |
-
$custom_columns['column-sticky'] =
|
1097 |
'label' => __('Sticky', $this->textdomain),
|
1098 |
'options' => array(
|
1099 |
'type_label' => __('Sticky', $this->textdomain)
|
1100 |
)
|
1101 |
-
)
|
1102 |
}
|
1103 |
|
1104 |
// Order support
|
1105 |
if ( post_type_supports($post_type, 'page-attributes') ) {
|
1106 |
-
$custom_columns['column-order'] =
|
1107 |
-
'label' => __('Page Order', $this->textdomain),
|
1108 |
-
'sortorder' => 'on',
|
1109 |
'options' => array(
|
1110 |
-
'type_label' => __('Order', $this->textdomain)
|
|
|
1111 |
)
|
1112 |
-
)
|
1113 |
}
|
1114 |
|
1115 |
// Page Template
|
1116 |
if ( $post_type == 'page' ) {
|
1117 |
-
$custom_columns['column-page-template'] =
|
1118 |
'label' => __('Page Template', $this->textdomain),
|
1119 |
-
'sortorder' => 'on',
|
1120 |
'options' => array(
|
1121 |
-
'type_label' => __('Page Template', $this->textdomain)
|
|
|
1122 |
)
|
1123 |
-
)
|
1124 |
}
|
1125 |
|
1126 |
// Post Formats
|
1127 |
if ( post_type_supports($post_type, 'post-formats') ) {
|
1128 |
-
$custom_columns['column-post_formats'] =
|
1129 |
'label' => __('Post Format', $this->textdomain),
|
1130 |
'options' => array(
|
1131 |
'type_label' => __('Post Format', $this->textdomain)
|
1132 |
)
|
1133 |
-
)
|
1134 |
}
|
1135 |
|
1136 |
// Taxonomy support
|
@@ -1138,57 +1318,179 @@ class Codepress_Admin_Columns
|
|
1138 |
if ( $taxonomies ) {
|
1139 |
foreach ( $taxonomies as $tax_slug => $tax ) {
|
1140 |
if ( $tax_slug != 'post_tag' && $tax_slug != 'category' && $tax_slug != 'post_format' ) {
|
1141 |
-
$custom_columns['column-taxonomy-'.$tax->name] =
|
1142 |
'label' => $tax->label,
|
1143 |
'options' => array(
|
1144 |
'type_label' => __('Taxonomy', $this->textdomain)
|
1145 |
)
|
1146 |
-
)
|
1147 |
}
|
1148 |
}
|
1149 |
}
|
1150 |
|
1151 |
// Post ID support
|
1152 |
-
$custom_columns['column-postid'] =
|
1153 |
-
'label' => 'ID',
|
1154 |
-
'sortorder' => 'on',
|
1155 |
'options' => array(
|
1156 |
'type_label' => 'ID',
|
|
|
1157 |
)
|
1158 |
-
)
|
1159 |
|
1160 |
// Slug support
|
1161 |
-
$custom_columns['column-page-slug'] =
|
1162 |
'label' => __('Slug', $this->textdomain),
|
1163 |
-
'sortorder' => 'on',
|
1164 |
'options' => array(
|
1165 |
'type_label' => __('Slug', $this->textdomain),
|
|
|
1166 |
)
|
1167 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1168 |
|
1169 |
// Attachment support
|
1170 |
-
$custom_columns['column-attachment'] =
|
1171 |
'label' => __('Attachment', $this->textdomain),
|
1172 |
-
'sortorder' => 'on',
|
1173 |
'options' => array(
|
1174 |
-
'type_label' => __('Attachment', $this->textdomain)
|
|
|
1175 |
)
|
1176 |
-
)
|
1177 |
|
1178 |
// Custom Field support
|
1179 |
-
if ( $this->
|
1180 |
-
$custom_columns['column-meta-1'] =
|
1181 |
'label' => __('Custom Field', $this->textdomain),
|
1182 |
'field' => '',
|
1183 |
'field_type' => '',
|
|
|
|
|
1184 |
'options' => array(
|
1185 |
'type_label' => __('Field', $this->textdomain),
|
1186 |
-
'class' => 'cpac-box-metafield'
|
|
|
1187 |
)
|
1188 |
-
)
|
1189 |
}
|
1190 |
|
1191 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1192 |
}
|
1193 |
|
1194 |
/**
|
@@ -1196,14 +1498,14 @@ class Codepress_Admin_Columns
|
|
1196 |
*
|
1197 |
* @since 1.0
|
1198 |
*/
|
1199 |
-
private function
|
1200 |
{
|
1201 |
// get plugin options
|
1202 |
-
$options =
|
1203 |
|
1204 |
// get saved columns
|
1205 |
-
if ( isset($options['columns'][$
|
1206 |
-
return $options['columns'][$
|
1207 |
|
1208 |
return false;
|
1209 |
}
|
@@ -1213,7 +1515,7 @@ class Codepress_Admin_Columns
|
|
1213 |
*
|
1214 |
* @since 1.0
|
1215 |
*/
|
1216 |
-
private function
|
1217 |
{
|
1218 |
// set
|
1219 |
$menu = '';
|
@@ -1225,16 +1527,16 @@ class Codepress_Admin_Columns
|
|
1225 |
$referer = $_REQUEST['cpac_type'];
|
1226 |
|
1227 |
// loop
|
1228 |
-
foreach ( $this->
|
1229 |
-
$label = $this->get_singular_name($
|
1230 |
-
$clean_label = $this->sanitize_string($
|
1231 |
|
1232 |
// divider
|
1233 |
$divider = $count++ == 1 ? '' : ' | ';
|
1234 |
|
1235 |
// current
|
1236 |
$current = '';
|
1237 |
-
if ( $this->is_menu_type_current($
|
1238 |
$current = ' class="current"';
|
1239 |
|
1240 |
// menu list
|
@@ -1258,9 +1560,7 @@ class Codepress_Admin_Columns
|
|
1258 |
* @since 1.0
|
1259 |
*/
|
1260 |
private function is_menu_type_current( $post_type )
|
1261 |
-
{
|
1262 |
-
//print_r($post_type);
|
1263 |
-
|
1264 |
// referer
|
1265 |
$referer = '';
|
1266 |
if ( ! empty($_REQUEST['cpac_type']) )
|
@@ -1292,10 +1592,18 @@ class Codepress_Admin_Columns
|
|
1292 |
*
|
1293 |
* @since 1.0
|
1294 |
*/
|
1295 |
-
private function get_singular_name( $
|
1296 |
{
|
1297 |
-
|
1298 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1299 |
return $label;
|
1300 |
}
|
1301 |
|
@@ -1306,25 +1614,59 @@ class Codepress_Admin_Columns
|
|
1306 |
*/
|
1307 |
public function handle_requests_orderby_column( $vars )
|
1308 |
{
|
1309 |
-
if ( isset( $vars['orderby'] ) ) {
|
1310 |
-
|
1311 |
-
$db_columns = $this->get_db_columns($vars['post_type']);
|
1312 |
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
// sanitizing label
|
1317 |
-
$label = $this->sanitize_string($db_columns['column-order']['label']);
|
1318 |
|
1319 |
-
//
|
1320 |
-
if ( $
|
1321 |
$vars['orderby'] = 'menu_order';
|
1322 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1323 |
}
|
1324 |
}
|
1325 |
return $vars;
|
1326 |
}
|
1327 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1328 |
/**
|
1329 |
* Sanitize label
|
1330 |
*
|
@@ -1334,12 +1676,11 @@ class Codepress_Admin_Columns
|
|
1334 |
*/
|
1335 |
private function sanitize_string($string)
|
1336 |
{
|
1337 |
-
|
1338 |
-
return str_replace('http://','', $string);
|
1339 |
}
|
1340 |
|
1341 |
/**
|
1342 |
-
* Get
|
1343 |
*
|
1344 |
* @since 1.0
|
1345 |
*/
|
@@ -1348,6 +1689,19 @@ class Codepress_Admin_Columns
|
|
1348 |
return plugins_url($file, __FILE__);
|
1349 |
}
|
1350 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1351 |
/**
|
1352 |
* Get a thumbnail
|
1353 |
*
|
@@ -1357,14 +1711,172 @@ class Codepress_Admin_Columns
|
|
1357 |
{
|
1358 |
if ( empty($image) )
|
1359 |
return false;
|
1360 |
-
|
|
|
1361 |
$image_path = str_replace( WP_CONTENT_URL, WP_CONTENT_DIR, $image);
|
1362 |
-
$new = image_resize( $image_path, 120, 80, true);
|
1363 |
|
1364 |
-
|
1365 |
-
|
|
|
1366 |
|
1367 |
-
|
1368 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1369 |
}
|
1370 |
?>
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Codepress Admin Columns
|
4 |
+
Version: 1.2
|
5 |
+
Description: This plugin makes it easy to Manage Custom Columns for your Posts, Pages and Custom Post Type Screens.
|
6 |
+
Author: Codepress
|
7 |
Author URI: http://www.codepress.nl
|
8 |
Plugin URI: http://www.codepress.nl/plugins/codepress-admin-columns/
|
9 |
Text Domain: codepress-admin-columns
|
26 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
27 |
*/
|
28 |
|
29 |
+
define( 'CPAC_VERSION', '1.2' );
|
30 |
|
31 |
/**
|
32 |
* Init Class
|
33 |
*
|
34 |
* @since 1.0
|
35 |
*/
|
36 |
+
new Codepress_Admin_Columns();
|
37 |
|
38 |
/**
|
39 |
* Advanced Admin Columns Class
|
47 |
$options,
|
48 |
$options_default,
|
49 |
$slug,
|
50 |
+
$textdomain,
|
51 |
+
$excerpt_length;
|
52 |
|
53 |
/**
|
54 |
* Construct
|
61 |
}
|
62 |
|
63 |
/**
|
64 |
+
* Initialize plugin.
|
65 |
*
|
66 |
* Loading sequence is determined and intialized.
|
67 |
*
|
68 |
* @since 1.0
|
69 |
*/
|
70 |
function init()
|
71 |
+
{
|
72 |
// vars
|
73 |
$this->post_types = $this->get_post_types();
|
74 |
+
|
|
|
|
|
|
|
75 |
// slug
|
76 |
$this->slug = 'codepress-admin-columns';
|
77 |
$this->textdomain = 'codepress-admin-columns';
|
78 |
|
79 |
+
// set excerpt length
|
80 |
+
$this->excerpt_length = 100;
|
81 |
+
|
82 |
// translations
|
83 |
load_plugin_textdomain( $this->textdomain, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
84 |
|
85 |
+
// actions
|
86 |
+
add_action( 'admin_menu', array( &$this, 'settings_menu') );
|
87 |
add_action( 'admin_init', array( &$this, 'register_settings') );
|
88 |
+
add_action( 'admin_init', array( &$this, 'register_columns' ) );
|
89 |
+
add_action( 'manage_pages_custom_column', array( &$this, 'manage_posts_column_value'), 10, 2 );
|
90 |
+
add_action( 'manage_posts_custom_column', array( &$this, 'manage_posts_column_value'), 10, 2 );
|
91 |
+
add_action( 'manage_users_custom_column', array( &$this, 'manage_users_column_value'), 10, 3 );
|
92 |
add_action( 'admin_print_styles' , array( &$this, 'column_styles') );
|
93 |
+
|
94 |
+
// handle requests gets a low priority so it will trigger when all other plugins have loaded their columns
|
95 |
+
add_action( 'admin_init', array( &$this, 'handle_requests' ), 1000 );
|
96 |
+
|
97 |
+
// filters
|
98 |
add_filter( 'request', array( &$this, 'handle_requests_orderby_column') );
|
99 |
+
add_filter( 'plugin_action_links', array( &$this, 'add_settings_link'), 1, 2);
|
100 |
}
|
101 |
|
102 |
/**
|
120 |
// Callback
|
121 |
array( &$this, 'plugin_settings_page')
|
122 |
);
|
123 |
+
|
124 |
+
// settings page specific styles and scripts
|
125 |
add_action( "admin_print_styles-$page", array( &$this, 'admin_styles') );
|
126 |
+
add_action( "admin_print_scripts-$page", array( &$this, 'admin_scripts') );
|
127 |
}
|
128 |
|
129 |
/**
|
147 |
*/
|
148 |
public function register_columns()
|
149 |
{
|
150 |
+
/** Posts */
|
151 |
+
foreach ( $this->post_types as $post_type ) {
|
152 |
+
|
153 |
// register column per post type
|
154 |
+
add_filter("manage_edit-{$post_type}_columns", array(&$this, 'callback_add_posts_column'));
|
155 |
|
156 |
// register column as sortable
|
157 |
+
add_filter( "manage_edit-{$post_type}_sortable_columns", array(&$this, 'callback_add_sortable_posts_column'));
|
158 |
+
}
|
159 |
+
|
160 |
+
/** Users */
|
161 |
+
add_filter( "manage_users_columns", array(&$this, 'callback_add_users_column'));
|
162 |
+
add_filter( "manage_users_sortable_columns", array(&$this, 'callback_add_sortable_users_column'));
|
163 |
}
|
164 |
|
165 |
/**
|
166 |
+
* Callback add Posts Column
|
167 |
*
|
168 |
* @since 1.0
|
169 |
*/
|
170 |
+
public function callback_add_posts_column($columns)
|
171 |
+
{
|
172 |
global $post_type;
|
173 |
+
|
174 |
+
return $this->add_managed_columns($post_type, $columns);
|
|
|
175 |
}
|
176 |
|
177 |
/**
|
178 |
+
* Callback add Users column
|
179 |
*
|
180 |
+
* @since 1.1
|
181 |
*/
|
182 |
+
public function callback_add_users_column($columns)
|
183 |
+
{
|
184 |
+
return $this->add_managed_columns('wp-users', $columns);
|
|
|
|
|
|
|
185 |
}
|
186 |
|
187 |
/**
|
188 |
+
* Add managed columns by Type
|
|
|
|
|
|
|
|
|
189 |
*
|
190 |
+
* @since 1.1
|
191 |
*/
|
192 |
+
private function add_managed_columns( $type = 'post', $columns )
|
193 |
{
|
194 |
+
// only get stored columns.. the rest we don't need
|
195 |
+
$db_columns = $this->get_stored_columns($type);
|
196 |
+
|
197 |
+
if ( !$db_columns )
|
198 |
+
return $columns;
|
199 |
+
|
200 |
+
// filter already loaded columns by plugins
|
201 |
+
$set_columns = $this->filter_preset_columns($columns, $type);
|
202 |
+
|
203 |
+
// loop through columns
|
204 |
+
foreach ( $db_columns as $id => $values ) {
|
|
|
|
|
|
|
|
|
205 |
|
206 |
+
// is active
|
207 |
+
if ( isset($values['state']) && $values['state'] == 'on' ){
|
208 |
+
|
209 |
+
// register format
|
210 |
+
$set_columns[$id] = $values['label'];
|
211 |
+
}
|
|
|
|
|
|
|
|
|
|
|
212 |
}
|
213 |
|
214 |
+
return $set_columns;
|
215 |
+
}
|
216 |
+
|
217 |
+
/**
|
218 |
+
* Callback add Posts sortable column
|
219 |
+
*
|
220 |
+
* @since 1.0
|
221 |
+
*/
|
222 |
+
public function callback_add_sortable_posts_column($columns)
|
223 |
+
{
|
224 |
+
global $post_type;
|
225 |
|
226 |
+
return $this->add_managed_sortable_columns($post_type, $columns);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
}
|
228 |
|
229 |
+
/**
|
230 |
+
* Callback add Users sortable column
|
231 |
+
*
|
232 |
+
* @since 1.1
|
233 |
+
*/
|
234 |
+
public function callback_add_sortable_users_column($columns)
|
235 |
+
{
|
236 |
+
return $this->add_managed_sortable_columns('wp-users', $columns);
|
237 |
+
}
|
238 |
+
|
239 |
+
/**
|
240 |
+
* Add managed sortable columns by Type
|
241 |
+
*
|
242 |
+
* @since 1.1
|
243 |
+
*/
|
244 |
+
private function add_managed_sortable_columns( $type = 'post', $columns )
|
245 |
+
{
|
246 |
+
$display_columns = $this->get_merged_columns($type);
|
247 |
+
|
248 |
+
if ( ! $display_columns )
|
249 |
+
return $columns;
|
250 |
+
|
251 |
+
foreach ( $display_columns as $id => $vars ) {
|
252 |
+
if ( isset($vars['options']['sortorder']) && $vars['options']['sortorder'] == 'on' ){
|
253 |
+
|
254 |
+
// register format
|
255 |
+
$columns[$id] = $this->sanitize_string($vars['label']);
|
256 |
+
}
|
257 |
+
}
|
258 |
+
return $columns;
|
259 |
+
}
|
260 |
+
|
261 |
/**
|
262 |
* Get a list of Column options per post type
|
263 |
*
|
264 |
* @since 1.0
|
265 |
*/
|
266 |
+
private function get_column_boxes($type)
|
267 |
{
|
268 |
// merge all columns
|
269 |
+
$display_columns = $this->get_merged_columns($type);
|
270 |
+
|
271 |
// define
|
272 |
$list = '';
|
273 |
|
274 |
// loop throught the active columns
|
275 |
if ( $display_columns ) {
|
276 |
+
foreach ( $display_columns as $id => $values ) {
|
277 |
|
278 |
// add items to the list
|
279 |
+
$list .= $this->get_box($type, $id, $values);
|
280 |
|
281 |
}
|
282 |
}
|
283 |
|
284 |
// custom field button
|
285 |
$button_add_column = '';
|
286 |
+
if ( $this->get_meta_by_type($type) )
|
287 |
$button_add_column = "<a href='javacript:;' class='cpac-add-customfield-column button'>+ " . __('Add Custom Field Column') . "</a>";
|
288 |
|
289 |
return "
|
302 |
*
|
303 |
* @since 1.0
|
304 |
*/
|
305 |
+
private function get_merged_columns( $type )
|
306 |
{
|
307 |
//get saved database columns
|
308 |
+
$db_columns = $this->get_stored_columns($type);
|
309 |
+
|
310 |
+
/** Users */
|
311 |
+
if ( $type == 'wp-users' ) {
|
312 |
+
$wp_default_columns = $this->get_wp_default_users_columns();
|
313 |
+
$wp_custom_columns = $this->get_custom_users_columns();
|
314 |
+
}
|
315 |
|
316 |
+
/** Posts */
|
317 |
+
else {
|
318 |
+
$wp_default_columns = $this->get_wp_default_posts_columns($type);
|
319 |
+
$wp_custom_columns = $this->get_custom_posts_columns($type);
|
320 |
+
}
|
321 |
+
|
322 |
+
// merge columns
|
323 |
$default_columns = wp_parse_args($wp_custom_columns, $wp_default_columns);
|
324 |
+
|
325 |
// loop throught the active columns
|
326 |
if ( $db_columns ) {
|
327 |
+
|
328 |
+
// let's remove any unavailable columns.. such as disabled plugins
|
329 |
+
$db_columns = $this->remove_unavailable_columns($db_columns, $default_columns);
|
330 |
+
|
331 |
+
foreach ( $db_columns as $id => $values ) {
|
332 |
|
333 |
// get column meta options from custom columns
|
334 |
+
if ( $this->is_column_meta($id) )
|
335 |
+
$db_columns[$id]['options'] = $wp_custom_columns['column-meta-1']['options'];
|
336 |
|
337 |
// add static options
|
338 |
+
elseif ( isset($default_columns[$id]['options']) )
|
339 |
+
$db_columns[$id]['options'] = $default_columns[$id]['options'];
|
340 |
|
341 |
+
unset($default_columns[$id]);
|
342 |
}
|
343 |
}
|
344 |
|
345 |
// merge all
|
346 |
+
$display_columns = wp_parse_args($db_columns, $default_columns);
|
347 |
+
|
348 |
return $display_columns;
|
349 |
}
|
350 |
+
|
351 |
+
/**
|
352 |
+
* Remove deactivated (plugin) columns
|
353 |
+
*
|
354 |
+
* This will remove any columns that have been stored, but are no longer available. This happends
|
355 |
+
* when plugins are deactivated or when they are removed from the theme functions.
|
356 |
+
*
|
357 |
+
* @since 1.2
|
358 |
+
*/
|
359 |
+
private function remove_unavailable_columns( array $db_columns, array $default_columns)
|
360 |
+
{
|
361 |
+
// check or differences
|
362 |
+
$diff = array_diff( array_keys($db_columns), array_keys($default_columns) );
|
363 |
+
if ( ! empty($diff) && is_array($diff) ) {
|
364 |
+
foreach ( $diff as $column_name ){
|
365 |
+
// make an exception for column-meta-xxx
|
366 |
+
if ( ! $this->is_column_meta($column_name) ) {
|
367 |
+
unset($db_columns[$column_name]);
|
368 |
+
}
|
369 |
+
}
|
370 |
+
}
|
371 |
+
|
372 |
+
return $db_columns;
|
373 |
+
}
|
374 |
+
|
375 |
/**
|
376 |
* Get checkbox
|
377 |
*
|
378 |
* @since 1.0
|
379 |
*/
|
380 |
+
private function get_box($type, $id, $values)
|
381 |
{
|
382 |
$classes = array();
|
383 |
|
384 |
// set state
|
385 |
$state = isset($values['state']) ? $values['state'] : '';
|
386 |
|
|
|
|
|
|
|
387 |
// class
|
388 |
+
$classes[] = "cpac-box-{$id}";
|
389 |
if ( $state )
|
390 |
$classes[] = 'active';
|
391 |
if ( ! empty($values['options']['class']) )
|
393 |
$class = implode(' ', $classes);
|
394 |
|
395 |
// more box options
|
396 |
+
$more_options = $this->get_additional_box_options($type, $id, $values);
|
397 |
$action = "<a class='cpac-action' href='#open'>open</a>";
|
398 |
+
|
399 |
+
// type label
|
400 |
+
$type_label = isset($values['options']['type_label']) ? $values['options']['type_label'] : '';
|
401 |
+
|
402 |
+
// label
|
403 |
+
$label = isset($values['label']) ? str_replace("'", '"', $values['label']) : '';
|
404 |
|
405 |
// hide box options
|
406 |
+
if ( ! empty($values['options']['hide_options']) || strpos($label, '<img') !== false ) {
|
407 |
$action = $more_options = '';
|
408 |
}
|
409 |
|
413 |
<div class='cpac-type-options'>
|
414 |
|
415 |
<div class='cpac-checkbox'></div>
|
416 |
+
<input type='hidden' class='cpac-state' name='cpac_options[columns][{$type}][{$id}][state]' value='{$state}'/>
|
|
|
417 |
<label class='main-label'>{$values['label']}</label>
|
418 |
</div>
|
419 |
<div class='cpac-meta-title'>
|
420 |
{$action}
|
421 |
+
<span>{$type_label}</span>
|
422 |
</div>
|
423 |
<div class='cpac-type-inside'>
|
424 |
+
<label for='cpac_options[columns][{$type}][{$id}][label]'>Label: </label>
|
425 |
+
<input type='text' name='cpac_options[columns][{$type}][{$id}][label]' value='{$label}' class='text'/>
|
426 |
<br/>
|
427 |
{$more_options}
|
428 |
</div>
|
437 |
*
|
438 |
* @since 1.0
|
439 |
*/
|
440 |
+
private function get_additional_box_options($post_type, $id, $values)
|
441 |
{
|
442 |
$fields = '';
|
443 |
|
444 |
// Custom Fields
|
445 |
+
if ( $this->is_column_meta($id) )
|
446 |
+
$fields .= $this->get_box_options_customfields($post_type, $id, $values);
|
447 |
|
448 |
return $fields;
|
449 |
}
|
453 |
*
|
454 |
* @since 1.0
|
455 |
*/
|
456 |
+
private function get_box_options_customfields($type, $id, $values)
|
457 |
{
|
458 |
// get post meta fields
|
459 |
+
$fields = $this->get_meta_by_type($type);
|
460 |
|
461 |
if ( empty($fields) )
|
462 |
return false;
|
483 |
'library_id' => __('Media Library Icon', $this->textdomain),
|
484 |
'excerpt' => __('Excerpt'),
|
485 |
'array' => __('Multiple Values', $this->textdomain),
|
486 |
+
'numeric' => __('Numeric', $this->textdomain),
|
487 |
);
|
488 |
|
489 |
+
// add filter
|
490 |
+
$fieldtypes = apply_filters('cpac-field-types', $fieldtypes );
|
491 |
+
|
492 |
+
// set select options
|
493 |
foreach ( $fieldtypes as $fkey => $fieldtype ) {
|
494 |
$fieldtype_options .= sprintf
|
495 |
(
|
500 |
);
|
501 |
}
|
502 |
|
503 |
+
// before and after string
|
504 |
+
$before = ! empty($values['before']) ? $values['before'] : '' ;
|
505 |
+
$after = ! empty($values['after']) ? $values['after'] : '' ;
|
506 |
+
|
507 |
if ( empty($field_options) )
|
508 |
return false;
|
509 |
|
510 |
// add remove button
|
511 |
$remove = '<p class="remove-description description">'.__('This field can not be removed', $this->textdomain).'</p>';
|
512 |
+
if ( $id != 'column-meta-1') {
|
513 |
$remove = "
|
514 |
<p>
|
515 |
<a href='javascript:;' class='cpac-delete-custom-field-box'>".__('Remove')."</a>
|
518 |
}
|
519 |
|
520 |
$inside = "
|
521 |
+
<label for='cpac_options[columns][{$type}][{$id}][field]'>Custom Field: </label>
|
522 |
+
<select name='cpac_options[columns][{$type}][{$id}][field]'>{$field_options}</select>
|
523 |
<br/>
|
524 |
+
<label for='cpac_options[columns][{$type}][{$id}][field_type]'>Field Type: </label>
|
525 |
+
<select name='cpac_options[columns][{$type}][{$id}][field_type]'>{$fieldtype_options}</select>
|
526 |
<br/>
|
527 |
+
<label for='cpac_options[columns][{$type}][{$id}][before]'>Before: </label>
|
528 |
+
<input type='text' class='cpac-before' name='cpac_options[columns][{$type}][{$id}][before]' value='{$before}'/>
|
529 |
+
<br/>
|
530 |
+
<label for='cpac_options[columns][{$type}][{$id}][before]'>After: </label>
|
531 |
+
<input type='text' class='cpac-after' name='cpac_options[columns][{$type}][{$id}][after]' value='{$after}'/>
|
532 |
+
<br/>
|
533 |
{$remove}
|
534 |
";
|
535 |
|
537 |
}
|
538 |
|
539 |
/**
|
540 |
+
* Get post meta fields by type; post(types) or users.
|
541 |
*
|
542 |
* @since 1.0
|
543 |
*/
|
544 |
+
private function get_meta_by_type($type = 'post')
|
545 |
{
|
546 |
global $wpdb;
|
|
|
|
|
|
|
547 |
|
548 |
+
/** Users */
|
549 |
+
if ( $type == 'wp-users') {
|
550 |
+
$sql = 'SELECT DISTINCT meta_key FROM '.$wpdb->usermeta.' ORDER BY 1';
|
551 |
+
}
|
552 |
+
|
553 |
+
/** Posts */
|
554 |
+
else {
|
555 |
+
$sql = 'SELECT DISTINCT meta_key FROM '.$wpdb->postmeta.' pm JOIN '.$wpdb->posts.' p ON pm.post_id = p.ID WHERE p.post_type = "' . mysql_real_escape_string($type) . '" ORDER BY 1';
|
556 |
+
}
|
557 |
+
|
558 |
+
// run sql
|
559 |
+
$fields = $wpdb->get_results($sql, ARRAY_N);
|
560 |
+
|
561 |
// postmeta
|
562 |
if ( $fields ) {
|
563 |
$meta_fields = array();
|
567 |
$meta_fields[] = $field[0];
|
568 |
}
|
569 |
}
|
|
|
570 |
return $meta_fields;
|
571 |
+
}
|
572 |
|
573 |
return false;
|
574 |
}
|
578 |
*
|
579 |
* @since 1.0
|
580 |
*/
|
581 |
+
public function admin_scripts()
|
582 |
{
|
583 |
+
wp_enqueue_script( 'cpac-admin', $this->plugin_url('/assets/js/admin-column.js'), array('jquery', 'dashboard', 'jquery-ui-sortable'), CPAC_VERSION );
|
|
|
|
|
584 |
}
|
585 |
+
|
586 |
+
/**
|
587 |
+
* Get column types
|
588 |
+
*
|
589 |
+
* @since 1.1
|
590 |
+
*/
|
591 |
+
private function get_types()
|
592 |
+
{
|
593 |
+
$types = $this->post_types;
|
594 |
+
$types['wp-users'] = 'wp-users';
|
595 |
+
|
596 |
+
return $types;
|
597 |
+
}
|
598 |
+
|
599 |
/**
|
600 |
* Get post types
|
601 |
*
|
640 |
public function register_settings()
|
641 |
{
|
642 |
// If we have no options in the database, let's add them now.
|
643 |
+
if ( false === get_option('cpac_options') )
|
644 |
add_option( 'cpac_options', array(&$this, 'get_default_plugin_options') );
|
645 |
|
646 |
register_setting( 'cpac-settings-group', 'cpac_options', array(&$this, 'options_callback') );
|
661 |
}
|
662 |
|
663 |
/**
|
664 |
+
* Optional callback.
|
665 |
*
|
666 |
* @since 1.0
|
667 |
*/
|
675 |
*
|
676 |
* @since 1.0
|
677 |
*/
|
678 |
+
public function handle_requests()
|
679 |
{
|
680 |
// settings updated
|
681 |
+
if ( ! empty($_REQUEST['settings-updated']) )
|
682 |
+
$this->store_wp_default_columns();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
683 |
|
684 |
// restore defaults
|
685 |
+
if ( ! empty($_REQUEST['cpac-restore-defaults']) )
|
686 |
$this->restore_defaults();
|
687 |
+
|
688 |
+
}
|
689 |
+
|
690 |
+
/**
|
691 |
+
* Stores WP default columns
|
692 |
+
*
|
693 |
+
* This will store columns that are set by WordPress core or
|
694 |
+
* set by the theme for page, post(types) and user columns
|
695 |
+
*
|
696 |
+
* @since 1.2
|
697 |
+
*/
|
698 |
+
private function store_wp_default_columns()
|
699 |
+
{
|
700 |
+
// stores the default columns that are set by WP or set in the theme.
|
701 |
+
$wp_default_columns = array();
|
702 |
+
|
703 |
+
// Posts
|
704 |
+
foreach ( $this->post_types as $post_type ) {
|
705 |
+
$wp_default_columns[$post_type] = $this->get_wp_default_posts_columns($post_type);
|
706 |
+
}
|
707 |
+
|
708 |
+
// Users
|
709 |
+
$wp_default_columns['wp-users'] = $this->get_wp_default_users_columns();
|
710 |
+
|
711 |
+
update_option( 'cpac_options_default', $wp_default_columns );
|
712 |
}
|
713 |
|
714 |
/**
|
727 |
*
|
728 |
* @since 1.0
|
729 |
*/
|
730 |
+
private function get_post_excerpt($post_id)
|
731 |
{
|
732 |
+
global $post;
|
733 |
+
|
734 |
$save_post = $post;
|
735 |
$post = get_post($post_id);
|
736 |
$excerpt = get_the_excerpt();
|
737 |
$post = $save_post;
|
738 |
|
739 |
+
$output = $this->get_shortened_string($excerpt, $this->excerpt_length );
|
740 |
|
741 |
return $output;
|
742 |
}
|
769 |
*
|
770 |
* @since 1.0
|
771 |
*/
|
772 |
+
public function manage_posts_column_value($column_name, $post_id)
|
773 |
{
|
774 |
+
$type = $column_name;
|
775 |
|
776 |
// Check for taxonomies, such as column-taxonomy-[taxname]
|
777 |
if ( strpos($type, 'column-taxonomy-') !== false )
|
778 |
$type = 'column-taxonomy';
|
779 |
|
780 |
// Check for custom fields, such as column-meta-[customfieldname]
|
781 |
+
if ( $this->is_column_meta($type) )
|
782 |
+
$type = 'column-post-meta';
|
783 |
|
784 |
// Hook
|
785 |
+
do_action('cpac-manage-posts-column', $type, $column_name, $post_id);
|
786 |
|
787 |
// Switch Types
|
788 |
$result = '';
|
836 |
$result = get_post($post_id)->post_name;
|
837 |
break;
|
838 |
|
839 |
+
// Slug
|
840 |
+
case "column-word-count" :
|
841 |
+
$result = str_word_count( strip_tags( get_post($post_id)->post_content ) );
|
842 |
+
break;
|
843 |
+
|
844 |
// Taxonomy
|
845 |
case "column-taxonomy" :
|
846 |
+
$tax = str_replace('column-taxonomy-', '', $column_name);
|
847 |
$tags = get_the_terms($post_id, $tax);
|
848 |
$tarr = array();
|
849 |
if ( $tax == 'post_format' && empty($tags) ) {
|
858 |
break;
|
859 |
|
860 |
// Custom Field
|
861 |
+
case "column-post-meta" :
|
862 |
+
$result = $this->get_column_value_custom_field($post_id, $column_name, 'post');
|
863 |
break;
|
864 |
|
865 |
// Attachment
|
868 |
break;
|
869 |
|
870 |
default :
|
871 |
+
$result = get_post_meta( $post_id, $column_name, true );
|
872 |
|
873 |
endswitch;
|
874 |
|
877 |
|
878 |
echo $result;
|
879 |
}
|
880 |
+
|
881 |
/**
|
882 |
+
* Manage custom column for Users.
|
883 |
*
|
884 |
+
* @since 1.1
|
885 |
*/
|
886 |
+
public function manage_users_column_value( $value, $column_name, $user_id )
|
887 |
{
|
888 |
+
$type = $column_name;
|
889 |
+
|
890 |
+
$userdata = get_userdata( $user_id );
|
891 |
+
|
892 |
+
if ( ! $userdata )
|
893 |
+
return false;
|
894 |
+
|
895 |
+
// Check for user custom fields, such as column-meta-[customfieldname]
|
896 |
+
if ( $this->is_column_meta($type) )
|
897 |
+
$type = 'column-user-meta';
|
898 |
+
|
899 |
+
// Hook
|
900 |
+
do_action('cpac-manage-users-column', $type, $column_name, $user_id);
|
901 |
+
|
902 |
$result = '';
|
903 |
+
switch ($type) :
|
904 |
+
|
905 |
+
// user id
|
906 |
+
case "column-user_id" :
|
907 |
+
$result = $user_id;
|
908 |
+
break;
|
909 |
+
|
910 |
+
// first name
|
911 |
+
case "column-first_name" :
|
912 |
+
$result = $userdata->first_name;
|
913 |
+
break;
|
914 |
+
|
915 |
+
// last name
|
916 |
+
case "column-last_name" :
|
917 |
+
$result = $userdata->last_name;
|
918 |
+
break;
|
919 |
+
|
920 |
+
// user url
|
921 |
+
case "column-user_url" :
|
922 |
+
$result = $userdata->user_url;
|
923 |
+
break;
|
924 |
+
|
925 |
+
// user registration date
|
926 |
+
case "column-user_registered" :
|
927 |
+
$result = $userdata->user_registered;
|
928 |
+
break;
|
929 |
+
|
930 |
+
// user description
|
931 |
+
case "column-user_description" :
|
932 |
+
$result = $this->get_shortened_string( get_the_author_meta('user_description', $user_id), $this->excerpt_length );
|
933 |
+
break;
|
934 |
+
|
935 |
+
// user meta data ( custom field )
|
936 |
+
case "column-user-meta" :
|
937 |
+
$result = $this->get_column_value_custom_field($user_id, $column_name, 'user');
|
938 |
+
break;
|
939 |
+
|
940 |
+
default :
|
941 |
+
$result = get_user_meta( $user_id, $column_name, true );
|
942 |
+
|
943 |
+
endswitch;
|
944 |
+
|
945 |
+
if ( empty($result) )
|
946 |
+
$result = ' ';
|
947 |
+
|
948 |
+
return $result;
|
949 |
+
}
|
950 |
+
|
951 |
+
/**
|
952 |
+
* Get column value of post attachments
|
953 |
+
*
|
954 |
+
* @since 1.0
|
955 |
+
*/
|
956 |
+
private function get_column_value_attachments( $post_id )
|
957 |
+
{
|
958 |
+
$result = '';
|
959 |
+
$attachments = get_posts(array(
|
960 |
+
'post_type' => 'attachment',
|
961 |
+
'numberposts' => -1,
|
962 |
+
'post_status' => null,
|
963 |
+
'post_parent' => $post_id
|
964 |
+
));
|
965 |
+
if ( $attachments ) {
|
966 |
+
foreach ( $attachments as $attach ) {
|
967 |
$result .= wp_get_attachment_image( $attach->ID, array(80,80), true );
|
968 |
}
|
969 |
}
|
974 |
* Get column value of Custom Field
|
975 |
*
|
976 |
* @since 1.0
|
977 |
+
*/
|
978 |
+
private function get_column_value_custom_field($object_id, $column_name, $meta_type = 'post')
|
979 |
{
|
980 |
+
/** Users */
|
981 |
+
if ( $meta_type == 'user' ) {
|
982 |
+
$type = 'wp-users';
|
983 |
+
}
|
984 |
+
|
985 |
+
/** Posts */
|
986 |
+
else {
|
987 |
+
$type = get_post_type($object_id);
|
988 |
+
}
|
989 |
+
|
990 |
+
// get column
|
991 |
+
$columns = $this->get_stored_columns($type);
|
992 |
+
|
993 |
+
// inputs
|
994 |
+
$field = isset($columns[$column_name]['field']) ? $columns[$column_name]['field'] : '';
|
995 |
+
$fieldtype = isset($columns[$column_name]['field_type']) ? $columns[$column_name]['field_type'] : '';
|
996 |
+
$before = isset($columns[$column_name]['before']) ? $columns[$column_name]['before'] : '';
|
997 |
+
$after = isset($columns[$column_name]['after']) ? $columns[$column_name]['after'] : '';
|
998 |
|
999 |
// Get meta field value
|
1000 |
+
$meta = get_metadata($meta_type, $object_id, $field, true);
|
1001 |
|
1002 |
// multiple meta values
|
1003 |
if ( ( $fieldtype == 'array' && is_array($meta) ) || is_array($meta) ) {
|
1004 |
+
$meta = get_metadata($meta_type, $object_id, $field, true);
|
1005 |
$meta = $this->recursive_implode(', ', $meta);
|
1006 |
}
|
1007 |
|
1025 |
|
1026 |
// Excerpt
|
1027 |
case "excerpt" :
|
1028 |
+
$meta = $this->get_shortened_string($meta, $this->excerpt_length);
|
1029 |
+
break;
|
1030 |
+
|
1031 |
+
endswitch;
|
1032 |
+
|
1033 |
+
// add before and after string
|
1034 |
+
$meta = "{$before}{$meta}{$after}";
|
1035 |
+
|
1036 |
+
return $meta;
|
1037 |
+
}
|
1038 |
+
|
1039 |
+
/**
|
1040 |
+
* Get column value of Custom Field
|
1041 |
+
*
|
1042 |
+
* @since 1.2
|
1043 |
+
*/
|
1044 |
+
private function get_user_column_value_custom_field($user_id, $id)
|
1045 |
+
{
|
1046 |
+
$columns = $this->get_stored_columns('wp-users');
|
1047 |
+
|
1048 |
+
// inputs
|
1049 |
+
$field = isset($columns[$id]['field']) ? $columns[$id]['field'] : '';
|
1050 |
+
$fieldtype = isset($columns[$id]['field_type']) ? $columns[$id]['field_type'] : '';
|
1051 |
+
$before = isset($columns[$id]['before']) ? $columns[$id]['before'] : '';
|
1052 |
+
$after = isset($columns[$id]['after']) ? $columns[$id]['after'] : '';
|
1053 |
+
|
1054 |
+
// Get meta field value
|
1055 |
+
$meta = get_user_meta($user_id, $field, true);
|
1056 |
+
|
1057 |
+
// multiple meta values
|
1058 |
+
if ( ( $fieldtype == 'array' && is_array($meta) ) || is_array($meta) ) {
|
1059 |
+
$meta = get_user_meta($user_id, $field);
|
1060 |
+
$meta = $this->recursive_implode(', ', $meta);
|
1061 |
+
}
|
1062 |
+
|
1063 |
+
// make sure there are no serialized arrays or empty meta data
|
1064 |
+
if ( empty($meta) || !is_string($meta) )
|
1065 |
+
return false;
|
1066 |
+
|
1067 |
+
// handles each field type differently..
|
1068 |
+
switch ($fieldtype) :
|
1069 |
+
|
1070 |
+
// Image
|
1071 |
+
case "image" :
|
1072 |
+
$meta = $this->get_thumbnail($meta);
|
1073 |
+
break;
|
1074 |
+
|
1075 |
+
// Media Library ID
|
1076 |
+
case "library_id" :
|
1077 |
+
$meta = wp_get_attachment_url($meta) ? wp_get_attachment_image( $meta, array(80,80), true ) : '';
|
1078 |
+
break;
|
1079 |
+
|
1080 |
+
// Excerpt
|
1081 |
+
case "excerpt" :
|
1082 |
+
$meta = $this->get_shortened_string($meta, $this->excerpt_length);
|
1083 |
break;
|
1084 |
|
1085 |
endswitch;
|
1086 |
|
1087 |
+
// add before and after string
|
1088 |
+
$meta = "{$before}{$meta}{$after}";
|
1089 |
+
|
1090 |
return $meta;
|
1091 |
}
|
1092 |
|
1105 |
$retVal[] = $r_pieces;
|
1106 |
}
|
1107 |
}
|
1108 |
+
if ( isset($retVal) && is_array($retVal) )
|
1109 |
+
return implode( $glue, $retVal );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1110 |
|
1111 |
+
return false;
|
1112 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1113 |
|
1114 |
/**
|
1115 |
* Set columns. These columns apply either for every post or set by a plugin.
|
1116 |
*
|
1117 |
* @since 1.0
|
1118 |
*/
|
1119 |
+
private function filter_preset_columns($columns, $type = 'post')
|
1120 |
{
|
1121 |
+
$options = get_option('cpac_options_default');
|
1122 |
|
1123 |
if ( !$options )
|
1124 |
return $columns;
|
1125 |
|
1126 |
// we use the wp default columns for filtering...
|
1127 |
+
$stored_wp_default_columns = $options[$type];
|
1128 |
|
1129 |
// ... the ones that are set by plugins, theme functions and such.
|
1130 |
+
$dif_columns = array_diff(array_keys($columns), array_keys($stored_wp_default_columns));
|
1131 |
+
|
1132 |
// we add those to the columns
|
1133 |
$pre_columns = array();
|
1134 |
if ( $dif_columns ) {
|
1138 |
}
|
1139 |
|
1140 |
return $pre_columns;
|
1141 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1142 |
|
1143 |
/**
|
1144 |
* Get WP default supported admin columns per post type.
|
1145 |
*
|
1146 |
* @since 1.0
|
1147 |
*/
|
1148 |
+
private function get_wp_default_posts_columns($post_type = 'post')
|
1149 |
{
|
1150 |
+
// load dependencies
|
1151 |
+
// deprecated sinces wp3.3
|
1152 |
+
if ( file_exists(ABSPATH . 'wp-admin/includes/template.php') )
|
1153 |
+
require_once(ABSPATH . 'wp-admin/includes/template.php');
|
1154 |
+
// introduced since wp3.3
|
1155 |
+
if ( file_exists(ABSPATH . 'wp-admin/includes/screen.php') )
|
1156 |
+
require_once(ABSPATH . 'wp-admin/includes/screen.php');
|
1157 |
+
// used for getting columns
|
1158 |
+
if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
|
1159 |
+
require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
|
1160 |
+
if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-posts-list-table.php') )
|
1161 |
+
require_once(ABSPATH . 'wp-admin/includes/class-wp-posts-list-table.php');
|
1162 |
|
1163 |
// we need to change the current screen
|
1164 |
global $current_screen;
|
1170 |
// ...so we can get its columns
|
1171 |
$columns = WP_Posts_List_Table::get_columns();
|
1172 |
|
1173 |
+
if ( empty ( $columns ) )
|
1174 |
+
return false;
|
1175 |
+
|
1176 |
+
// change to uniform format
|
1177 |
+
$posts_columns = $this->get_uniform_format($columns);
|
1178 |
+
|
1179 |
+
// reset current screen
|
1180 |
+
$current_screen = $org_current_screen;
|
1181 |
+
|
1182 |
+
return $posts_columns;
|
1183 |
+
}
|
1184 |
+
|
1185 |
+
/**
|
1186 |
+
* Get WP default users columns per post type.
|
1187 |
+
*
|
1188 |
+
* @since 1.1
|
1189 |
+
*/
|
1190 |
+
private function get_wp_default_users_columns()
|
1191 |
+
{
|
1192 |
+
if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
|
1193 |
+
require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
|
1194 |
+
if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-users-list-table.php') )
|
1195 |
+
require_once(ABSPATH . 'wp-admin/includes/class-wp-users-list-table.php');
|
1196 |
+
|
1197 |
+
// turn off site users
|
1198 |
+
$this->is_site_users = false;
|
1199 |
+
|
1200 |
+
// get users columns
|
1201 |
+
$columns = WP_Users_List_Table::get_columns();
|
1202 |
+
|
1203 |
+
// change to uniform format
|
1204 |
+
$users_columns = $this->get_uniform_format($columns);
|
1205 |
+
|
1206 |
+
return $users_columns;
|
1207 |
+
}
|
1208 |
+
|
1209 |
+
/**
|
1210 |
+
* Build uniform format for all columns
|
1211 |
+
*
|
1212 |
+
* @since 1.0
|
1213 |
+
*/
|
1214 |
+
private function get_uniform_format($columns)
|
1215 |
+
{
|
1216 |
// we remove the checkbox column as an option...
|
1217 |
+
if ( isset($columns['cb']) )
|
1218 |
+
unset($columns['cb']);
|
1219 |
|
1220 |
// change to uniform format
|
1221 |
$uniform_columns = array();
|
1222 |
+
foreach ( (array) $columns as $id => $label ) {
|
1223 |
$hide_options = false;
|
1224 |
$type_label = $label;
|
1225 |
|
1228 |
$type_label = __('Comments', $this->textdomain);
|
1229 |
$hide_options = true;
|
1230 |
}
|
1231 |
+
|
1232 |
+
$uniform_colums[$id] = array(
|
1233 |
'label' => $label,
|
1234 |
'state' => 'on',
|
1235 |
'options' => array(
|
1239 |
)
|
1240 |
);
|
1241 |
}
|
|
|
|
|
|
|
|
|
1242 |
return $uniform_colums;
|
1243 |
}
|
1244 |
+
|
1245 |
/**
|
1246 |
+
* Custom posts columns
|
1247 |
*
|
1248 |
* @since 1.0
|
1249 |
*/
|
1250 |
+
private function get_custom_posts_columns($post_type)
|
1251 |
{
|
1252 |
$custom_columns = array();
|
1253 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1254 |
// Thumbnail support
|
1255 |
if ( post_type_supports($post_type, 'thumbnail') ) {
|
1256 |
+
$custom_columns['column-featured_image'] = array(
|
1257 |
'label' => __('Featured Image', $this->textdomain),
|
1258 |
'options' => array(
|
1259 |
'type_label' => __('Image', $this->textdomain)
|
1260 |
)
|
1261 |
+
);
|
1262 |
}
|
1263 |
|
1264 |
// Excerpt support
|
1265 |
if ( post_type_supports($post_type, 'editor') ) {
|
1266 |
+
$custom_columns['column-excerpt'] = array(
|
1267 |
'label' => __('Excerpt', $this->textdomain),
|
1268 |
'options' => array(
|
1269 |
'type_label' => __('Excerpt', $this->textdomain)
|
1270 |
)
|
1271 |
+
);
|
1272 |
}
|
1273 |
|
1274 |
// Sticky support
|
1275 |
if ( $post_type == 'post' ) {
|
1276 |
+
$custom_columns['column-sticky'] = array(
|
1277 |
'label' => __('Sticky', $this->textdomain),
|
1278 |
'options' => array(
|
1279 |
'type_label' => __('Sticky', $this->textdomain)
|
1280 |
)
|
1281 |
+
);
|
1282 |
}
|
1283 |
|
1284 |
// Order support
|
1285 |
if ( post_type_supports($post_type, 'page-attributes') ) {
|
1286 |
+
$custom_columns['column-order'] = array(
|
1287 |
+
'label' => __('Page Order', $this->textdomain),
|
|
|
1288 |
'options' => array(
|
1289 |
+
'type_label' => __('Order', $this->textdomain),
|
1290 |
+
'sortorder' => 'on',
|
1291 |
)
|
1292 |
+
);
|
1293 |
}
|
1294 |
|
1295 |
// Page Template
|
1296 |
if ( $post_type == 'page' ) {
|
1297 |
+
$custom_columns['column-page-template'] = array(
|
1298 |
'label' => __('Page Template', $this->textdomain),
|
|
|
1299 |
'options' => array(
|
1300 |
+
'type_label' => __('Page Template', $this->textdomain),
|
1301 |
+
'sortorder' => 'on',
|
1302 |
)
|
1303 |
+
);
|
1304 |
}
|
1305 |
|
1306 |
// Post Formats
|
1307 |
if ( post_type_supports($post_type, 'post-formats') ) {
|
1308 |
+
$custom_columns['column-post_formats'] = array(
|
1309 |
'label' => __('Post Format', $this->textdomain),
|
1310 |
'options' => array(
|
1311 |
'type_label' => __('Post Format', $this->textdomain)
|
1312 |
)
|
1313 |
+
);
|
1314 |
}
|
1315 |
|
1316 |
// Taxonomy support
|
1318 |
if ( $taxonomies ) {
|
1319 |
foreach ( $taxonomies as $tax_slug => $tax ) {
|
1320 |
if ( $tax_slug != 'post_tag' && $tax_slug != 'category' && $tax_slug != 'post_format' ) {
|
1321 |
+
$custom_columns['column-taxonomy-'.$tax->name] = array(
|
1322 |
'label' => $tax->label,
|
1323 |
'options' => array(
|
1324 |
'type_label' => __('Taxonomy', $this->textdomain)
|
1325 |
)
|
1326 |
+
);
|
1327 |
}
|
1328 |
}
|
1329 |
}
|
1330 |
|
1331 |
// Post ID support
|
1332 |
+
$custom_columns['column-postid'] = array(
|
1333 |
+
'label' => 'ID',
|
|
|
1334 |
'options' => array(
|
1335 |
'type_label' => 'ID',
|
1336 |
+
'sortorder' => 'on',
|
1337 |
)
|
1338 |
+
);
|
1339 |
|
1340 |
// Slug support
|
1341 |
+
$custom_columns['column-page-slug'] = array(
|
1342 |
'label' => __('Slug', $this->textdomain),
|
|
|
1343 |
'options' => array(
|
1344 |
'type_label' => __('Slug', $this->textdomain),
|
1345 |
+
'sortorder' => 'on',
|
1346 |
)
|
1347 |
+
);
|
1348 |
+
|
1349 |
+
// Word count support
|
1350 |
+
$custom_columns['column-word-count'] = array(
|
1351 |
+
'label' => __('Word count', $this->textdomain),
|
1352 |
+
'options' => array(
|
1353 |
+
'type_label' => __('Word count', $this->textdomain),
|
1354 |
+
)
|
1355 |
+
);
|
1356 |
|
1357 |
// Attachment support
|
1358 |
+
$custom_columns['column-attachment'] = array(
|
1359 |
'label' => __('Attachment', $this->textdomain),
|
|
|
1360 |
'options' => array(
|
1361 |
+
'type_label' => __('Attachment', $this->textdomain),
|
1362 |
+
'sortorder' => 'on',
|
1363 |
)
|
1364 |
+
);
|
1365 |
|
1366 |
// Custom Field support
|
1367 |
+
if ( $this->get_meta_by_type($post_type) ) {
|
1368 |
+
$custom_columns['column-meta-1'] = array(
|
1369 |
'label' => __('Custom Field', $this->textdomain),
|
1370 |
'field' => '',
|
1371 |
'field_type' => '',
|
1372 |
+
'before' => '',
|
1373 |
+
'after' => '',
|
1374 |
'options' => array(
|
1375 |
'type_label' => __('Field', $this->textdomain),
|
1376 |
+
'class' => 'cpac-box-metafield',
|
1377 |
+
'sortorder' => 'on',
|
1378 |
)
|
1379 |
+
);
|
1380 |
}
|
1381 |
|
1382 |
+
// merge with defaults
|
1383 |
+
$custom_columns = $this->parse_defaults($custom_columns);
|
1384 |
+
|
1385 |
+
return apply_filters('cpac-custom-posts-columns', $custom_columns);
|
1386 |
+
}
|
1387 |
+
|
1388 |
+
/**
|
1389 |
+
* Custom users columns
|
1390 |
+
*
|
1391 |
+
* @since 1.1
|
1392 |
+
*/
|
1393 |
+
private function get_custom_users_columns()
|
1394 |
+
{
|
1395 |
+
$custom_columns = array();
|
1396 |
+
|
1397 |
+
// User ID
|
1398 |
+
$custom_columns['column-user_id'] = array(
|
1399 |
+
'label' => __('User ID', $this->textdomain),
|
1400 |
+
'options' => array(
|
1401 |
+
'type_label' => __('User ID', $this->textdomain),
|
1402 |
+
'sortorder' => 'on'
|
1403 |
+
)
|
1404 |
+
);
|
1405 |
+
|
1406 |
+
// First name
|
1407 |
+
$custom_columns['column-first_name'] = array(
|
1408 |
+
'label' => __('First name', $this->textdomain),
|
1409 |
+
'options' => array(
|
1410 |
+
'type_label' => __('First name', $this->textdomain),
|
1411 |
+
)
|
1412 |
+
);
|
1413 |
+
|
1414 |
+
// Last name
|
1415 |
+
$custom_columns['column-last_name'] = array(
|
1416 |
+
'label' => __('Last name', $this->textdomain),
|
1417 |
+
'options' => array(
|
1418 |
+
'type_label' => __('Last name', $this->textdomain),
|
1419 |
+
)
|
1420 |
+
);
|
1421 |
+
|
1422 |
+
// User url
|
1423 |
+
$custom_columns['column-user_url'] = array(
|
1424 |
+
'label' => __('Url', $this->textdomain),
|
1425 |
+
'options' => array(
|
1426 |
+
'type_label' => __('Url', $this->textdomain),
|
1427 |
+
)
|
1428 |
+
);
|
1429 |
+
|
1430 |
+
// User registration date
|
1431 |
+
$custom_columns['column-user_registered'] = array(
|
1432 |
+
'label' => __('Registered', $this->textdomain),
|
1433 |
+
'options' => array(
|
1434 |
+
'type_label' => __('Registered', $this->textdomain),
|
1435 |
+
)
|
1436 |
+
);
|
1437 |
+
|
1438 |
+
// User description
|
1439 |
+
$custom_columns['column-user_description'] = array(
|
1440 |
+
'label' => __('Description', $this->textdomain),
|
1441 |
+
'options' => array(
|
1442 |
+
'type_label' => __('Description', $this->textdomain),
|
1443 |
+
)
|
1444 |
+
);
|
1445 |
+
|
1446 |
+
// Custom Field support
|
1447 |
+
$custom_columns['column-meta-1'] = array(
|
1448 |
+
'label' => __('Custom Field', $this->textdomain),
|
1449 |
+
'field' => '',
|
1450 |
+
'field_type' => '',
|
1451 |
+
'before' => '',
|
1452 |
+
'after' => '',
|
1453 |
+
'options' => array(
|
1454 |
+
'type_label' => __('Field', $this->textdomain),
|
1455 |
+
'class' => 'cpac-box-metafield',
|
1456 |
+
'sortorder' => '',
|
1457 |
+
)
|
1458 |
+
);
|
1459 |
+
|
1460 |
+
// merge with defaults
|
1461 |
+
$custom_columns = $this->parse_defaults($custom_columns);
|
1462 |
+
|
1463 |
+
return apply_filters('cpac-custom-users-columns', $custom_columns);
|
1464 |
+
}
|
1465 |
+
|
1466 |
+
/**
|
1467 |
+
* Parse defaults
|
1468 |
+
*
|
1469 |
+
* @since 1.1
|
1470 |
+
*/
|
1471 |
+
private function parse_defaults($columns)
|
1472 |
+
{
|
1473 |
+
// default arguments
|
1474 |
+
$defaults = array(
|
1475 |
+
|
1476 |
+
// stored values
|
1477 |
+
'label' => '',
|
1478 |
+
'state' => '',
|
1479 |
+
|
1480 |
+
// static values
|
1481 |
+
'options' => array(
|
1482 |
+
'type_label' => __('Custom', $this->textdomain),
|
1483 |
+
'hide_options' => false,
|
1484 |
+
'class' => 'cpac-box-custom',
|
1485 |
+
'sortorder' => '',
|
1486 |
+
)
|
1487 |
+
);
|
1488 |
+
|
1489 |
+
foreach ( $columns as $k => $column ) {
|
1490 |
+
$c[$k] = wp_parse_args( $column, $defaults);
|
1491 |
+
}
|
1492 |
+
|
1493 |
+
return $c;
|
1494 |
}
|
1495 |
|
1496 |
/**
|
1498 |
*
|
1499 |
* @since 1.0
|
1500 |
*/
|
1501 |
+
private function get_stored_columns($type)
|
1502 |
{
|
1503 |
// get plugin options
|
1504 |
+
$options = get_option('cpac_options');
|
1505 |
|
1506 |
// get saved columns
|
1507 |
+
if ( isset($options['columns'][$type]) )
|
1508 |
+
return $options['columns'][$type];
|
1509 |
|
1510 |
return false;
|
1511 |
}
|
1515 |
*
|
1516 |
* @since 1.0
|
1517 |
*/
|
1518 |
+
private function get_menu()
|
1519 |
{
|
1520 |
// set
|
1521 |
$menu = '';
|
1527 |
$referer = $_REQUEST['cpac_type'];
|
1528 |
|
1529 |
// loop
|
1530 |
+
foreach ( $this->get_types() as $type ) {
|
1531 |
+
$label = $this->get_singular_name($type);
|
1532 |
+
$clean_label = $this->sanitize_string($type);
|
1533 |
|
1534 |
// divider
|
1535 |
$divider = $count++ == 1 ? '' : ' | ';
|
1536 |
|
1537 |
// current
|
1538 |
$current = '';
|
1539 |
+
if ( $this->is_menu_type_current($type) )
|
1540 |
$current = ' class="current"';
|
1541 |
|
1542 |
// menu list
|
1560 |
* @since 1.0
|
1561 |
*/
|
1562 |
private function is_menu_type_current( $post_type )
|
1563 |
+
{
|
|
|
|
|
1564 |
// referer
|
1565 |
$referer = '';
|
1566 |
if ( ! empty($_REQUEST['cpac_type']) )
|
1592 |
*
|
1593 |
* @since 1.0
|
1594 |
*/
|
1595 |
+
private function get_singular_name( $type )
|
1596 |
{
|
1597 |
+
// Users
|
1598 |
+
if ( $type == 'wp-users' )
|
1599 |
+
$label = 'Users';
|
1600 |
+
|
1601 |
+
// Posts
|
1602 |
+
else {
|
1603 |
+
$posttype_obj = get_post_type_object($type);
|
1604 |
+
$label = $posttype_obj->labels->singular_name;
|
1605 |
+
}
|
1606 |
+
|
1607 |
return $label;
|
1608 |
}
|
1609 |
|
1614 |
*/
|
1615 |
public function handle_requests_orderby_column( $vars )
|
1616 |
{
|
1617 |
+
if ( isset( $vars['orderby'] ) ) {
|
1618 |
+
$column = $this->get_orderby_type( $vars['orderby'], $vars['post_type'] );
|
|
|
1619 |
|
1620 |
+
if ( $column ) {
|
1621 |
+
$id = key($column);
|
|
|
|
|
|
|
1622 |
|
1623 |
+
// Page Order
|
1624 |
+
if ( $id == 'column-order' ) {
|
1625 |
$vars['orderby'] = 'menu_order';
|
1626 |
}
|
1627 |
+
|
1628 |
+
// Custom Fields
|
1629 |
+
if ( $this->is_column_meta($id) ) {
|
1630 |
+
$field = $column[$id]['field'];
|
1631 |
+
|
1632 |
+
// orderby type
|
1633 |
+
$field_type = 'meta_value';
|
1634 |
+
if ( $column[$id]['field_type'] == 'numeric' || $column[$id]['field_type'] == 'library_id' )
|
1635 |
+
$field_type = 'meta_value_num';
|
1636 |
+
|
1637 |
+
// set vars
|
1638 |
+
$vars = array_merge( $vars, array(
|
1639 |
+
'meta_key' => $field,
|
1640 |
+
'orderby' => $field_type
|
1641 |
+
) );
|
1642 |
+
}
|
1643 |
}
|
1644 |
}
|
1645 |
return $vars;
|
1646 |
}
|
1647 |
|
1648 |
+
/**
|
1649 |
+
* Get orderby type
|
1650 |
+
*
|
1651 |
+
* @since 1.1
|
1652 |
+
*/
|
1653 |
+
private function get_orderby_type($orderby, $type)
|
1654 |
+
{
|
1655 |
+
$db_columns = $this->get_stored_columns($type);
|
1656 |
+
|
1657 |
+
if ( $db_columns ) {
|
1658 |
+
foreach ( $db_columns as $id => $vars ) {
|
1659 |
+
|
1660 |
+
// check which custom column was clicked
|
1661 |
+
if ( isset( $vars['label'] ) && $orderby == $this->sanitize_string( $vars['label'] ) ) {
|
1662 |
+
$column[$id] = $vars;
|
1663 |
+
return $column;
|
1664 |
+
}
|
1665 |
+
}
|
1666 |
+
}
|
1667 |
+
return false;
|
1668 |
+
}
|
1669 |
+
|
1670 |
/**
|
1671 |
* Sanitize label
|
1672 |
*
|
1676 |
*/
|
1677 |
private function sanitize_string($string)
|
1678 |
{
|
1679 |
+
return str_replace('http://','', esc_url($string) );
|
|
|
1680 |
}
|
1681 |
|
1682 |
/**
|
1683 |
+
* Get plugin url.
|
1684 |
*
|
1685 |
* @since 1.0
|
1686 |
*/
|
1689 |
return plugins_url($file, __FILE__);
|
1690 |
}
|
1691 |
|
1692 |
+
/**
|
1693 |
+
* Checks if column-meta key exists
|
1694 |
+
*
|
1695 |
+
* @since 1.0
|
1696 |
+
*/
|
1697 |
+
private function is_column_meta( $id = '' )
|
1698 |
+
{
|
1699 |
+
if ( strpos($id, 'column-meta-') !== false )
|
1700 |
+
return true;
|
1701 |
+
|
1702 |
+
return false;
|
1703 |
+
}
|
1704 |
+
|
1705 |
/**
|
1706 |
* Get a thumbnail
|
1707 |
*
|
1711 |
{
|
1712 |
if ( empty($image) )
|
1713 |
return false;
|
1714 |
+
|
1715 |
+
// get correct image path
|
1716 |
$image_path = str_replace( WP_CONTENT_URL, WP_CONTENT_DIR, $image);
|
|
|
1717 |
|
1718 |
+
// resize image
|
1719 |
+
if ( file_exists($image_path) && $this->is_image($image_path) ) {
|
1720 |
+
$resized = image_resize( $image_path, 120, 80, true);
|
1721 |
|
1722 |
+
if ( ! is_wp_error( $resized ) ) {
|
1723 |
+
$image = str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, $resized);
|
1724 |
+
|
1725 |
+
return "<img src='{$image}' alt='' width='120' height='80' />";
|
1726 |
+
}
|
1727 |
+
|
1728 |
+
return $resized->get_error_message();
|
1729 |
+
}
|
1730 |
+
|
1731 |
+
return false;
|
1732 |
+
}
|
1733 |
+
|
1734 |
+
/**
|
1735 |
+
* Checks an URL for image extension
|
1736 |
+
*
|
1737 |
+
* @since 1.2
|
1738 |
+
*/
|
1739 |
+
private function is_image($url)
|
1740 |
+
{
|
1741 |
+
$validExt = array('.jpg', '.jpeg', '.gif', '.png', '.bmp');
|
1742 |
+
$ext = strrchr($url, '.');
|
1743 |
+
|
1744 |
+
return in_array($ext, $validExt);
|
1745 |
+
}
|
1746 |
+
|
1747 |
+
/**
|
1748 |
+
* Settings Page Template.
|
1749 |
+
*
|
1750 |
+
* This function in conjunction with others usei the WordPress
|
1751 |
+
* Settings API to create a settings page where users can adjust
|
1752 |
+
* the behaviour of this plugin.
|
1753 |
+
*
|
1754 |
+
* @since 1.0
|
1755 |
+
*/
|
1756 |
+
public function plugin_settings_page()
|
1757 |
+
{
|
1758 |
+
|
1759 |
+
// loop through post types
|
1760 |
+
$rows = '';
|
1761 |
+
foreach ( $this->get_types() as $type ) {
|
1762 |
+
|
1763 |
+
// post type label
|
1764 |
+
$label = $this->get_singular_name($type);
|
1765 |
+
|
1766 |
+
// id
|
1767 |
+
$id = $this->sanitize_string($type);
|
1768 |
+
|
1769 |
+
// build draggable boxes
|
1770 |
+
$boxes = $this->get_column_boxes($type);
|
1771 |
+
|
1772 |
+
// class
|
1773 |
+
$class = $this->is_menu_type_current($type) ? ' current' : ' hidden';
|
1774 |
+
|
1775 |
+
$rows .= "
|
1776 |
+
<tr id='cpac-box-{$id}' valign='top' class='cpac-box-row{$class}'>
|
1777 |
+
<th class='cpac_post_type' scope='row'>
|
1778 |
+
{$label}
|
1779 |
+
</th>
|
1780 |
+
<td>
|
1781 |
+
<h3 class='cpac_post_type hidden'>{$label}</h3>
|
1782 |
+
{$boxes}
|
1783 |
+
</td>
|
1784 |
+
</tr>
|
1785 |
+
";
|
1786 |
+
}
|
1787 |
+
|
1788 |
+
// Post Type Menu
|
1789 |
+
$menu = $this->get_menu();
|
1790 |
+
|
1791 |
+
?>
|
1792 |
+
<div id="cpac" class="wrap">
|
1793 |
+
<?php screen_icon($this->slug) ?>
|
1794 |
+
<h2><?php _e('Codepress Admin Columns', $this->textdomain); ?></h2>
|
1795 |
+
<?php echo $menu ?>
|
1796 |
+
<div class="postbox-container" style="width:70%;">
|
1797 |
+
<div class="metabox-holder">
|
1798 |
+
<div class="meta-box-sortables">
|
1799 |
+
|
1800 |
+
<div id="general-cpac-settings" class="postbox">
|
1801 |
+
<div title="Click to toggle" class="handlediv"><br></div>
|
1802 |
+
<h3 class="hndle">
|
1803 |
+
<span><?php _e('Admin Columns', $this->textdomain ); ?></span>
|
1804 |
+
</h3>
|
1805 |
+
<div class="inside">
|
1806 |
+
<form method="post" action="options.php">
|
1807 |
+
|
1808 |
+
<?php settings_fields( 'cpac-settings-group' ); ?>
|
1809 |
+
|
1810 |
+
<table class="form-table">
|
1811 |
+
|
1812 |
+
<?php echo $rows ?>
|
1813 |
+
|
1814 |
+
<tr class="bottom" valign="top">
|
1815 |
+
<th scope="row"></th>
|
1816 |
+
<td>
|
1817 |
+
<p class="submit">
|
1818 |
+
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
1819 |
+
</p>
|
1820 |
+
</td>
|
1821 |
+
</tr>
|
1822 |
+
</table>
|
1823 |
+
</form>
|
1824 |
+
</div>
|
1825 |
+
</div><!-- general-settings -->
|
1826 |
+
|
1827 |
+
<div id="restore-cpac-settings" class="postbox">
|
1828 |
+
<div title="Click to toggle" class="handlediv"><br></div>
|
1829 |
+
<h3 class="hndle">
|
1830 |
+
<span><?php _e('Restore defaults', $this->textdomain) ?></span>
|
1831 |
+
</h3>
|
1832 |
+
<div class="inside">
|
1833 |
+
<form method="post" action="">
|
1834 |
+
<input type="submit" class="button" name="cpac-restore-defaults" value="<?php _e('Restore default settings', $this->textdomain ) ?>" onclick="return confirm('<?php _e("Warning! ALL saved admin columns data will be deleted. This cannot be undone. \'OK\' to delete, \'Cancel\' to stop", $this->textdomain); ?>');" />
|
1835 |
+
</form>
|
1836 |
+
<p class="description"><?php _e('This will delete all column settings and restore the default settings.', $this->textdomain); ?></p>
|
1837 |
+
</div>
|
1838 |
+
</div><!-- restore-cpac-settings -->
|
1839 |
+
|
1840 |
+
</div>
|
1841 |
+
</div>
|
1842 |
+
</div><!-- .postbox-container -->
|
1843 |
+
|
1844 |
+
<div class="postbox-container" style="width:20%;">
|
1845 |
+
<div class="metabox-holder">
|
1846 |
+
<div class="meta-box-sortables">
|
1847 |
+
|
1848 |
+
<div id="likethisplugin-cpac-settings" class="postbox">
|
1849 |
+
<div title="Click to toggle" class="handlediv"><br></div>
|
1850 |
+
<h3 class="hndle">
|
1851 |
+
<span><?php _e('Like this plugin?', $this->textdomain) ?></span>
|
1852 |
+
</h3>
|
1853 |
+
<div class="inside">
|
1854 |
+
<p><?php _e('Why not do any or all of the following', $this->textdomain) ?>:</p>
|
1855 |
+
<ul>
|
1856 |
+
<li><a href="http://www.codepress.nl/plugins/codepress-admin-columns/"><?php _e('Link to it so other folks can find out about it.', $this->textdomain) ?></a></li>
|
1857 |
+
<li><a href="http://wordpress.org/extend/plugins/codepress-admin-columns/"><?php _e('Give it a 5 star rating on WordPress.org.', $this->textdomain) ?></a></li>
|
1858 |
+
<li class="donate_link"><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZDZRSYLQ4Z76J"><?php _e('Donate a token of your appreciation.', $this->textdomain) ?></a></li>
|
1859 |
+
</ul>
|
1860 |
+
</div>
|
1861 |
+
</div><!-- likethisplugin-cpac-settings -->
|
1862 |
+
|
1863 |
+
<div id="side-cpac-settings" class="postbox">
|
1864 |
+
<div title="Click to toggle" class="handlediv"><br></div>
|
1865 |
+
<h3 class="hndle">
|
1866 |
+
<span><?php _e('Need support?', $this->textdomain) ?></span>
|
1867 |
+
</h3>
|
1868 |
+
<div class="inside">
|
1869 |
+
<p><?php printf(__('If you are having problems with this plugin, please talk about them in the <a href="%s">Support forums</a> or send me an email %s.', $this->textdomain), 'http://wordpress.org/tags/codepress-admin-columns', '<a href="mailto:info@codepress.nl">info@codepress.nl</a>' );?></p>
|
1870 |
+
<p><?php printf(__("If you're sure you've found a bug, or have a feature request, please <a href='%s'>submit your feedback</a>.", $this->textdomain), 'http://www.codepress.nl/plugins/codepress-admin-columns#feedback');?></p>
|
1871 |
+
</div>
|
1872 |
+
</div><!-- side-cpac-settings -->
|
1873 |
+
|
1874 |
+
</div>
|
1875 |
+
</div>
|
1876 |
+
</div><!-- .postbox-container -->
|
1877 |
+
|
1878 |
+
</div>
|
1879 |
+
<?php
|
1880 |
+
}
|
1881 |
}
|
1882 |
?>
|
languages/codepress-admin-columns-nl_NL.mo
CHANGED
Binary file
|
languages/codepress-admin-columns-nl_NL.po
CHANGED
@@ -2,9 +2,9 @@ msgid ""
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Codepress Admin Columns\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date: 2011-
|
6 |
-
"PO-Revision-Date:
|
7 |
-
"Last-Translator:
|
8 |
"Language-Team: Codepress <info@codepress.nl>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
@@ -17,292 +17,206 @@ msgstr ""
|
|
17 |
"X-Poedit-SearchPath-0: .\n"
|
18 |
"X-Poedit-SearchPath-1: ..\n"
|
19 |
|
20 |
-
#: ../codepress-admin-columns.php:
|
21 |
msgid "Settings"
|
22 |
msgstr "Instellingen"
|
23 |
|
24 |
-
#: ../codepress-admin-columns.php:
|
25 |
-
msgid "Codepress Admin Columns"
|
26 |
-
msgstr ""
|
27 |
-
|
28 |
-
#: ../codepress-admin-columns.php:234
|
29 |
-
msgid "Admin Columns"
|
30 |
-
msgstr ""
|
31 |
-
|
32 |
-
#: ../codepress-admin-columns.php:249
|
33 |
-
msgid "Save Changes"
|
34 |
-
msgstr "Wijzigingen opslaan"
|
35 |
-
|
36 |
-
#: ../codepress-admin-columns.php:261
|
37 |
-
msgid "Restore defaults"
|
38 |
-
msgstr "Herstel instellingen"
|
39 |
-
|
40 |
-
#: ../codepress-admin-columns.php:265
|
41 |
-
msgid "Restore default settings"
|
42 |
-
msgstr "Herstel standaard instellingen"
|
43 |
-
|
44 |
-
#: ../codepress-admin-columns.php:265
|
45 |
-
msgid "Warning! ALL saved admin columns data will be deleted. This cannot be undone. \\'OK\\' to delete, \\'Cancel\\' to stop"
|
46 |
-
msgstr "Waarschuwing! ALLE bewaarde instellingen worden verwijderd. Dit kan niet worden ongedaan. \\'OK\\' om te verwijderen, \\'Annuleren\\' om te stoppen"
|
47 |
-
|
48 |
-
#: ../codepress-admin-columns.php:267
|
49 |
-
msgid "This will delete all column settings and restore the default settings."
|
50 |
-
msgstr "Hiermee worden alle kolommen instellingen verwijderd en de standaardinstellingen hersteld."
|
51 |
-
|
52 |
-
#: ../codepress-admin-columns.php:282
|
53 |
-
msgid "Need support?"
|
54 |
-
msgstr "Hulp nodig?"
|
55 |
-
|
56 |
-
#: ../codepress-admin-columns.php:285
|
57 |
-
#, php-format
|
58 |
-
msgid "If you are having problems with this plugin, please talk about them in the <a href=\"%s\">Support forums</a>."
|
59 |
-
msgstr "Als je problem hebt met deze plugin, stel je vragen dan in de <a href=\"%s\">Support forums</a>."
|
60 |
-
|
61 |
-
#: ../codepress-admin-columns.php:286
|
62 |
-
#, php-format
|
63 |
-
msgid "If you're sure you've found a bug, or have a feature request, please <a href='%s'>submit your feedback</a>."
|
64 |
-
msgstr "Als een bug bent tegen gekomen, of een feature wil aanvragen, stuur ons dan <a href='%s'>je feedback</a>."
|
65 |
-
|
66 |
-
#: ../codepress-admin-columns.php:324
|
67 |
msgid "Add Custom Field Column"
|
68 |
msgstr "Voeg custom field kolom toe"
|
69 |
|
70 |
-
#: ../codepress-admin-columns.php:
|
71 |
msgid "Default"
|
72 |
-
msgstr ""
|
73 |
|
74 |
-
#: ../codepress-admin-columns.php:
|
75 |
-
#: ../codepress-admin-columns.php:
|
76 |
msgid "Image"
|
77 |
msgstr "Afbeelding"
|
78 |
|
79 |
-
#: ../codepress-admin-columns.php:
|
80 |
msgid "Media Library Icon"
|
81 |
msgstr "Media bibliotheek Icoon"
|
82 |
|
83 |
-
#: ../codepress-admin-columns.php:
|
84 |
-
#: ../codepress-admin-columns.php:
|
85 |
-
#: ../codepress-admin-columns.php:
|
86 |
msgid "Excerpt"
|
87 |
msgstr "Samenvatting"
|
88 |
|
89 |
-
#: ../codepress-admin-columns.php:
|
90 |
msgid "Multiple Values"
|
91 |
msgstr "Meerdere waarden"
|
92 |
|
93 |
-
#: ../codepress-admin-columns.php:
|
|
|
|
|
|
|
|
|
94 |
msgid "This field can not be removed"
|
95 |
msgstr "Dit veld kan niet worden verwijderd"
|
96 |
|
97 |
-
#: ../codepress-admin-columns.php:
|
98 |
msgid "Remove"
|
99 |
msgstr "Verwijder"
|
100 |
|
101 |
-
#: ../codepress-admin-columns.php:
|
102 |
msgid "Standard"
|
103 |
msgstr "Standaard"
|
104 |
|
105 |
-
#: ../codepress-admin-columns.php:
|
106 |
msgid "Comments"
|
107 |
msgstr "Reacties"
|
108 |
|
109 |
-
#: ../codepress-admin-columns.php:
|
110 |
-
msgid "Custom"
|
111 |
-
msgstr ""
|
112 |
-
|
113 |
-
#: ../codepress-admin-columns.php:1077
|
114 |
msgid "Featured Image"
|
115 |
msgstr "Uitgelichte afbeelding"
|
116 |
|
117 |
-
#: ../codepress-admin-columns.php:
|
118 |
-
#: ../codepress-admin-columns.php:
|
119 |
msgid "Sticky"
|
120 |
msgstr "Sticky"
|
121 |
|
122 |
-
#: ../codepress-admin-columns.php:
|
123 |
msgid "Page Order"
|
124 |
msgstr "Pagina Volgorde"
|
125 |
|
126 |
-
#: ../codepress-admin-columns.php:
|
127 |
msgid "Order"
|
128 |
msgstr "Volgorde"
|
129 |
|
130 |
-
#: ../codepress-admin-columns.php:
|
131 |
-
#: ../codepress-admin-columns.php:
|
132 |
msgid "Page Template"
|
133 |
msgstr "Pagina Template"
|
134 |
|
135 |
-
#: ../codepress-admin-columns.php:
|
136 |
-
#: ../codepress-admin-columns.php:
|
137 |
msgid "Post Format"
|
138 |
msgstr ""
|
139 |
|
140 |
-
#: ../codepress-admin-columns.php:
|
141 |
msgid "Taxonomy"
|
142 |
msgstr ""
|
143 |
|
144 |
-
#: ../codepress-admin-columns.php:
|
145 |
-
#: ../codepress-admin-columns.php:
|
146 |
msgid "Slug"
|
147 |
msgstr ""
|
148 |
|
149 |
-
#: ../codepress-admin-columns.php:
|
150 |
-
#: ../codepress-admin-columns.php:
|
|
|
|
|
|
|
|
|
|
|
151 |
msgid "Attachment"
|
152 |
msgstr ""
|
153 |
|
154 |
-
#: ../codepress-admin-columns.php:
|
|
|
155 |
msgid "Custom Field"
|
156 |
msgstr ""
|
157 |
|
158 |
-
#: ../codepress-admin-columns.php:
|
|
|
159 |
msgid "Field"
|
160 |
msgstr "Veld"
|
161 |
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
#~ msgstr "Beschrijving"
|
167 |
-
|
168 |
-
#~ msgid "Latitude"
|
169 |
-
#~ msgstr "Breedtegraad"
|
170 |
-
|
171 |
-
#~ msgid "Longitude"
|
172 |
-
#~ msgstr "Lengtegraad"
|
173 |
-
|
174 |
-
#~ msgid "Width"
|
175 |
-
#~ msgstr "Breedte"
|
176 |
-
|
177 |
-
#~ msgid "Height"
|
178 |
-
#~ msgstr "Hoogte"
|
179 |
-
|
180 |
-
#~ msgid "Dynamic"
|
181 |
-
#~ msgstr "Dynamisch"
|
182 |
-
|
183 |
-
#~ msgid "Geocoder - Pronamic Google Maps"
|
184 |
-
#~ msgstr "Geocoder - Pronamic Google Maps"
|
185 |
-
|
186 |
-
#~ msgid "Number posts to geocode: %s"
|
187 |
-
#~ msgstr "Aantel berichten te geocoderen: %s"
|
188 |
-
|
189 |
-
#~ msgid "ID"
|
190 |
-
#~ msgstr "ID"
|
191 |
-
|
192 |
-
#~ msgid "Address"
|
193 |
-
#~ msgstr "Adres"
|
194 |
-
|
195 |
-
#~ msgid "Status"
|
196 |
-
#~ msgstr "Status"
|
197 |
-
|
198 |
-
#~ msgid "Location"
|
199 |
-
#~ msgstr "Locatie"
|
200 |
-
|
201 |
-
#~ msgid "Geocode"
|
202 |
-
#~ msgstr "Geocodeer"
|
203 |
-
|
204 |
-
#~ msgid "Zero results"
|
205 |
-
#~ msgstr "Geen resultaten"
|
206 |
-
|
207 |
-
#~ msgid ""
|
208 |
-
#~ "We found no geocoding results for the following %s posts, adjust them "
|
209 |
-
#~ "manually if needed."
|
210 |
-
#~ msgstr ""
|
211 |
-
#~ "We konden geen gecode resultaten vinden voor de volgende%s berichten, pas "
|
212 |
-
#~ "deze handmatig aan wanneer nodig."
|
213 |
-
|
214 |
-
#~ msgid "Configuration - Pronamic Google Maps"
|
215 |
-
#~ msgstr "Configuratie - Pronamic Google Maps"
|
216 |
-
|
217 |
-
#~ msgid "Active"
|
218 |
-
#~ msgstr "Actief"
|
219 |
-
|
220 |
-
#~ msgid "Activate Google Maps"
|
221 |
-
#~ msgstr "Activeer Google Maps"
|
222 |
-
|
223 |
-
#~ msgid "Show Google Maps"
|
224 |
-
#~ msgstr "Google Maps weergeven"
|
225 |
-
|
226 |
-
#~ msgid "Geocoder"
|
227 |
-
#~ msgstr "Geocoder"
|
228 |
-
|
229 |
-
#~ msgid "Geocode ↓"
|
230 |
-
#~ msgstr "Geocoderen ↓"
|
231 |
-
|
232 |
-
#~ msgid "Reverse Geocode ↑"
|
233 |
-
#~ msgstr "Omgekeerd geocoderen ↑"
|
234 |
-
|
235 |
-
#~ msgid "Tip: Change the zoom level and map type to your own wishes."
|
236 |
-
#~ msgstr "Tip: wijzig het zoomniveau en map type naar je eigen wens."
|
237 |
|
238 |
-
|
239 |
-
|
|
|
|
|
240 |
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
|
246 |
-
|
247 |
-
|
|
|
|
|
248 |
|
249 |
-
|
250 |
-
|
|
|
|
|
251 |
|
252 |
-
|
253 |
-
|
|
|
|
|
254 |
|
255 |
-
|
256 |
-
|
|
|
257 |
|
258 |
-
|
259 |
-
|
|
|
260 |
|
261 |
-
|
262 |
-
|
|
|
263 |
|
264 |
-
|
265 |
-
|
|
|
266 |
|
267 |
-
|
268 |
-
|
|
|
269 |
|
270 |
-
|
271 |
-
|
|
|
272 |
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
#~ msgstr ""
|
277 |
-
#~ "Het ons veel uren werken gekost om deze plugin te ontwikkelen, als je het "
|
278 |
-
#~ "gebruikt, doneer a.u.b. voor je waardering!"
|
279 |
|
280 |
-
|
281 |
-
|
|
|
282 |
|
283 |
-
|
284 |
-
|
|
|
285 |
|
286 |
-
|
287 |
-
|
|
|
288 |
|
289 |
-
|
290 |
-
|
|
|
291 |
|
292 |
-
|
293 |
-
|
|
|
294 |
|
295 |
-
|
296 |
-
|
|
|
297 |
|
298 |
-
|
299 |
-
|
|
|
300 |
|
301 |
-
|
302 |
-
|
|
|
|
|
303 |
|
304 |
-
|
305 |
-
|
|
|
|
|
306 |
|
307 |
-
#~ msgid "Configuration"
|
308 |
-
#~ msgstr "Configuratie"
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Codepress Admin Columns\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2011-12-06 17:17+0100\n"
|
6 |
+
"PO-Revision-Date: 2012-04-20 21:12+0100\n"
|
7 |
+
"Last-Translator: Codepress <info@codepress.nl>\n"
|
8 |
"Language-Team: Codepress <info@codepress.nl>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
17 |
"X-Poedit-SearchPath-0: .\n"
|
18 |
"X-Poedit-SearchPath-1: ..\n"
|
19 |
|
20 |
+
#: ../codepress-admin-columns.php:139
|
21 |
msgid "Settings"
|
22 |
msgstr "Instellingen"
|
23 |
|
24 |
+
#: ../codepress-admin-columns.php:287
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
msgid "Add Custom Field Column"
|
26 |
msgstr "Voeg custom field kolom toe"
|
27 |
|
28 |
+
#: ../codepress-admin-columns.php:481
|
29 |
msgid "Default"
|
30 |
+
msgstr "Standaard"
|
31 |
|
32 |
+
#: ../codepress-admin-columns.php:482
|
33 |
+
#: ../codepress-admin-columns.php:1259
|
34 |
msgid "Image"
|
35 |
msgstr "Afbeelding"
|
36 |
|
37 |
+
#: ../codepress-admin-columns.php:483
|
38 |
msgid "Media Library Icon"
|
39 |
msgstr "Media bibliotheek Icoon"
|
40 |
|
41 |
+
#: ../codepress-admin-columns.php:484
|
42 |
+
#: ../codepress-admin-columns.php:1267
|
43 |
+
#: ../codepress-admin-columns.php:1269
|
44 |
msgid "Excerpt"
|
45 |
msgstr "Samenvatting"
|
46 |
|
47 |
+
#: ../codepress-admin-columns.php:485
|
48 |
msgid "Multiple Values"
|
49 |
msgstr "Meerdere waarden"
|
50 |
|
51 |
+
#: ../codepress-admin-columns.php:486
|
52 |
+
msgid "Numeric"
|
53 |
+
msgstr "Numerieke"
|
54 |
+
|
55 |
+
#: ../codepress-admin-columns.php:511
|
56 |
msgid "This field can not be removed"
|
57 |
msgstr "Dit veld kan niet worden verwijderd"
|
58 |
|
59 |
+
#: ../codepress-admin-columns.php:515
|
60 |
msgid "Remove"
|
61 |
msgstr "Verwijder"
|
62 |
|
63 |
+
#: ../codepress-admin-columns.php:850
|
64 |
msgid "Standard"
|
65 |
msgstr "Standaard"
|
66 |
|
67 |
+
#: ../codepress-admin-columns.php:1228
|
68 |
msgid "Comments"
|
69 |
msgstr "Reacties"
|
70 |
|
71 |
+
#: ../codepress-admin-columns.php:1257
|
|
|
|
|
|
|
|
|
72 |
msgid "Featured Image"
|
73 |
msgstr "Uitgelichte afbeelding"
|
74 |
|
75 |
+
#: ../codepress-admin-columns.php:1277
|
76 |
+
#: ../codepress-admin-columns.php:1279
|
77 |
msgid "Sticky"
|
78 |
msgstr "Sticky"
|
79 |
|
80 |
+
#: ../codepress-admin-columns.php:1287
|
81 |
msgid "Page Order"
|
82 |
msgstr "Pagina Volgorde"
|
83 |
|
84 |
+
#: ../codepress-admin-columns.php:1289
|
85 |
msgid "Order"
|
86 |
msgstr "Volgorde"
|
87 |
|
88 |
+
#: ../codepress-admin-columns.php:1298
|
89 |
+
#: ../codepress-admin-columns.php:1300
|
90 |
msgid "Page Template"
|
91 |
msgstr "Pagina Template"
|
92 |
|
93 |
+
#: ../codepress-admin-columns.php:1309
|
94 |
+
#: ../codepress-admin-columns.php:1311
|
95 |
msgid "Post Format"
|
96 |
msgstr ""
|
97 |
|
98 |
+
#: ../codepress-admin-columns.php:1324
|
99 |
msgid "Taxonomy"
|
100 |
msgstr ""
|
101 |
|
102 |
+
#: ../codepress-admin-columns.php:1342
|
103 |
+
#: ../codepress-admin-columns.php:1344
|
104 |
msgid "Slug"
|
105 |
msgstr ""
|
106 |
|
107 |
+
#: ../codepress-admin-columns.php:1351
|
108 |
+
#: ../codepress-admin-columns.php:1353
|
109 |
+
msgid "Word count"
|
110 |
+
msgstr "Aantal woorden"
|
111 |
+
|
112 |
+
#: ../codepress-admin-columns.php:1359
|
113 |
+
#: ../codepress-admin-columns.php:1361
|
114 |
msgid "Attachment"
|
115 |
msgstr ""
|
116 |
|
117 |
+
#: ../codepress-admin-columns.php:1369
|
118 |
+
#: ../codepress-admin-columns.php:1448
|
119 |
msgid "Custom Field"
|
120 |
msgstr ""
|
121 |
|
122 |
+
#: ../codepress-admin-columns.php:1375
|
123 |
+
#: ../codepress-admin-columns.php:1454
|
124 |
msgid "Field"
|
125 |
msgstr "Veld"
|
126 |
|
127 |
+
#: ../codepress-admin-columns.php:1399
|
128 |
+
#: ../codepress-admin-columns.php:1401
|
129 |
+
msgid "User ID"
|
130 |
+
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
|
132 |
+
#: ../codepress-admin-columns.php:1408
|
133 |
+
#: ../codepress-admin-columns.php:1410
|
134 |
+
msgid "First name"
|
135 |
+
msgstr "Voornaam"
|
136 |
|
137 |
+
#: ../codepress-admin-columns.php:1416
|
138 |
+
#: ../codepress-admin-columns.php:1418
|
139 |
+
msgid "Last name"
|
140 |
+
msgstr "Achternaam"
|
141 |
|
142 |
+
#: ../codepress-admin-columns.php:1424
|
143 |
+
#: ../codepress-admin-columns.php:1426
|
144 |
+
msgid "Url"
|
145 |
+
msgstr ""
|
146 |
|
147 |
+
#: ../codepress-admin-columns.php:1432
|
148 |
+
#: ../codepress-admin-columns.php:1434
|
149 |
+
msgid "Registered"
|
150 |
+
msgstr "Registratie"
|
151 |
|
152 |
+
#: ../codepress-admin-columns.php:1440
|
153 |
+
#: ../codepress-admin-columns.php:1442
|
154 |
+
msgid "Description"
|
155 |
+
msgstr "Beschrijving"
|
156 |
|
157 |
+
#: ../codepress-admin-columns.php:1482
|
158 |
+
msgid "Custom"
|
159 |
+
msgstr ""
|
160 |
|
161 |
+
#: ../codepress-admin-columns.php:1794
|
162 |
+
msgid "Codepress Admin Columns"
|
163 |
+
msgstr ""
|
164 |
|
165 |
+
#: ../codepress-admin-columns.php:1803
|
166 |
+
msgid "Admin Columns"
|
167 |
+
msgstr ""
|
168 |
|
169 |
+
#: ../codepress-admin-columns.php:1818
|
170 |
+
msgid "Save Changes"
|
171 |
+
msgstr "Wijzigingen opslaan"
|
172 |
|
173 |
+
#: ../codepress-admin-columns.php:1830
|
174 |
+
msgid "Restore defaults"
|
175 |
+
msgstr "Herstel instellingen"
|
176 |
|
177 |
+
#: ../codepress-admin-columns.php:1834
|
178 |
+
msgid "Restore default settings"
|
179 |
+
msgstr "Herstel standaard instellingen"
|
180 |
|
181 |
+
#: ../codepress-admin-columns.php:1834
|
182 |
+
msgid "Warning! ALL saved admin columns data will be deleted. This cannot be undone. \\'OK\\' to delete, \\'Cancel\\' to stop"
|
183 |
+
msgstr "Waarschuwing! ALLE bewaarde instellingen worden verwijderd. Dit kan niet worden ongedaan. \\'OK\\' om te verwijderen, \\'Annuleren\\' om te stoppen"
|
|
|
|
|
|
|
184 |
|
185 |
+
#: ../codepress-admin-columns.php:1836
|
186 |
+
msgid "This will delete all column settings and restore the default settings."
|
187 |
+
msgstr "Hiermee worden alle kolommen instellingen verwijderd en de standaardinstellingen hersteld."
|
188 |
|
189 |
+
#: ../codepress-admin-columns.php:1851
|
190 |
+
msgid "Like this plugin?"
|
191 |
+
msgstr "Leuke plugin?"
|
192 |
|
193 |
+
#: ../codepress-admin-columns.php:1854
|
194 |
+
msgid "Why not do any or all of the following"
|
195 |
+
msgstr "Waarom doe je niet één van de volgende dingen"
|
196 |
|
197 |
+
#: ../codepress-admin-columns.php:1856
|
198 |
+
msgid "Link to it so other folks can find out about it."
|
199 |
+
msgstr "Link naar ons zodat anderen deze plugin ook ontdekken."
|
200 |
|
201 |
+
#: ../codepress-admin-columns.php:1857
|
202 |
+
msgid "Give it a 5 star rating on WordPress.org."
|
203 |
+
msgstr "Geef het een goede score op WordPress.org."
|
204 |
|
205 |
+
#: ../codepress-admin-columns.php:1858
|
206 |
+
msgid "Donate a token of your appreciation."
|
207 |
+
msgstr "Doneer een blijk van uw waardering."
|
208 |
|
209 |
+
#: ../codepress-admin-columns.php:1866
|
210 |
+
msgid "Need support?"
|
211 |
+
msgstr "Hulp nodig?"
|
212 |
|
213 |
+
#: ../codepress-admin-columns.php:1869
|
214 |
+
#, php-format
|
215 |
+
msgid "If you are having problems with this plugin, please talk about them in the <a href=\"%s\">Support forums</a> or send me an email %s."
|
216 |
+
msgstr "Als je problem hebt met deze plugin, stel je vragen dan in de <a href=\"%s\">Support forums</a> of stuur me een email %s."
|
217 |
|
218 |
+
#: ../codepress-admin-columns.php:1870
|
219 |
+
#, php-format
|
220 |
+
msgid "If you're sure you've found a bug, or have a feature request, please <a href='%s'>submit your feedback</a>."
|
221 |
+
msgstr "Als een bug bent tegen gekomen, of een feature wil aanvragen, stuur ons dan <a href='%s'>je feedback</a>."
|
222 |
|
|
|
|
readme.txt
CHANGED
@@ -1,21 +1,19 @@
|
|
1 |
=== Codepress Admin Columns ===
|
2 |
Contributors: codepress, tschutter
|
3 |
-
Tags: plugins, wordpress, admin, column, columns, dashboard, sortable, filters, wp-admin
|
4 |
Requires at least: 3.1
|
5 |
-
Tested up to: 3.
|
6 |
-
Stable tag: 1.
|
7 |
|
8 |
== Description ==
|
9 |
|
10 |
-
|
11 |
|
12 |
-
|
13 |
|
14 |
-
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
The following custom columns are supported:
|
19 |
|
20 |
* Featured Image
|
21 |
* Excerpt
|
@@ -27,18 +25,20 @@ The following custom columns are supported:
|
|
27 |
* ID
|
28 |
* Slug
|
29 |
* Sticky
|
|
|
30 |
* Custom Fields
|
31 |
|
32 |
= Custom Fields =
|
33 |
|
34 |
-
With the custom field column you can display custom field values. It
|
35 |
|
36 |
-
* Icons for Media Library items
|
37 |
* Image thumbnails
|
|
|
38 |
* Excerpt
|
39 |
* Multiple Values
|
|
|
40 |
|
41 |
-
= Sortable
|
42 |
|
43 |
A nice feature is that it will make some of the new columns support sorting. By default WordPress let's you sort by Title, Date, Comments and Author. This will make you be able to sort by:
|
44 |
|
@@ -46,8 +46,30 @@ A nice feature is that it will make some of the new columns support sorting. By
|
|
46 |
* page order
|
47 |
* slug
|
48 |
* page template
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
-
|
|
|
|
|
51 |
|
52 |
**Related Links:**
|
53 |
|
@@ -69,15 +91,40 @@ Leave your feedback at http://www.codepress.nl/plugins/codepress-admin-columns#f
|
|
69 |
|
70 |
== Screenshots ==
|
71 |
|
72 |
-
1.
|
73 |
-
2.
|
74 |
-
3.
|
75 |
|
76 |
== Changelog ==
|
77 |
|
78 |
-
= 1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
|
80 |
-
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
= 1.0 =
|
83 |
|
1 |
=== Codepress Admin Columns ===
|
2 |
Contributors: codepress, tschutter
|
3 |
+
Tags: plugins, wordpress, admin, column, columns, custom columns, custom fields, image, dashboard, sortable, filters, wp-admin
|
4 |
Requires at least: 3.1
|
5 |
+
Tested up to: 3.3-RC1
|
6 |
+
Stable tag: 1.2
|
7 |
|
8 |
== Description ==
|
9 |
|
10 |
+
Completely customise your Custom Columns with a nice drag and drop interface.
|
11 |
|
12 |
+
By default, WordPress only shows a few built-in columns. This plugin will give you many additional columns and you will have full control over all custom columns for pages, posts, posttypes and users. You can add or remove columns, change their label and reorder them.
|
13 |
|
14 |
+
= Custom Columns =
|
15 |
|
16 |
+
The following custom columns are added:
|
|
|
|
|
17 |
|
18 |
* Featured Image
|
19 |
* Excerpt
|
25 |
* ID
|
26 |
* Slug
|
27 |
* Sticky
|
28 |
+
* Word count
|
29 |
* Custom Fields
|
30 |
|
31 |
= Custom Fields =
|
32 |
|
33 |
+
With the custom field column you can display any custom field values. It can show its default value but also handle it as an image or icon. Thsese types are added:
|
34 |
|
|
|
35 |
* Image thumbnails
|
36 |
+
* Icons for Media Library items
|
37 |
* Excerpt
|
38 |
* Multiple Values
|
39 |
+
* Numeric value ( this also works for sorting by meta_value_num )
|
40 |
|
41 |
+
= Sortable Custom Columns =
|
42 |
|
43 |
A nice feature is that it will make some of the new columns support sorting. By default WordPress let's you sort by Title, Date, Comments and Author. This will make you be able to sort by:
|
44 |
|
46 |
* page order
|
47 |
* slug
|
48 |
* page template
|
49 |
+
* custom fields ( both meta_value and meta_value_num are supported )
|
50 |
+
|
51 |
+
= User Columns =
|
52 |
+
|
53 |
+
You can also change the User Columns. The following user column are added:
|
54 |
+
|
55 |
+
* User ID
|
56 |
+
* First name
|
57 |
+
* Last name
|
58 |
+
* Url
|
59 |
+
* Register date
|
60 |
+
* Biographical Info ( description )
|
61 |
+
* User Custom Fields
|
62 |
+
|
63 |
+
Some of the user custom fields that are included: user level, capabilities, admin color, nickname... many more.
|
64 |
+
|
65 |
+
|
66 |
+
= Third party plugin support =
|
67 |
+
|
68 |
+
It will work nice with other plugins and support their additional custom columns. A few examples of plugins that are supported: WordPress SEO by Yoast (Robots Meta), Post Admin Shortcuts (Pin), WP Show IDs (ID) and User Access Manager (Access).
|
69 |
|
70 |
+
**Feeback**
|
71 |
+
|
72 |
+
You can leave any <a href='http://www.codepress.nl/plugins/codepress-admin-columns#feedback'>requests or feedback</a>.
|
73 |
|
74 |
**Related Links:**
|
75 |
|
91 |
|
92 |
== Screenshots ==
|
93 |
|
94 |
+
1. Posts Screen with custom columns.
|
95 |
+
2. Settings page of the Codepress Admin columns plugin.
|
96 |
+
3. Options for the Custom Field Column.
|
97 |
|
98 |
== Changelog ==
|
99 |
|
100 |
+
= 1.2 =
|
101 |
+
|
102 |
+
* added support for third party plugins
|
103 |
+
* added user custom fields
|
104 |
+
* added extra image check
|
105 |
+
* bug fix with javascript (jquery) enqueue
|
106 |
+
|
107 |
+
= 1.1.3 =
|
108 |
+
|
109 |
+
* added bug fix for WP3.3beta ( thanks to raonip and ronbme for pointing this out )
|
110 |
+
|
111 |
+
= 1.1.2 =
|
112 |
+
|
113 |
+
* added dutch translation
|
114 |
+
|
115 |
+
= 1.1.1 =
|
116 |
+
|
117 |
+
* Bug fix: path separator for require_once
|
118 |
+
* Added word count
|
119 |
+
|
120 |
+
= 1.1 =
|
121 |
|
122 |
+
* Added User Columns.
|
123 |
+
* Added before / after text for custom fields
|
124 |
+
* Added custom field type 'Numeric'.
|
125 |
+
* Added custom field sortables.
|
126 |
+
* Fixed domain path
|
127 |
+
* Fixed settings link
|
128 |
|
129 |
= 1.0 =
|
130 |
|
screenshot-1.png
CHANGED
Binary file
|
screenshot-2.png
CHANGED
Binary file
|
screenshot-3.png
CHANGED
Binary file
|