Admin Columns - Version 1.4.5

Version Description

  • added french language ( thanks to Alexandre Girard )
  • filtering by taxonomy ( only displays when column is used )
  • added compatibility with woocommerce
  • fix value media meta column ID
  • fixed bug with sorting users by postcount
  • added Actions column for Media (delete, view etc.)
  • added Actions column for Link (delete, view etc.)
  • added Actions column for Comments (delete, view etc.)
  • added Wordcount column for Comments
  • added Filesize column for Media ( supports sorting )
  • added default sorting for posts ( remembers your last sorting, only with addon )
  • added default sorting for media ( remembers your last sorting, only with addon )
  • added filters to the result output
Download this release

Release Info

Developer codepress
Plugin Icon 128x128 Admin Columns
Version 1.4.5
Comparing to
See all releases

Code changes from version 1.4.4 to 1.4.5

assets/css/admin-column.css CHANGED
@@ -405,6 +405,14 @@
405
-------------------------------------------------------------- */
406
#addons-cpac-settings {
407
overflow: hidden;
408
}
409
#addons-cpac-settings h2 {
410
font-size: 14px;
@@ -417,6 +425,7 @@
417
text-decoration: none;
418
color: green;
419
text-decoration: underline;
420
}
421
#addons-cpac-settings a:hover {
422
color: darkgreen;
405
-------------------------------------------------------------- */
406
#addons-cpac-settings {
407
overflow: hidden;
408
+ background-color: #CCFFCC;
409
+ background-image: -moz-linear-gradient(center top , #c3f5c2, #CCFFCC );
410
+ border-color: green;
411
+ }
412
+ #addons-cpac-settings h3 {
413
+ background: transparent;
414
+ border-bottom: none;
415
+ box-shadow: none;
416
}
417
#addons-cpac-settings h2 {
418
font-size: 14px;
425
text-decoration: none;
426
color: green;
427
text-decoration: underline;
428
+ font-size: 15px;
429
}
430
#addons-cpac-settings a:hover {
431
color: darkgreen;
classes/sortable.php CHANGED
@@ -38,7 +38,7 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
38
add_action( 'admin_init', array( $this, 'register_sortable_columns' ) );
39
40
// init filtering
41
- // add_action( 'admin_init', array( $this, 'register_filtering_columns' ) );
42
43
// handle requests for sorting columns
44
add_filter( 'request', array( $this, 'handle_requests_orderby_column'), 1 );
@@ -136,7 +136,7 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
136
private function add_managed_sortable_columns( $type = 'post', $columns )
137
{
138
$display_columns = $this->get_merged_columns($type);
139
-
140
if ( ! $display_columns )
141
return $columns;
142
@@ -160,22 +160,48 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
160
*/
161
public function handle_requests_orderby_column( $vars )
162
{
163
- if ( ! isset( $vars['orderby'] ) )
164
- return $vars;
165
-
166
/** Users */
167
// You would expect to see get_orderby_users_vars(), but sorting for
168
// users is handled through a different filter. Not 'request', but 'pre_user_query'.
169
// See handle_requests_orderby_users_column().
170
171
/** Media */
172
- elseif ( $this->request_uri_is('upload') )
173
$vars = $this->get_orderby_media_vars($vars);
174
175
/** Posts */
176
- elseif ( !empty($vars['post_type']) )
177
$vars = $this->get_orderby_posts_vars($vars);
178
179
return $vars;
180
}
181
@@ -186,8 +212,6 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
186
*/
187
public function handle_requests_orderby_users_column($user_query)
188
{
189
- //print_r($user_query); exit;
190
-
191
// query vars
192
$vars = $user_query->query_vars;
193
@@ -195,20 +219,17 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
195
$column = $this->get_orderby_type( $vars['orderby'], 'wp-users' );
196
197
if ( empty($column) )
198
- return $vars;
199
200
// id
201
- $id = key($column);
202
-
203
- // type
204
- $type = $id;
205
206
// Check for user custom fields: column-meta-[customfieldname]
207
if ( Codepress_Admin_Columns::is_column_meta($type) )
208
$type = 'column-user-meta';
209
210
// Check for post count: column-user_postcount-[posttype]
211
- if ( $this->get_posttype_by_postcount_column($type) )
212
$type = 'column-user_postcount';
213
214
// var
@@ -271,7 +292,7 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
271
break;
272
273
case 'column-user_postcount' :
274
- $post_type = $this->get_posttype_by_postcount_column($id);
275
if ( $post_type ) {
276
$sort_flag = SORT_REGULAR;
277
foreach ( $this->get_users_data() as $u ) {
@@ -280,16 +301,6 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
280
}
281
}
282
break;
283
-
284
- case 'role' :
285
- $sort_flag = SORT_REGULAR;
286
- foreach ( $this->get_users_data() as $u ) {
287
- $role = !empty($u->roles[0]) ? $u->roles[0] : '';
288
- if ($role || $this->show_all_results ) {
289
- $cusers[$u->ID] = $this->prepare_sort_string_value($role);
290
- }
291
- }
292
- break;
293
294
case 'column-user-meta' :
295
$field = $column[$id]['field'];
@@ -308,8 +319,24 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
308
}
309
}
310
break;
311
312
- endswitch;
313
314
if ( isset($sort_flag) ) {
315
$user_query = $this->get_users_query_vars( $user_query, $cusers, $sort_flag );
@@ -474,7 +501,6 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
474
break;
475
476
case 'column-date_gmt':
477
- // is default
478
break;
479
480
/** native WP columns */
@@ -547,15 +573,26 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
547
*/
548
private function get_orderby_media_vars($vars)
549
{
550
// Column
551
$column = $this->get_orderby_type( $vars['orderby'], 'wp-media' );
552
553
if ( empty($column) )
554
return $vars;
555
556
// var
557
$cposts = array();
558
- switch( key($column) ) :
559
560
case 'column-mediaid' :
561
$vars['orderby'] = 'ID';
@@ -640,10 +677,24 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
640
$cposts[$p->ID] = $this->prepare_sort_string_value( $alt );
641
}
642
}
643
- break;
644
645
endswitch;
646
647
// we will add the sorted post ids to vars['post__in'] and remove unused vars
648
if ( isset($sort_flag) ) {
649
$vars = $this->get_vars_post__in( $vars, $cposts, $sort_flag );
@@ -661,6 +712,15 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
661
{
662
$post_type = $vars['post_type'];
663
664
// Column
665
$column = $this->get_orderby_type( $vars['orderby'], $post_type );
666
@@ -668,11 +728,8 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
668
return $vars;
669
670
// id
671
- $id = key($column);
672
-
673
- // type
674
- $type = $id;
675
-
676
// Check for taxonomies, such as column-taxonomy-[taxname]
677
if ( strpos($type, 'column-taxonomy-') !== false )
678
$type = 'column-taxonomy';
@@ -684,7 +741,7 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
684
// attachments
685
if ( $type == 'column-attachment-count' )
686
$type = 'column-attachment';
687
-
688
// var
689
$cposts = array();
690
switch( $type ) :
@@ -818,23 +875,30 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
818
break;
819
820
case 'column-taxonomy' :
821
- $sort_flag = SORT_STRING;
822
- $tax = str_replace('column-taxonomy-', '', $id);
823
- foreach ( $this->get_any_posts_by_posttype($post_type) as $p ) {
824
- $cposts[$p->ID] = '';
825
- $terms = get_the_terms($p->ID, $tax);
826
- if ( !is_wp_error($terms) && !empty($terms) ) {
827
- // only use the first term to sort
828
- $term = array_shift(array_values($terms));
829
- if ( isset($term->term_id) ) {
830
- $cposts[$p->ID] = sanitize_term_field('name', $term->name, $term->term_id, $term->taxonomy, 'db');
831
- }
832
- }
833
- }
834
break;
835
-
836
endswitch;
837
838
// we will add the sorted post ids to vars['post__in'] and remove unused vars
839
if ( isset($sort_flag) ) {
840
$vars = $this->get_vars_post__in( $vars, $cposts, $sort_flag );
@@ -843,6 +907,59 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
843
return $vars;
844
}
845
846
/**
847
* Set post__in for use in WP_Query
848
*
@@ -999,13 +1116,26 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
999
{
1000
global $post_type_object;
1001
1002
// make a filter foreach taxonomy
1003
$taxonomies = get_object_taxonomies($post_type_object->name, 'names');
1004
1005
if ( $taxonomies ) {
1006
foreach ( $taxonomies as $tax ) {
1007
- if ( !in_array($tax, array('post_tag','category','post_format') ) ) {
1008
1009
$terms = get_terms($tax);
1010
$terms = $this->indent($terms, 0, 'parent', 'term_id');
1011
$terms = $this->apply_dropdown_markup($terms);
@@ -1016,8 +1146,8 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
1016
$selected = isset($_GET[$tax]) && $term_slug == $_GET[$tax] ? " selected='selected'" : '';
1017
$select .= "<option value='{$term_slug}'{$selected}>{$term}</option>";
1018
}
1019
- }
1020
- echo "<select class='postform' name='{$tax}'>{$select}</select>";
1021
}
1022
}
1023
}
38
add_action( 'admin_init', array( $this, 'register_sortable_columns' ) );
39
40
// init filtering
41
+ add_action( 'admin_init', array( $this, 'register_filtering_columns' ) );
42
43
// handle requests for sorting columns
44
add_filter( 'request', array( $this, 'handle_requests_orderby_column'), 1 );
136
private function add_managed_sortable_columns( $type = 'post', $columns )
137
{
138
$display_columns = $this->get_merged_columns($type);
139
+
140
if ( ! $display_columns )
141
return $columns;
142
160
*/
161
public function handle_requests_orderby_column( $vars )
162
{
163
/** Users */
164
// You would expect to see get_orderby_users_vars(), but sorting for
165
// users is handled through a different filter. Not 'request', but 'pre_user_query'.
166
// See handle_requests_orderby_users_column().
167
168
/** Media */
169
+ if ( $this->request_uri_is('upload') ) {
170
$vars = $this->get_orderby_media_vars($vars);
171
+ }
172
173
/** Posts */
174
+ elseif ( !empty($vars['post_type']) ) {
175
$vars = $this->get_orderby_posts_vars($vars);
176
+ }
177
178
+ return $vars;
179
+ }
180
+
181
+ /**
182
+ * Get the default sorting of the column
183
+ *
184
+ * The default sorting of the column is saved to it's property default_order.
185
+ * We will overwrite the requested 'order' and 'orderby' variables with the default_order.
186
+ *
187
+ * @since 1.4.5
188
+ */
189
+ function get_default_sorting_vars( $type, $vars )
190
+ {
191
+ // retrieve the default_order of this type
192
+ $db_columns = Codepress_Admin_Columns::get_stored_columns($type);
193
+
194
+ if ( $db_columns ) {
195
+ foreach ( $db_columns as $column ) {
196
+ if ( empty($column['default_order'] ) )
197
+ continue;
198
+
199
+ // overwrite with the new defaults
200
+ $vars['orderby'] = $this->sanitize_string($column['label']);
201
+ $vars['order'] = $column['default_order'];
202
+ }
203
+ }
204
+
205
return $vars;
206
}
207
212
*/
213
public function handle_requests_orderby_users_column($user_query)
214
{
215
// query vars
216
$vars = $user_query->query_vars;
217
219
$column = $this->get_orderby_type( $vars['orderby'], 'wp-users' );
220
221
if ( empty($column) )
222
+ return $user_query;
223
224
// id
225
+ $type = $id = key($column);
226
227
// Check for user custom fields: column-meta-[customfieldname]
228
if ( Codepress_Admin_Columns::is_column_meta($type) )
229
$type = 'column-user-meta';
230
231
// Check for post count: column-user_postcount-[posttype]
232
+ if ( Codepress_Admin_Columns::get_posttype_by_postcount_column($type) )
233
$type = 'column-user_postcount';
234
235
// var
292
break;
293
294
case 'column-user_postcount' :
295
+ $post_type = Codepress_Admin_Columns::get_posttype_by_postcount_column($id);
296
if ( $post_type ) {
297
$sort_flag = SORT_REGULAR;
298
foreach ( $this->get_users_data() as $u ) {
301
}
302
}
303
break;
304
305
case 'column-user-meta' :
306
$field = $column[$id]['field'];
319
}
320
}
321
break;
322
+
323
+ /** native WP columns */
324
+
325
+ // role column
326
+ case 'role' :
327
+ $sort_flag = SORT_REGULAR;
328
+ foreach ( $this->get_users_data() as $u ) {
329
+ $role = !empty($u->roles[0]) ? $u->roles[0] : '';
330
+ if ($role || $this->show_all_results ) {
331
+ $cusers[$u->ID] = $this->prepare_sort_string_value($role);
332
+ }
333
+ }
334
+ break;
335
336
+ endswitch;
337
+
338
+ // save the order you last used as the default
339
+ // $this->save_sorting_preference( 'wp-users', $type, strtolower($vars['order']) );
340
341
if ( isset($sort_flag) ) {
342
$user_query = $this->get_users_query_vars( $user_query, $cusers, $sort_flag );
501
break;
502
503
case 'column-date_gmt':
504
break;
505
506
/** native WP columns */
573
*/
574
private function get_orderby_media_vars($vars)
575
{
576
+ // apply default sorting when it has been set
577
+ if ( empty( $vars['orderby'] ) ) {
578
+ $vars = $this->get_default_sorting_vars( 'wp-media', $vars );
579
+
580
+ // when sorting still isn't set we will just return the requested vars
581
+ if ( empty( $vars['orderby'] ) )
582
+ return $vars;
583
+ }
584
+
585
// Column
586
$column = $this->get_orderby_type( $vars['orderby'], 'wp-media' );
587
588
if ( empty($column) )
589
return $vars;
590
591
+ $id = key($column);
592
+
593
// var
594
$cposts = array();
595
+ switch( $id ) :
596
597
case 'column-mediaid' :
598
$vars['orderby'] = 'ID';
677
$cposts[$p->ID] = $this->prepare_sort_string_value( $alt );
678
}
679
}
680
+ break;
681
+
682
+ case 'column-filesize' :
683
+ $sort_flag = SORT_NUMERIC;
684
+ foreach ( $this->get_any_posts_by_posttype('attachment') as $p ) {
685
+ $file = wp_get_attachment_url($p->ID);
686
+ if ( $file || $this->show_all_results ) {
687
+ $abs = str_replace( WP_CONTENT_URL, WP_CONTENT_DIR, $file);
688
+ $cposts[$p->ID] = $this->prepare_sort_string_value( filesize($abs) );
689
+ }
690
+ }
691
+ break;
692
693
endswitch;
694
695
+ // save the order you last used as the default
696
+ $this->save_sorting_preference( 'wp-media', $id, $vars['order'] );
697
+
698
// we will add the sorted post ids to vars['post__in'] and remove unused vars
699
if ( isset($sort_flag) ) {
700
$vars = $this->get_vars_post__in( $vars, $cposts, $sort_flag );
712
{
713
$post_type = $vars['post_type'];
714
715
+ // apply default sorting when it has been set
716
+ if ( empty( $vars['orderby'] ) ) {
717
+ $vars = $this->get_default_sorting_vars( 'post', $vars );
718
+
719
+ // when sorting still isn't set we will just return the requested vars
720
+ if ( empty( $vars['orderby'] ) )
721
+ return $vars;
722
+ }
723
+
724
// Column
725
$column = $this->get_orderby_type( $vars['orderby'], $post_type );
726
728
return $vars;
729
730
// id
731
+ $type = $id = key($column);
732
+
733
// Check for taxonomies, such as column-taxonomy-[taxname]
734
if ( strpos($type, 'column-taxonomy-') !== false )
735
$type = 'column-taxonomy';
741
// attachments
742
if ( $type == 'column-attachment-count' )
743
$type = 'column-attachment';
744
+
745
// var
746
$cposts = array();
747
switch( $type ) :
875
break;
876
877
case 'column-taxonomy' :
878
+ $sort_flag = SORT_STRING; // needed to sort
879
+ $taxonomy = str_replace('column-taxonomy-', '', $id);
880
+ $cposts = $this->get_posts_sorted_by_taxonomy($post_type, $taxonomy);
881
break;
882
+
883
+ /** native WP columns */
884
+
885
+ // categories
886
+ case 'categories' :
887
+ $sort_flag = SORT_STRING; // needed to sort
888
+ $cposts = $this->get_posts_sorted_by_taxonomy($post_type, 'category');
889
+ break;
890
+
891
+ // tags
892
+ case 'tags' :
893
+ $sort_flag = SORT_STRING; // needed to sort
894
+ $cposts = $this->get_posts_sorted_by_taxonomy($post_type, 'post_tag');
895
+ break;
896
+
897
endswitch;
898
899
+ // save the order you last used as the default
900
+ $this->save_sorting_preference( $post_type, $type, $vars['order'] );
901
+
902
// we will add the sorted post ids to vars['post__in'] and remove unused vars
903
if ( isset($sort_flag) ) {
904
$vars = $this->get_vars_post__in( $vars, $cposts, $sort_flag );
907
return $vars;
908
}
909
910
+ /**
911
+ * Save sorting preference
912
+ *
913
+ * after sorting we will save this sorting preference to the column item
914
+ * we set the default_order to either asc, desc or empty.
915
+ * only ONE column item PER type can have a default_order
916
+ *
917
+ * @since 1.4.5
918
+ */
919
+ function save_sorting_preference( $type, $column_type, $order = 'asc' )
920
+ {
921
+ $options = get_option('cpac_options');
922
+ if ( isset($options['columns'][$type][$column_type]) ) {
923
+
924
+ // remove the old default_order
925
+ foreach ($options['columns'][$type] as $k => $v) {
926
+ if ( isset( $options['columns'][$type][$k]['default_order'] ) ) {
927
+ unset($options['columns'][$type][$k]['default_order']);
928
+ }
929
+ }
930
+
931
+ // set the new default order
932
+ $options['columns'][$type][$column_type]['default_order'] = $order;
933
+
934
+ // save to DB
935
+ update_option('cpac_options', $options);
936
+ }
937
+ }
938
+
939
+ /**
940
+ * Get posts sorted by taxonomy
941
+ *
942
+ * This will post ID's by the first term in the taxonomy
943
+ *
944
+ * @since 1.4.5
945
+ */
946
+ function get_posts_sorted_by_taxonomy($post_type, $taxonomy = 'category')
947
+ {
948
+ $cposts = array();
949
+ foreach ( $this->get_any_posts_by_posttype($post_type) as $p ) {
950
+ $cposts[$p->ID] = '';
951
+ $terms = get_the_terms($p->ID, $taxonomy);
952
+ if ( !is_wp_error($terms) && !empty($terms) ) {
953
+ // only use the first term to sort
954
+ $term = array_shift(array_values($terms));
955
+ if ( isset($term->term_id) ) {
956
+ $cposts[$p->ID] = sanitize_term_field('name', $term->name, $term->term_id, $term->taxonomy, 'db');
957
+ }
958
+ }
959
+ }
960
+ return $cposts;
961
+ }
962
+
963
/**
964
* Set post__in for use in WP_Query
965
*
1116
{
1117
global $post_type_object;
1118
1119
+ if ( !isset($post_type_object->name) )
1120
+ return false;
1121
+
1122
// make a filter foreach taxonomy
1123
$taxonomies = get_object_taxonomies($post_type_object->name, 'names');
1124
+
1125
+ // get stored columns
1126
+ $db_columns = Codepress_Admin_Columns::get_stored_columns($post_type_object->name);
1127
1128
if ( $taxonomies ) {
1129
foreach ( $taxonomies as $tax ) {
1130
1131
+ // ignore core taxonomies
1132
+ if ( in_array($tax, array('post_tag','category','post_format') ) ) {
1133
+ continue;
1134
+ }
1135
+
1136
+ // only display taxonomy that is active as a column
1137
+ if ( isset($db_columns['column-taxonomy-'.$tax]) && $db_columns['column-taxonomy-'.$tax]['state'] == 'on' ) {
1138
+
1139
$terms = get_terms($tax);
1140
$terms = $this->indent($terms, 0, 'parent', 'term_id');
1141
$terms = $this->apply_dropdown_markup($terms);
1146
$selected = isset($_GET[$tax]) && $term_slug == $_GET[$tax] ? " selected='selected'" : '';
1147
$select .= "<option value='{$term_slug}'{$selected}>{$term}</option>";
1148
}
1149
+ echo "<select class='postform' name='{$tax}'>{$select}</select>";
1150
+ }
1151
}
1152
}
1153
}
classes/values.php CHANGED
@@ -128,19 +128,6 @@ class CPAC_Values
128
return Codepress_Admin_Columns::get_attachment_ids( $post_id );
129
}
130
131
- /**
132
- * Get the posttype from columnname
133
- *
134
- * @since 1.3.1
135
- */
136
- protected function get_posttype_by_postcount_column( $id = '' )
137
- {
138
- if ( strpos($id, 'column-user_postcount-') !== false )
139
- return str_replace('column-user_postcount-', '', $id);
140
-
141
- return false;
142
- }
143
-
144
/**
145
* Get a thumbnail
146
*
@@ -225,6 +212,17 @@ class CPAC_Values
225
return count($user_posts);
226
}
227
228
/**
229
* Get column value of Custom Field
230
*
@@ -296,6 +294,9 @@ class CPAC_Values
296
297
endswitch;
298
299
// add before and after string
300
$meta = "{$before}{$meta}{$after}";
301
@@ -382,6 +383,9 @@ class CPAC_Values
382
383
endswitch;
384
385
// add before and after string
386
$meta = "{$before}{$meta}{$after}";
387
@@ -450,80 +454,6 @@ class CPAC_Values
450
451
return date_i18n( get_option('time_format'), $date );
452
}
453
-
454
- /**
455
- * Get column value of post actions
456
- *
457
- * This part is copied from the Posts List Table class
458
- *
459
- * @since 1.4.2
460
- */
461
- protected function get_column_value_actions( $id, $type = 'posts' )
462
- {
463
- $actions = array();
464
-
465
- /** Posts */
466
- if ( $type == 'posts') {
467
- $post_id = $id;
468
- $post = get_post($post_id);
469
- $title = _draft_or_post_title();
470
- $post_type_object = get_post_type_object( $post->post_type );
471
- $can_edit_post = current_user_can( $post_type_object->cap->edit_post, $post->ID );
472
-
473
- if ( $can_edit_post && 'trash' != $post->post_status ) {
474
- $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '" title="' . esc_attr( __( 'Edit this item' ) ) . '">' . __( 'Edit' ) . '</a>';
475
- $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick&nbsp;Edit' ) . '</a>';
476
- }
477
- if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) {
478
- if ( 'trash' == $post->post_status )
479
- $actions['untrash'] = "<a title='" . esc_attr( __( 'Restore this item from the Trash' ) ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $post->ID ) ), 'untrash-' . $post->post_type . '_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>";
480
- elseif ( EMPTY_TRASH_DAYS )
481
- $actions['trash'] = "<a class='submitdelete' title='" . esc_attr( __( 'Move this item to the Trash' ) ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
482
- if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
483
- $actions['delete'] = "<a class='submitdelete' title='" . esc_attr( __( 'Delete this item permanently' ) ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
484
- }
485
- if ( $post_type_object->public ) {
486
- if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) {
487
- if ( $can_edit_post )
488
- $actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
489
- } elseif ( 'trash' != $post->post_status ) {
490
- $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
491
- }
492
- }
493
- }
494
-
495
- /** Users */
496
- elseif ( $type == 'users' ) {
497
-
498
- $user_object = new WP_User( $id );
499
- $screen = get_current_screen();
500
-
501
- if ( 'site-users-network' == $screen->id )
502
- $url = "site-users.php?id={$this->site_id}&amp;";
503
- else
504
- $url = 'users.php?';
505
-
506
- if ( get_current_user_id() == $user_object->ID ) {
507
- $edit_link = 'profile.php';
508
- } else {
509
- $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), "user-edit.php?user_id=$user_object->ID" ) );
510
- }
511
-
512
- if ( current_user_can( 'edit_user', $user_object->ID ) ) {
513
- $edit = "<strong><a href=\"$edit_link\">$user_object->user_login</a></strong><br />";
514
- $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
515
- } else {
516
- $edit = "<strong>$user_object->user_login</strong><br />";
517
- }
518
-
519
- if ( !is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'delete_user', $user_object->ID ) )
520
- $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "users.php?action=delete&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Delete' ) . "</a>";
521
- if ( is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'remove_user', $user_object->ID ) )
522
- $actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url( $url."action=remove&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Remove' ) . "</a>";
523
- }
524
-
525
- return implode(' | ', $actions);
526
- }
527
}
528
529
?>
128
return Codepress_Admin_Columns::get_attachment_ids( $post_id );
129
}
130
131
/**
132
* Get a thumbnail
133
*
212
return count($user_posts);
213
}
214
215
+ /**
216
+ * Convert file size to readable format
217
+ *
218
+ * @since 1.4.5
219
+ */
220
+ function get_readable_filesize($size)
221
+ {
222
+ $filesizename = array(" Bytes", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB");
223
+ return $size ? round($size/pow(1024, ($i = floor(log($size, 1024)))), 2) . $filesizename[$i] : '0 Bytes';
224
+ }
225
+
226
/**
227
* Get column value of Custom Field
228
*
294
295
endswitch;
296
297
+ // filter for customization
298
+ $meta = apply_filters('cpac_get_column_value_custom_field', $meta, $fieldtype, $field );
299
+
300
// add before and after string
301
$meta = "{$before}{$meta}{$after}";
302
383
384
endswitch;
385
386
+ // filter for customization
387
+ $meta = apply_filters('cpac_get_user_column_value_custom_field', $meta, $fieldtype, $field );
388
+
389
// add before and after string
390
$meta = "{$before}{$meta}{$after}";
391
454
455
return date_i18n( get_option('time_format'), $date );
456
}
457
}
458
459
?>
classes/values/comments.php CHANGED
@@ -127,13 +127,124 @@ class CPAC_Comments_Values extends CPAC_Values
127
$result = $this->get_shortened_string($comment->comment_content, $this->excerpt_length);
128
break;
129
130
default :
131
$result = '';
132
133
endswitch;
134
135
echo $result;
136
}
137
}
138
139
?>
127
$result = $this->get_shortened_string($comment->comment_content, $this->excerpt_length);
128
break;
129
130
+ // actions
131
+ case "column-actions" :
132
+ $result = $this->get_column_value_actions($comment);
133
+ break;
134
+
135
+ // word count
136
+ case "column-word-count" :
137
+ $result = str_word_count( $this->strip_trim( $comment->comment_content ) );
138
+ break;
139
+
140
default :
141
$result = '';
142
143
endswitch;
144
145
+ // Filter for customizing the result output
146
+ apply_filters('cpac-comments-column-result', $result, $type, $column_name, $comment_id);
147
+
148
echo $result;
149
}
150
+
151
+ /**
152
+ * Get column value of comments actions
153
+ *
154
+ * This part is copied from the Comments List Table class
155
+ *
156
+ * @since 1.4.2
157
+ */
158
+ private function get_column_value_actions( $comment )
159
+ {
160
+ global $post, $comment_status;
161
+
162
+ // set uased vars
163
+ $user_can = current_user_can( 'edit_comment', $comment->comment_ID );
164
+ $the_comment_status = wp_get_comment_status( $comment->comment_ID );
165
+
166
+ if ( $user_can ) {
167
+ $del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) );
168
+ $approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) );
169
+
170
+ $url = "comment.php?c=$comment->comment_ID";
171
+
172
+ $approve_url = esc_url( $url . "&action=approvecomment&$approve_nonce" );
173
+ $unapprove_url = esc_url( $url . "&action=unapprovecomment&$approve_nonce" );
174
+ $spam_url = esc_url( $url . "&action=spamcomment&$del_nonce" );
175
+ $unspam_url = esc_url( $url . "&action=unspamcomment&$del_nonce" );
176
+ $trash_url = esc_url( $url . "&action=trashcomment&$del_nonce" );
177
+ $untrash_url = esc_url( $url . "&action=untrashcomment&$del_nonce" );
178
+ $delete_url = esc_url( $url . "&action=deletecomment&$del_nonce" );
179
+ }
180
+
181
+ /** begin - copied from class-wp-comments-list-table */
182
+ if ( $user_can ) {
183
+ // preorder it: Approve | Reply | Quick Edit | Edit | Spam | Trash
184
+ $actions = array(
185
+ 'approve' => '', 'unapprove' => '',
186
+ 'reply' => '',
187
+ 'quickedit' => '',
188
+ 'edit' => '',
189
+ 'spam' => '', 'unspam' => '',
190
+ 'trash' => '', 'untrash' => '', 'delete' => ''
191
+ );
192
+
193
+ if ( $comment_status && 'all' != $comment_status ) { // not looking at all comments
194
+ if ( 'approved' == $the_comment_status )
195
+ $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=unapproved vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
196
+ else if ( 'unapproved' == $the_comment_status )
197
+ $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=approved vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
198
+ } else {
199
+ $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
200
+ $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
201
+ }
202
+
203
+ if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) {
204
+ $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
205
+ } elseif ( 'spam' == $the_comment_status ) {
206
+ $actions['unspam'] = "<a href='$unspam_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:unspam=1 vim-z vim-destructive'>" . _x( 'Not Spam', 'comment' ) . '</a>';
207
+ } elseif ( 'trash' == $the_comment_status ) {
208
+ $actions['untrash'] = "<a href='$untrash_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:untrash=1 vim-z vim-destructive'>" . __( 'Restore' ) . '</a>';
209
+ }
210
+
211
+ if ( 'spam' == $the_comment_status || 'trash' == $the_comment_status || !EMPTY_TRASH_DAYS ) {
212
+ $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::delete=1 delete vim-d vim-destructive'>" . __( 'Delete Permanently' ) . '</a>';
213
+ } else {
214
+ $actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . esc_attr__( 'Move this comment to the trash' ) . "'>" . _x( 'Trash', 'verb' ) . '</a>';
215
+ }
216
+
217
+ if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) {
218
+ $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . esc_attr__( 'Edit comment' ) . "'>". __( 'Edit' ) . '</a>';
219
+ $actions['quickedit'] = '<a onclick="commentReply.open( \''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\' );return false;" class="vim-q" title="'.esc_attr__( 'Quick Edit' ).'" href="#">' . __( 'Quick&nbsp;Edit' ) . '</a>';
220
+ $actions['reply'] = '<a onclick="commentReply.open( \''.$comment->comment_ID.'\',\''.$post->ID.'\' );return false;" class="vim-r" title="'.esc_attr__( 'Reply to this comment' ).'" href="#">' . __( 'Reply' ) . '</a>';
221
+ }
222
+
223
+ $actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment );
224
+
225
+ $i = 0;
226
+ $result = '<div class="cp-row-actions">';
227
+ foreach ( $actions as $action => $link ) {
228
+ ++$i;
229
+ ( ( ( 'approve' == $action || 'unapprove' == $action ) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';
230
+
231
+ // Reply and quickedit need a hide-if-no-js span when not added with ajax
232
+ if ( ( 'reply' == $action || 'quickedit' == $action ) && ! defined('DOING_AJAX') )
233
+ $action .= ' hide-if-no-js';
234
+ elseif ( ( $action == 'untrash' && $the_comment_status == 'trash' ) || ( $action == 'unspam' && $the_comment_status == 'spam' ) ) {
235
+ if ( '1' == get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ) )
236
+ $action .= ' approve';
237
+ else
238
+ $action .= ' unapprove';
239
+ }
240
+
241
+ $result .= "<span class='$action'>$sep$link</span>";
242
+ }
243
+ $result .= '</div>';
244
+ }
245
+ return $result;
246
+ // end copied
247
+ }
248
}
249
250
?>
classes/values/link.php CHANGED
@@ -85,13 +85,40 @@ class CPAC_Link_Values extends CPAC_Values
85
}
86
break;
87
88
default :
89
$result = '';
90
91
endswitch;
92
93
echo $result;
94
}
95
}
96
97
?>
85
}
86
break;
87
88
+ // link actions
89
+ case "column-actions" :
90
+ $result = $this->get_column_value_actions($bookmark);
91
+ break;
92
+
93
default :
94
$result = '';
95
96
endswitch;
97
98
+ // Filter for customizing the result output
99
+ apply_filters('cpac-link-column-result', $result, $type, $column_name, $link_id);
100
+
101
echo $result;
102
}
103
+
104
+ /**
105
+ * Get column value of link actions
106
+ *
107
+ * This part is copied from the Link List Table class
108
+ *
109
+ * @since 1.4.2
110
+ */
111
+ private function get_column_value_actions( $link )
112
+ {
113
+ $actions = array();
114
+
115
+ $edit_link = get_edit_bookmark_link( $link );
116
+
117
+ $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
118
+ $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ) . "' onclick=\"if ( confirm( '" . esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ) . "' ) ) { return true;}return false;\">" . __( 'Delete' ) . "</a>";
119
+
120
+ return implode(' | ', $actions);
121
+ }
122
}
123
124
?>
classes/values/media.php CHANGED
@@ -110,9 +110,19 @@ class CPAC_Media_Values extends CPAC_Values
110
$result = implode('<span class="cpac-divider"></span>', $paths);
111
break;
112
113
// Custom Field
114
case "column-meta" :
115
- $result = $this->get_column_value_custom_field($post_id, $column_name, 'post');
116
break;
117
118
// Image metadata EXIF or IPTC data
@@ -157,14 +167,44 @@ class CPAC_Media_Values extends CPAC_Values
157
case "column-image-title" :
158
$result = !empty( $meta['image_meta']['title'] ) ? $meta['image_meta']['title'] : '';
159
break;
160
-
161
default :
162
$result = '';
163
164
endswitch;
165
166
echo $result;
167
- }
168
}
169
170
?>
110
$result = implode('<span class="cpac-divider"></span>', $paths);
111
break;
112
113
+ case "column-actions" :
114
+ $result = $this->get_column_value_actions($media_id);
115
+ break;
116
+
117
+ case "column-filesize" :
118
+ $file = wp_get_attachment_url($p->ID);
119
+ $abs = str_replace( WP_CONTENT_URL, WP_CONTENT_DIR, $file);
120
+ $result = $this->get_readable_filesize(filesize($abs));
121
+ break;
122
+
123
// Custom Field
124
case "column-meta" :
125
+ $result = $this->get_column_value_custom_field($media_id, $column_name, 'post');
126
break;
127
128
// Image metadata EXIF or IPTC data
167
case "column-image-title" :
168
$result = !empty( $meta['image_meta']['title'] ) ? $meta['image_meta']['title'] : '';
169
break;
170
+
171
default :
172
$result = '';
173
174
endswitch;
175
176
+ // Filter for customizing the result output
177
+ apply_filters('cpac-media-column-result', $result, $type, $column_name, $media_id);
178
+
179
echo $result;
180
+ }
181
+
182
+ /**
183
+ * Get column value of media actions
184
+ *
185
+ * This part is copied from the Media List Table class
186
+ *
187
+ * @since 1.4.2
188
+ */
189
+ private function get_column_value_actions( $id )
190
+ {
191
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
192
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
193
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-media-list-table.php') )
194
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-media-list-table.php');
195
+
196
+ // we need class to get the object actions
197
+ $m = new WP_Media_List_Table;
198
+
199
+ // prevent php notice
200
+ $m->is_trash = isset( $_REQUEST['status'] ) && 'trash' == $_REQUEST['status'];
201
+
202
+ // get media actions
203
+ $media = get_post($id);
204
+ $actions = $m->_get_row_actions( $media, _draft_or_post_title($id) );
205
+
206
+ return implode(' | ', $actions);
207
+ }
208
}
209
210
?>
classes/values/posts.php CHANGED
@@ -58,7 +58,7 @@ class CPAC_Posts_Values extends CPAC_Values
58
// Featured Image
59
case "column-featured_image" :
60
if ( function_exists('has_post_thumbnail') && has_post_thumbnail($post_id) )
61
- $result = get_the_post_thumbnail($post_id, array(80,80));
62
break;
63
64
// Sticky Post
@@ -147,8 +147,8 @@ class CPAC_Posts_Values extends CPAC_Values
147
// Post status
148
case "column-status" :
149
$p = get_post($post_id);
150
- $result = $p->post_status;
151
- if ( $result == 'future')
152
$result = $result . " <p class='description'>" . date_i18n( get_option('date_format') . ' ' . get_option('time_format') , strtotime($p->post_date) ) . "</p>";
153
break;
154
@@ -170,7 +170,7 @@ class CPAC_Posts_Values extends CPAC_Values
170
171
// Post actions ( delete, edit etc. )
172
case "column-actions" :
173
- $result = $this->get_column_value_actions($post_id, 'posts');
174
break;
175
176
// Post Last modified
@@ -191,9 +191,34 @@ class CPAC_Posts_Values extends CPAC_Values
191
192
endswitch;
193
194
echo $result;
195
}
196
197
/**
198
* Comment count extended
199
*
@@ -226,6 +251,47 @@ class CPAC_Posts_Values extends CPAC_Values
226
227
return false;
228
}
229
}
230
231
?>
58
// Featured Image
59
case "column-featured_image" :
60
if ( function_exists('has_post_thumbnail') && has_post_thumbnail($post_id) )
61
+ $result = get_the_post_thumbnail($post_id, array(80,80));
62
break;
63
64
// Sticky Post
147
// Post status
148
case "column-status" :
149
$p = get_post($post_id);
150
+ $result = $this->get_post_status_friendly_name( $p->post_status );
151
+ if ( $p->post_status == 'future')
152
$result = $result . " <p class='description'>" . date_i18n( get_option('date_format') . ' ' . get_option('time_format') , strtotime($p->post_date) ) . "</p>";
153
break;
154
170
171
// Post actions ( delete, edit etc. )
172
case "column-actions" :
173
+ $result = $this->get_column_value_actions($post_id);
174
break;
175
176
// Post Last modified
191
192
endswitch;
193
194
+ // Filter for customizing the result output
195
+ apply_filters('cpac-posts-column-result', $result, $type, $column_name, $post_id);
196
+
197
echo $result;
198
}
199
200
+ /**
201
+ * Returns the friendly name for a given status
202
+ *
203
+ * @since 1.4.4
204
+ */
205
+ private function get_post_status_friendly_name( $status )
206
+ {
207
+ $builtin = array(
208
+ 'publish' => __( 'Published', CPAC_TEXTDOMAIN ),
209
+ 'draft' => __( 'Draft', CPAC_TEXTDOMAIN ),
210
+ 'future' => __( 'Scheduled', CPAC_TEXTDOMAIN ),
211
+ 'private' => __( 'Private', CPAC_TEXTDOMAIN ),
212
+ 'pending' => __( 'Pending Review', CPAC_TEXTDOMAIN ),
213
+ 'trash' => __( 'Trash', CPAC_TEXTDOMAIN )
214
+ );
215
+
216
+ if ( isset($builtin[$status]) )
217
+ $status = $builtin[$status];
218
+
219
+ return $status;
220
+ }
221
+
222
/**
223
* Comment count extended
224
*
251
252
return false;
253
}
254
+
255
+ /**
256
+ * Get column value of post actions
257
+ *
258
+ * This part is copied from the Posts List Table class
259
+ *
260
+ * @since 1.4.2
261
+ */
262
+ protected function get_column_value_actions( $post_id )
263
+ {
264
+ $actions = array();
265
+
266
+ $post = get_post($post_id);
267
+ $title = _draft_or_post_title();
268
+ $post_type_object = get_post_type_object( $post->post_type );
269
+ $can_edit_post = current_user_can( $post_type_object->cap->edit_post, $post->ID );
270
+
271
+ if ( $can_edit_post && 'trash' != $post->post_status ) {
272
+ $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '" title="' . esc_attr( __( 'Edit this item' ) ) . '">' . __( 'Edit' ) . '</a>';
273
+ $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick&nbsp;Edit' ) . '</a>';
274
+ }
275
+ if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) {
276
+ if ( 'trash' == $post->post_status )
277
+ $actions['untrash'] = "<a title='" . esc_attr( __( 'Restore this item from the Trash' ) ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $post->ID ) ), 'untrash-' . $post->post_type . '_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>";
278
+ elseif ( EMPTY_TRASH_DAYS )
279
+ $actions['trash'] = "<a class='submitdelete' title='" . esc_attr( __( 'Move this item to the Trash' ) ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
280
+ if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
281
+ $actions['delete'] = "<a class='submitdelete' title='" . esc_attr( __( 'Delete this item permanently' ) ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
282
+ }
283
+ if ( $post_type_object->public ) {
284
+ if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) {
285
+ if ( $can_edit_post )
286
+ $actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
287
+ } elseif ( 'trash' != $post->post_status ) {
288
+ $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
289
+ }
290
+ }
291
+
292
+
293
+ return implode(' | ', $actions);
294
+ }
295
}
296
297
?>
classes/values/users.php CHANGED
@@ -39,7 +39,7 @@ class CPAC_Users_Values extends CPAC_Values
39
$type = 'column-user-meta';
40
41
// Check for post count: column-user_postcount-[posttype]
42
- if ( $this->get_posttype_by_postcount_column($type) )
43
$type = 'column-user_postcount';
44
45
// Hook
@@ -85,7 +85,7 @@ class CPAC_Users_Values extends CPAC_Values
85
86
// user description
87
case "column-user_postcount" :
88
- $post_type = $this->get_posttype_by_postcount_column($column_name);
89
90
// get post count
91
$count = $this->get_post_count( $post_type, $user_id );
@@ -109,8 +109,51 @@ class CPAC_Users_Values extends CPAC_Values
109
110
endswitch;
111
112
return $result;
113
}
114
}
115
116
?>
39
$type = 'column-user-meta';
40
41
// Check for post count: column-user_postcount-[posttype]
42
+ if ( Codepress_Admin_Columns::get_posttype_by_postcount_column($type) )
43
$type = 'column-user_postcount';
44
45
// Hook
85
86
// user description
87
case "column-user_postcount" :
88
+ $post_type = Codepress_Admin_Columns::get_posttype_by_postcount_column($column_name);
89
90
// get post count
91
$count = $this->get_post_count( $post_type, $user_id );
109
110
endswitch;
111
112
+ // Filter for customizing the result output
113
+ apply_filters('cpac-users-column-result', $result, $type, $column_name, $user_id);
114
+
115
return $result;
116
}
117
+
118
+ /**
119
+ * Get column value of user actions
120
+ *
121
+ * This part is copied from the Users List Table class
122
+ *
123
+ * @since 1.4.2
124
+ */
125
+ private function get_column_value_actions( $id )
126
+ {
127
+ $actions = array();
128
+
129
+ $user_object = new WP_User( $id );
130
+ $screen = get_current_screen();
131
+
132
+ if ( 'site-users-network' == $screen->id )
133
+ $url = "site-users.php?id={$this->site_id}&amp;";
134
+ else
135
+ $url = 'users.php?';
136
+
137
+ if ( get_current_user_id() == $user_object->ID ) {
138
+ $edit_link = 'profile.php';
139
+ } else {
140
+ $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), "user-edit.php?user_id=$user_object->ID" ) );
141
+ }
142
+
143
+ if ( current_user_can( 'edit_user', $user_object->ID ) ) {
144
+ $edit = "<strong><a href=\"$edit_link\">$user_object->user_login</a></strong><br />";
145
+ $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
146
+ } else {
147
+ $edit = "<strong>$user_object->user_login</strong><br />";
148
+ }
149
+
150
+ if ( !is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'delete_user', $user_object->ID ) )
151
+ $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "users.php?action=delete&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Delete' ) . "</a>";
152
+ if ( is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'remove_user', $user_object->ID ) )
153
+ $actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url( $url."action=remove&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Remove' ) . "</a>";
154
+
155
+ return implode(' | ', $actions);
156
+ }
157
}
158
159
?>
codepress-admin-columns.php CHANGED
@@ -1,7 +1,7 @@
1
<?php
2
/*
3
Plugin Name: Codepress Admin Columns
4
- Version: 1.4.4
5
Description: Customise columns on the administration screens for post(types), pages, media, comments, links and users with an easy to use drag-and-drop interface.
6
Author: Codepress
7
Author URI: http://www.codepress.nl
@@ -10,7 +10,7 @@ Text Domain: codepress-admin-columns
10
Domain Path: /languages
11
License: GPLv2
12
13
- Copyright 2011 Codepress info@codepress.nl
14
15
This program is free software; you can redistribute it and/or modify
16
it under the terms of the GNU General Public License version 2 as published by
@@ -26,7 +26,7 @@ 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.4.4' );
30
define( 'CPAC_TEXTDOMAIN', 'codepress-admin-columns' );
31
define( 'CPAC_SLUG', 'codepress-admin-columns' );
32
define( 'CPAC_URL', plugins_url('', __FILE__) );
@@ -59,7 +59,8 @@ class Codepress_Admin_Columns
59
private $post_types,
60
$codepress_url,
61
$wordpress_url,
62
- $api_url;
63
64
/**
65
* Constructor
@@ -88,6 +89,7 @@ class Codepress_Admin_Columns
88
89
// set
90
$this->codepress_url = 'http://www.codepress.nl/plugins/codepress-admin-columns';
91
$this->wordpress_url = 'http://wordpress.org/tags/codepress-admin-columns';
92
93
// translations
@@ -166,7 +168,7 @@ class Codepress_Admin_Columns
166
/**
167
* Register Column Values
168
*
169
- * apply_filters location in includes/screen.php
170
*
171
* @since 1.0
172
*/
@@ -215,9 +217,7 @@ class Codepress_Admin_Columns
215
*/
216
public function callback_add_posts_column_headings($columns)
217
{
218
- global $post;
219
-
220
- return $this->add_columns_headings($post->post_type, $columns);
221
}
222
223
/**
@@ -421,8 +421,9 @@ class Codepress_Admin_Columns
421
foreach ( $db_columns as $id => $values ) {
422
423
// get column meta options from custom columns
424
- if ( $this->is_column_meta($id) )
425
$db_columns[$id]['options'] = $wp_custom_columns['column-meta-1']['options'];
426
427
// add static options
428
elseif ( isset($default_columns[$id]['options']) )
@@ -666,19 +667,21 @@ class Codepress_Admin_Columns
666
667
// run sql
668
$fields = $wpdb->get_results($sql, ARRAY_N);
669
-
670
- // postmeta
671
- if ( $fields ) {
672
- $meta_fields = array();
673
foreach ($fields as $field) {
674
// filter out hidden meta fields
675
if (substr($field[0],0,1) != "_") {
676
$meta_fields[] = $field[0];
677
}
678
- }
679
- return $meta_fields;
680
}
681
682
return false;
683
}
684
@@ -851,23 +854,7 @@ class Codepress_Admin_Columns
851
* @since 1.0
852
*/
853
private function get_wp_default_posts_columns($post_type = 'post')
854
- {
855
- // load dependencies
856
-
857
- // deprecated as of wp3.3
858
- if ( file_exists(ABSPATH . 'wp-admin/includes/template.php') )
859
- require_once(ABSPATH . 'wp-admin/includes/template.php');
860
-
861
- // introduced since wp3.3
862
- if ( file_exists(ABSPATH . 'wp-admin/includes/screen.php') )
863
- require_once(ABSPATH . 'wp-admin/includes/screen.php');
864
-
865
- // used for getting columns
866
- if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
867
- require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
868
- if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-posts-list-table.php') )
869
- require_once(ABSPATH . 'wp-admin/includes/class-wp-posts-list-table.php');
870
-
871
// some plugins depend on settings the $_GET['post_type'] variable such as ALL in One SEO
872
$_GET['post_type'] = $post_type;
873
@@ -875,26 +862,68 @@ class Codepress_Admin_Columns
875
// additional columns that are set by them will be avaible for us
876
do_action('load-edit.php');
877
878
- // we need to change the current screen
879
- global $current_screen;
880
- $org_current_screen = $current_screen;
881
-
882
- // overwrite current_screen global with our post type of choose...
883
- $current_screen->post_type = $post_type;
884
885
- // ...so we can get its columns
886
- $columns = WP_Posts_List_Table::get_columns();
887
888
if ( empty ( $columns ) )
889
return false;
890
-
891
// change to uniform format
892
- $posts_columns = $this->get_uniform_format($columns);
893
894
- // reset current screen
895
- $current_screen = $org_current_screen;
896
897
- return $posts_columns;
898
}
899
900
/**
@@ -918,7 +947,7 @@ class Codepress_Admin_Columns
918
// change to uniform format
919
$columns = $this->get_uniform_format($columns);
920
921
- // add sorting to some of the default links columns
922
$columns = $this->set_sorting_to_default_users_columns($columns);
923
924
return apply_filters('cpac-default-users-columns', $columns);
@@ -1083,7 +1112,7 @@ class Codepress_Admin_Columns
1083
$hide_options = true;
1084
}
1085
1086
- // user icon excerption
1087
if ( $id == 'icon' ) {
1088
$type_label = __('Icon', CPAC_TEXTDOMAIN);
1089
}
@@ -1341,7 +1370,16 @@ class Codepress_Admin_Columns
1341
'options' => array(
1342
'sortorder' => false
1343
)
1344
- )
1345
);
1346
1347
// Get extended image metadata, exif or iptc as available.
@@ -1463,6 +1501,12 @@ class Codepress_Admin_Columns
1463
),
1464
'column-length' => array(
1465
'label' => __('Length', CPAC_TEXTDOMAIN)
1466
)
1467
);
1468
@@ -1499,9 +1543,7 @@ class Codepress_Admin_Columns
1499
'label' => __('Author email', CPAC_TEXTDOMAIN)
1500
),
1501
'column-reply_to' => array(
1502
- 'label' => __('In Reply To', CPAC_TEXTDOMAIN),
1503
-
1504
- // options
1505
'options' => array(
1506
'sortorder' => false
1507
)
@@ -1520,6 +1562,18 @@ class Codepress_Admin_Columns
1520
),
1521
'column-excerpt' => array(
1522
'label' => __('Excerpt', CPAC_TEXTDOMAIN)
1523
)
1524
);
1525
@@ -1556,9 +1610,10 @@ class Codepress_Admin_Columns
1556
$defaults = array(
1557
1558
// stored values
1559
- 'label' => '',
1560
- 'state' => '',
1561
- 'width' => '',
1562
1563
// static values
1564
'options' => array(
@@ -1787,6 +1842,19 @@ class Codepress_Admin_Columns
1787
return false;
1788
}
1789
1790
/**
1791
* Get column value of post attachments
1792
*
@@ -1964,8 +2032,8 @@ class Codepress_Admin_Columns
1964
* @since 1.3
1965
*/
1966
private function set_license_key($type, $key)
1967
- {
1968
- update_option( "cpac_{$type}_ac", $key);
1969
}
1970
1971
/**
@@ -2084,7 +2152,8 @@ class Codepress_Admin_Columns
2084
$sortable_tooltip = "
2085
<p>".__('This will make all of the new columns support sorting', CPAC_TEXTDOMAIN).".</p>
2086
<p>".__('By default WordPress let\'s you sort by title, date, comments and author. This will make you be able to <strong>sort by any column of any type!</strong>', CPAC_TEXTDOMAIN)."</p>
2087
- <p>".__('Perfect for sorting your articles, media files, comments, links and users', CPAC_TEXTDOMAIN).".</p>
2088
<img src='" . CPAC_URL.'/assets/images/addon_sortable_1.png' . "' alt='' />
2089
{$find_out_more}
2090
";
@@ -2260,11 +2329,12 @@ class Codepress_Admin_Columns
2260
<div id="addons-cpac-settings" class="postbox">
2261
<div title="Click to toggle" class="handlediv"><br></div>
2262
<h3 class="hndle">
2263
- <span><?php _e('Addons', CPAC_TEXTDOMAIN) ?></span>
2264
</h3>
2265
<div class="inside">
2266
<p><?php _e('By default WordPress let\'s you only sort by title, date, comments and author.', CPAC_TEXTDOMAIN) ?></p>
2267
- <p><?php _e('Make <strong>all columns</strong> of <strong>all types</strong> support sorting &#8212; with the sorting addon.', CPAC_TEXTDOMAIN) ?></p>
2268
<?php echo $find_out_more ?>
2269
</div>
2270
</div><!-- addons-cpac-settings -->
@@ -2278,7 +2348,7 @@ class Codepress_Admin_Columns
2278
<p><?php _e('Why not do any or all of the following', CPAC_TEXTDOMAIN) ?>:</p>
2279
<ul>
2280
<li><a href="<?php echo $this->codepress_url ?>/"><?php _e('Link to it so other folks can find out about it.', CPAC_TEXTDOMAIN) ?></a></li>
2281
- <li><a href="<?php echo $this->wordpress_url ?>"><?php _e('Give it a 5 star rating on WordPress.org.', CPAC_TEXTDOMAIN) ?></a></li>
2282
<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.', CPAC_TEXTDOMAIN) ?></a></li>
2283
</ul>
2284
</div>
@@ -2291,7 +2361,7 @@ class Codepress_Admin_Columns
2291
</h3>
2292
<div class="inside">
2293
<?php echo $help_text ?>
2294
- <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.', CPAC_TEXTDOMAIN), 'http://wordpress.org/tags/codepress-admin-columns', '<a href="mailto:info@codepress.nl">info@codepress.nl</a>' );?></p>
2295
<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>.", CPAC_TEXTDOMAIN), "{$this->codepress_url}/feedback");?></p>
2296
</div>
2297
</div><!-- side-cpac-settings -->
1
<?php
2
/*
3
Plugin Name: Codepress Admin Columns
4
+ Version: 1.4.5
5
Description: Customise columns on the administration screens for post(types), pages, media, comments, links and users with an easy to use drag-and-drop interface.
6
Author: Codepress
7
Author URI: http://www.codepress.nl
10
Domain Path: /languages
11
License: GPLv2
12
13
+ Copyright 2011-2012 Codepress info@codepress.nl
14
15
This program is free software; you can redistribute it and/or modify
16
it under the terms of the GNU General Public License version 2 as published by
26
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
*/
28
29
+ define( 'CPAC_VERSION', '1.4.5' );
30
define( 'CPAC_TEXTDOMAIN', 'codepress-admin-columns' );
31
define( 'CPAC_SLUG', 'codepress-admin-columns' );
32
define( 'CPAC_URL', plugins_url('', __FILE__) );
59
private $post_types,
60
$codepress_url,
61
$wordpress_url,
62
+ $api_url,
63
+ $admin_page;
64
65
/**
66
* Constructor
89
90
// set
91
$this->codepress_url = 'http://www.codepress.nl/plugins/codepress-admin-columns';
92
+ $this->plugins_url = 'http://wordpress.org/extend/plugins/codepress-admin-columns/';
93
$this->wordpress_url = 'http://wordpress.org/tags/codepress-admin-columns';
94
95
// translations
168
/**
169
* Register Column Values
170
*
171
+ * initializes each Class per type
172
*
173
* @since 1.0
174
*/
217
*/
218
public function callback_add_posts_column_headings($columns)
219
{
220
+ return $this->add_columns_headings( get_query_var('post_type'), $columns);
221
}
222
223
/**
421
foreach ( $db_columns as $id => $values ) {
422
423
// get column meta options from custom columns
424
+ if ( $this->is_column_meta($id) && !empty($wp_custom_columns['column-meta-1']['options']) ) {
425
$db_columns[$id]['options'] = $wp_custom_columns['column-meta-1']['options'];
426
+ }
427
428
// add static options
429
elseif ( isset($default_columns[$id]['options']) )
667
668
// run sql
669
$fields = $wpdb->get_results($sql, ARRAY_N);
670
+
671
+ // postmeta
672
+ $meta_fields = array();
673
+ if ( $fields ) {
674
foreach ($fields as $field) {
675
// filter out hidden meta fields
676
if (substr($field[0],0,1) != "_") {
677
$meta_fields[] = $field[0];
678
}
679
+ }
680
}
681
682
+ if ( !empty($meta_fields) )
683
+ return $meta_fields;
684
+
685
return false;
686
}
687
854
* @since 1.0
855
*/
856
private function get_wp_default_posts_columns($post_type = 'post')
857
+ {
858
// some plugins depend on settings the $_GET['post_type'] variable such as ALL in One SEO
859
$_GET['post_type'] = $post_type;
860
862
// additional columns that are set by them will be avaible for us
863
do_action('load-edit.php');
864
865
+ // some plugins directly hook into get_column_headers, such as woocommerce
866
+ $columns = get_column_headers( 'edit-'.$post_type );
867
868
+ // get default columns
869
+ if ( empty($columns) ) {
870
+
871
+ // deprecated as of wp3.3
872
+ if ( file_exists(ABSPATH . 'wp-admin/includes/template.php') )
873
+ require_once(ABSPATH . 'wp-admin/includes/template.php');
874
+
875
+ // introduced since wp3.3
876
+ if ( file_exists(ABSPATH . 'wp-admin/includes/screen.php') )
877
+ require_once(ABSPATH . 'wp-admin/includes/screen.php');
878
+
879
+ // used for getting columns
880
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
881
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
882
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-posts-list-table.php') )
883
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-posts-list-table.php');
884
+
885
+ // we need to change the current screen
886
+ global $current_screen;
887
+ $org_current_screen = $current_screen;
888
+
889
+ // overwrite current_screen global with our post type of choose...
890
+ $current_screen->post_type = $post_type;
891
+
892
+ // ...so we can get its columns
893
+ $columns = WP_Posts_List_Table::get_columns();
894
+
895
+ // reset current screen
896
+ $current_screen = $org_current_screen;
897
+ }
898
899
if ( empty ( $columns ) )
900
return false;
901
+
902
// change to uniform format
903
+ $columns = $this->get_uniform_format($columns);
904
905
+ // add sorting to some of the default links columns
906
+ $columns = $this->set_sorting_to_default_posts_columns($columns);
907
908
+ return $columns;
909
+ }
910
+
911
+ /**
912
+ * Add Sorting to WP default Posts columns
913
+ *
914
+ * @since 1.4.5
915
+ */
916
+ private function set_sorting_to_default_posts_columns($columns)
917
+ {
918
+ // categories
919
+ if ( !empty($columns['categories']) ) {
920
+ $columns['categories']['options']['sortorder'] = 'on';
921
+ }
922
+ // tags
923
+ if ( !empty($columns['tags']) ) {
924
+ $columns['tags']['options']['sortorder'] = 'on';
925
+ }
926
+ return $columns;
927
}
928
929
/**
947
// change to uniform format
948
$columns = $this->get_uniform_format($columns);
949
950
+ // add sorting to some of the default users columns
951
$columns = $this->set_sorting_to_default_users_columns($columns);
952
953
return apply_filters('cpac-default-users-columns', $columns);
1112
$hide_options = true;
1113
}
1114
1115
+ // user icon exception
1116
if ( $id == 'icon' ) {
1117
$type_label = __('Icon', CPAC_TEXTDOMAIN);
1118
}
1370
'options' => array(
1371
'sortorder' => false
1372
)
1373
+ ),
1374
+ 'column-actions' => array(
1375
+ 'label' => __('Actions', CPAC_TEXTDOMAIN),
1376
+ 'options' => array(
1377
+ 'sortorder' => false
1378
+ )
1379
+ ),
1380
+ 'column-filesize' => array(
1381
+ 'label' => __('File size', CPAC_TEXTDOMAIN)
1382
+ )
1383
);
1384
1385
// Get extended image metadata, exif or iptc as available.
1501
),
1502
'column-length' => array(
1503
'label' => __('Length', CPAC_TEXTDOMAIN)
1504
+ ),
1505
+ 'column-actions' => array(
1506
+ 'label' => __('Actions', CPAC_TEXTDOMAIN),
1507
+ 'options' => array(
1508
+ 'sortorder' => false
1509
+ )
1510
)
1511
);
1512
1543
'label' => __('Author email', CPAC_TEXTDOMAIN)
1544
),
1545
'column-reply_to' => array(
1546
+ 'label' => __('In Reply To', CPAC_TEXTDOMAIN),
1547
'options' => array(
1548
'sortorder' => false
1549
)
1562
),
1563
'column-excerpt' => array(
1564
'label' => __('Excerpt', CPAC_TEXTDOMAIN)
1565
+ ),
1566
+ 'column-actions' => array(
1567
+ 'label' => __('Actions', CPAC_TEXTDOMAIN),
1568
+ 'options' => array(
1569
+ 'sortorder' => false
1570
+ )
1571
+ ),
1572
+ 'column-word-count' => array(
1573
+ 'label' => __('Word count', CPAC_TEXTDOMAIN),
1574
+ 'options' => array(
1575
+ 'sortorder' => false
1576
+ )
1577
)
1578
);
1579
1610
$defaults = array(
1611
1612
// stored values
1613
+ 'label' => '', // custom label
1614
+ 'state' => '', // display state
1615
+ 'width' => '', // column width
1616
+ 'default_order' => '', // set default sorting: asc, desc or empty
1617
1618
// static values
1619
'options' => array(
1842
return false;
1843
}
1844
1845
+ /**
1846
+ * Get the posttype from columnname
1847
+ *
1848
+ * @since 1.3.1
1849
+ */
1850
+ public static function get_posttype_by_postcount_column( $id = '' )
1851
+ {
1852
+ if ( strpos($id, 'column-user_postcount-') !== false )
1853
+ return str_replace('column-user_postcount-', '', $id);
1854
+
1855
+ return false;
1856
+ }
1857
+
1858
/**
1859
* Get column value of post attachments
1860
*
2032
* @since 1.3
2033
*/
2034
private function set_license_key($type, $key)
2035
+ {
2036
+ update_option( "cpac_{$type}_ac", trim($key) );
2037
}
2038
2039
/**
2152
$sortable_tooltip = "
2153
<p>".__('This will make all of the new columns support sorting', CPAC_TEXTDOMAIN).".</p>
2154
<p>".__('By default WordPress let\'s you sort by title, date, comments and author. This will make you be able to <strong>sort by any column of any type!</strong>', CPAC_TEXTDOMAIN)."</p>
2155
+ <p>".__('Perfect for sorting your articles, media files, comments, links and users', CPAC_TEXTDOMAIN).".</p>
2156
+ <p class='description'>".__('(columns that are added by other plugins are not supported)', CPAC_TEXTDOMAIN).".</p>
2157
<img src='" . CPAC_URL.'/assets/images/addon_sortable_1.png' . "' alt='' />
2158
{$find_out_more}
2159
";
2329
<div id="addons-cpac-settings" class="postbox">
2330
<div title="Click to toggle" class="handlediv"><br></div>
2331
<h3 class="hndle">
2332
+ <span><?php _e('Get the Addon', CPAC_TEXTDOMAIN) ?></span>
2333
</h3>
2334
<div class="inside">
2335
<p><?php _e('By default WordPress let\'s you only sort by title, date, comments and author.', CPAC_TEXTDOMAIN) ?></p>
2336
+ <p><?php _e('Make <strong>all columns</strong> of <strong>all types</strong> within the plugin support sorting &#8212; with the sorting addon.', CPAC_TEXTDOMAIN) ?></p>
2337
+ <p class="description"><?php _e('(columns that are added by other plugins are not supported)', CPAC_TEXTDOMAIN) ?>.</p>
2338
<?php echo $find_out_more ?>
2339
</div>
2340
</div><!-- addons-cpac-settings -->
2348
<p><?php _e('Why not do any or all of the following', CPAC_TEXTDOMAIN) ?>:</p>
2349
<ul>
2350
<li><a href="<?php echo $this->codepress_url ?>/"><?php _e('Link to it so other folks can find out about it.', CPAC_TEXTDOMAIN) ?></a></li>
2351
+ <li><a href="<?php echo $this->plugins_url ?>"><?php _e('Give it a 5 star rating on WordPress.org.', CPAC_TEXTDOMAIN) ?></a></li>
2352
<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.', CPAC_TEXTDOMAIN) ?></a></li>
2353
</ul>
2354
</div>
2361
</h3>
2362
<div class="inside">
2363
<?php echo $help_text ?>
2364
+ <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.', CPAC_TEXTDOMAIN), $this->wordpress_url, '<a href="mailto:info@codepress.nl">info@codepress.nl</a>' );?></p>
2365
<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>.", CPAC_TEXTDOMAIN), "{$this->codepress_url}/feedback");?></p>
2366
</div>
2367
</div><!-- side-cpac-settings -->
languages/codepress-admin-columns-fr_FR.mo ADDED
Binary file
languages/codepress-admin-columns-fr_FR.po ADDED
@@ -0,0 +1,530 @@
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Codepress Admin Columns\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-04-11 11:48+0100\n"
6
+ "PO-Revision-Date: 2012-05-19 18:52-0500\n"
7
+ "Last-Translator: Alexandre Girard <alexjir@me.com>\n"
8
+ "Language-Team: Digital Factory <info@digitalfactory.pl>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: __;_e\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "X-Poedit-Language: Polish\n"
15
+ "X-Poedit-Country: POLAND\n"
16
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
17
+ "X-Poedit-SourceCharset: utf-8\n"
18
+ "X-Poedit-SearchPath-0: .\n"
19
+ "X-Poedit-SearchPath-1: ..\n"
20
+
21
+ #: ../codepress-admin-columns.php:171
22
+ msgid "Settings"
23
+ msgstr "Réglages"
24
+
25
+ #: ../codepress-admin-columns.php:363
26
+ msgid "Add Custom Field Column"
27
+ msgstr "Ajouter une colonne de champ personnalisé"
28
+
29
+ #: ../codepress-admin-columns.php:371
30
+ msgid "drag and drop to reorder"
31
+ msgstr "glisser-déposer pour les réorganiser"
32
+
33
+ #: ../codepress-admin-columns.php:511
34
+ #: ../codepress-admin-columns.php:536
35
+ msgid "default"
36
+ msgstr "Par défaut"
37
+
38
+ #: ../codepress-admin-columns.php:534
39
+ #: ../codepress-admin-columns.php:2238
40
+ msgid "Width"
41
+ msgstr "Largeur"
42
+
43
+ #: ../codepress-admin-columns.php:593
44
+ msgid "Default"
45
+ msgstr "Par défaut"
46
+
47
+ #: ../codepress-admin-columns.php:594
48
+ #: ../codepress-admin-columns.php:2278
49
+ msgid "Image"
50
+ msgstr "Image"
51
+
52
+ #: ../codepress-admin-columns.php:595
53
+ msgid "Media Library Icon"
54
+ msgstr "Icône de la médiathèque"
55
+
56
+ #: ../codepress-admin-columns.php:596
57
+ #: ../codepress-admin-columns.php:2031
58
+ #: ../codepress-admin-columns.php:2350
59
+ msgid "Excerpt"
60
+ msgstr "Extrait"
61
+
62
+ #: ../codepress-admin-columns.php:597
63
+ msgid "Multiple Values"
64
+ msgstr "Valeurs multiples"
65
+
66
+ #: ../codepress-admin-columns.php:598
67
+ msgid "Numeric"
68
+ msgstr "Numérique"
69
+
70
+ #: ../codepress-admin-columns.php:599
71
+ #: ../codepress-admin-columns.php:2341
72
+ msgid "Date"
73
+ msgstr "Date"
74
+
75
+ #: ../codepress-admin-columns.php:600
76
+ msgid "Post Title (Post ID's)"
77
+ msgstr "Titre du post (Post ID)"
78
+
79
+ #: ../codepress-admin-columns.php:625
80
+ msgid "This field can not be removed"
81
+ msgstr "Ce champ ne peut pas être retiré"
82
+
83
+ #: ../codepress-admin-columns.php:629
84
+ #: ../codepress-admin-columns.php:1512
85
+ msgid "Remove"
86
+ msgstr "Retirer"
87
+
88
+ #: ../codepress-admin-columns.php:974
89
+ msgid "Standard"
90
+ msgstr "Standard"
91
+
92
+ #: ../codepress-admin-columns.php:1215
93
+ msgid "original"
94
+ msgstr "original"
95
+
96
+ #: ../codepress-admin-columns.php:1381
97
+ #: ../codepress-admin-columns.php:1392
98
+ #, php-format
99
+ msgid "Submitted on <a href=\"%1$s\">%2$s at %3$s</a>"
100
+ msgstr "Soumis le<a href=\"%1$s\">%2$s à %3$s</a>"
101
+
102
+ #: ../codepress-admin-columns.php:1464
103
+ msgid "Edit this item"
104
+ msgstr "Modifier cet élément"
105
+
106
+ #: ../codepress-admin-columns.php:1464
107
+ #: ../codepress-admin-columns.php:1504
108
+ msgid "Edit"
109
+ msgstr "Modifier"
110
+
111
+ #: ../codepress-admin-columns.php:1465
112
+ msgid "Edit this item inline"
113
+ msgstr "Modifier cette ligne d'élément"
114
+
115
+ #: ../codepress-admin-columns.php:1465
116
+ msgid "Quick&nbsp;Edit"
117
+ msgstr "Rapide&nbsp;Modification"
118
+
119
+ #: ../codepress-admin-columns.php:1469
120
+ msgid "Restore this item from the Trash"
121
+ msgstr "Restaurer cet élément de la Corbeille"
122
+
123
+ #: ../codepress-admin-columns.php:1469
124
+ msgid "Restore"
125
+ msgstr "Restaurer"
126
+
127
+ #: ../codepress-admin-columns.php:1471
128
+ msgid "Move this item to the Trash"
129
+ msgstr "Déplacer cet élément vers la Corbeille"
130
+
131
+ #: ../codepress-admin-columns.php:1471
132
+ msgid "Trash"
133
+ msgstr "Corbeille"
134
+
135
+ #: ../codepress-admin-columns.php:1473
136
+ msgid "Delete this item permanently"
137
+ msgstr "Supprimer cet élément de façon permanente"
138
+
139
+ #: ../codepress-admin-columns.php:1473
140
+ msgid "Delete Permanently"
141
+ msgstr "Supprimer définitivement"
142
+
143
+ #: ../codepress-admin-columns.php:1478
144
+ #, php-format
145
+ msgid "Preview &#8220;%s&#8221;"
146
+ msgstr "Arperçu &#8220;%s&#8221;"
147
+
148
+ #: ../codepress-admin-columns.php:1478
149
+ msgid "Preview"
150
+ msgstr "Arperçu"
151
+
152
+ #: ../codepress-admin-columns.php:1480
153
+ #, php-format
154
+ msgid "View &#8220;%s&#8221;"
155
+ msgstr "Voir &#8220;%s&#8221;"
156
+
157
+ #: ../codepress-admin-columns.php:1480
158
+ msgid "View"
159
+ msgstr "Voir"
160
+
161
+ #: ../codepress-admin-columns.php:1510
162
+ msgid "Delete"
163
+ msgstr "Supprimer"
164
+
165
+ #: ../codepress-admin-columns.php:1997
166
+ msgid "Comments"
167
+ msgstr "Commentaires"
168
+
169
+ #: ../codepress-admin-columns.php:2003
170
+ msgid "Icon"
171
+ msgstr "Icône"
172
+
173
+ #: ../codepress-admin-columns.php:2028
174
+ msgid "Featured Image"
175
+ msgstr "Image à la Une"
176
+
177
+ #: ../codepress-admin-columns.php:2034
178
+ #: ../codepress-admin-columns.php:2088
179
+ msgid "Page Order"
180
+ msgstr "Ordre de page"
181
+
182
+ #: ../codepress-admin-columns.php:2037
183
+ #: ../codepress-admin-columns.php:2105
184
+ msgid "Post Format"
185
+ msgstr "Format de post"
186
+
187
+ #: ../codepress-admin-columns.php:2040
188
+ #: ../codepress-admin-columns.php:2223
189
+ #: ../codepress-admin-columns.php:2272
190
+ #: ../codepress-admin-columns.php:2312
191
+ msgid "ID"
192
+ msgstr "ID"
193
+
194
+ #: ../codepress-admin-columns.php:2043
195
+ msgid "Slug"
196
+ msgstr "Slug"
197
+
198
+ #: ../codepress-admin-columns.php:2046
199
+ msgid "Attachment"
200
+ msgstr "Pièce jointe"
201
+
202
+ #: ../codepress-admin-columns.php:2049
203
+ msgid "No. of Attachments"
204
+ msgstr "Nombre de pièces jointes"
205
+
206
+ #: ../codepress-admin-columns.php:2052
207
+ msgid "Roles"
208
+ msgstr "Rôles"
209
+
210
+ #: ../codepress-admin-columns.php:2055
211
+ #: ../codepress-admin-columns.php:3095
212
+ msgid "Status"
213
+ msgstr "Status"
214
+
215
+ #: ../codepress-admin-columns.php:2058
216
+ msgid "Comment status"
217
+ msgstr "Status de commentaire"
218
+
219
+ #: ../codepress-admin-columns.php:2061
220
+ msgid "Ping status"
221
+ msgstr "Status du ping"
222
+
223
+ #: ../codepress-admin-columns.php:2064
224
+ #: ../codepress-admin-columns.php:2175
225
+ msgid "Actions"
226
+ msgstr "Actions"
227
+
228
+ #: ../codepress-admin-columns.php:2074
229
+ msgid "Word count"
230
+ msgstr "Nombre de mots"
231
+
232
+ #: ../codepress-admin-columns.php:2081
233
+ msgid "Sticky"
234
+ msgstr "Attaché"
235
+
236
+ #: ../codepress-admin-columns.php:2090
237
+ msgid "Order"
238
+ msgstr "Ordre"
239
+
240
+ #: ../codepress-admin-columns.php:2098
241
+ msgid "Page Template"
242
+ msgstr "Modèle de page"
243
+
244
+ #: ../codepress-admin-columns.php:2117
245
+ msgid "Taxonomy"
246
+ msgstr "Taxonomy"
247
+
248
+ #: ../codepress-admin-columns.php:2127
249
+ #: ../codepress-admin-columns.php:2197
250
+ #: ../codepress-admin-columns.php:2357
251
+ msgid "Custom Field"
252
+ msgstr "Champ personnalisé"
253
+
254
+ #: ../codepress-admin-columns.php:2133
255
+ #: ../codepress-admin-columns.php:2203
256
+ #: ../codepress-admin-columns.php:2363
257
+ msgid "Field"
258
+ msgstr "Champ"
259
+
260
+ #: ../codepress-admin-columns.php:2154
261
+ msgid "User ID"
262
+ msgstr "ID utilisateur"
263
+
264
+ #: ../codepress-admin-columns.php:2157
265
+ msgid "Nickname"
266
+ msgstr "Surnom"
267
+
268
+ #: ../codepress-admin-columns.php:2160
269
+ msgid "First name"
270
+ msgstr "Prénom"
271
+
272
+ #: ../codepress-admin-columns.php:2163
273
+ msgid "Last name"
274
+ msgstr "Nom"
275
+
276
+ #: ../codepress-admin-columns.php:2166
277
+ msgid "Url"
278
+ msgstr "URL"
279
+
280
+ #: ../codepress-admin-columns.php:2169
281
+ msgid "Registered"
282
+ msgstr "Inscrit"
283
+
284
+ #: ../codepress-admin-columns.php:2172
285
+ #: ../codepress-admin-columns.php:2244
286
+ #: ../codepress-admin-columns.php:2275
287
+ msgid "Description"
288
+ msgstr "Description"
289
+
290
+ #: ../codepress-admin-columns.php:2189
291
+ msgid "Postcount"
292
+ msgstr "Nombre de post"
293
+
294
+ #: ../codepress-admin-columns.php:2226
295
+ msgid "Mime type"
296
+ msgstr "Type Mime"
297
+
298
+ #: ../codepress-admin-columns.php:2229
299
+ msgid "File name"
300
+ msgstr "Nom du fichier"
301
+
302
+ #: ../codepress-admin-columns.php:2232
303
+ msgid "Dimensions"
304
+ msgstr "Dimensions"
305
+
306
+ #: ../codepress-admin-columns.php:2235
307
+ msgid "Height"
308
+ msgstr "Hauteur"
309
+
310
+ #: ../codepress-admin-columns.php:2241
311
+ msgid "Caption"
312
+ msgstr "Légende"
313
+
314
+ #: ../codepress-admin-columns.php:2247
315
+ msgid "Alt"
316
+ msgstr "Texte alternatif"
317
+
318
+ #: ../codepress-admin-columns.php:2250
319
+ msgid "Upload paths"
320
+ msgstr "Adresse web du fichier"
321
+
322
+ #: ../codepress-admin-columns.php:2281
323
+ msgid "Target"
324
+ msgstr "Cible"
325
+
326
+ #: ../codepress-admin-columns.php:2284
327
+ msgid "Owner"
328
+ msgstr "Propriétaire"
329
+
330
+ #: ../codepress-admin-columns.php:2287
331
+ msgid "Notes"
332
+ msgstr "Notes"
333
+
334
+ #: ../codepress-admin-columns.php:2290
335
+ msgid "Rss"
336
+ msgstr "Rss"
337
+
338
+ #: ../codepress-admin-columns.php:2293
339
+ msgid "Length"
340
+ msgstr "Longueur"
341
+
342
+ #: ../codepress-admin-columns.php:2315
343
+ msgid "Author Name"
344
+ msgstr "Nom de l'auteur"
345
+
346
+ #: ../codepress-admin-columns.php:2318
347
+ msgid "Avatar"
348
+ msgstr "Avatar"
349
+
350
+ #: ../codepress-admin-columns.php:2321
351
+ msgid "Author url"
352
+ msgstr "URL de l'auteur"
353
+
354
+ #: ../codepress-admin-columns.php:2324
355
+ msgid "Author IP"
356
+ msgstr "IP de l'auteur"
357
+
358
+ #: ../codepress-admin-columns.php:2327
359
+ msgid "Author email"
360
+ msgstr "Courriel de l'auteur"
361
+
362
+ #: ../codepress-admin-columns.php:2330
363
+ msgid "In Reply To"
364
+ msgstr "En réponse à"
365
+
366
+ #: ../codepress-admin-columns.php:2338
367
+ msgid "Approved"
368
+ msgstr "Approuvé"
369
+
370
+ #: ../codepress-admin-columns.php:2344
371
+ msgid "Date GMT"
372
+ msgstr "Date GMT"
373
+
374
+ #: ../codepress-admin-columns.php:2347
375
+ msgid "Agent"
376
+ msgstr "Agent"
377
+
378
+ #: ../codepress-admin-columns.php:2393
379
+ msgid "Custom"
380
+ msgstr "Personnalisé"
381
+
382
+ #: ../codepress-admin-columns.php:2470
383
+ #: ../codepress-admin-columns.php:3218
384
+ msgid "Addons"
385
+ msgstr "Modules complémentaires"
386
+
387
+ #: ../codepress-admin-columns.php:3036
388
+ #: ../codepress-admin-columns.php:3203
389
+ msgid "find out more"
390
+ msgstr "En savoir plus"
391
+
392
+ #: ../codepress-admin-columns.php:3040
393
+ msgid "This will make all of the new columns support sorting"
394
+ msgstr "Cela rendra l'ensemble des nouvelles colonnes qui supporteront le tri"
395
+
396
+ #: ../codepress-admin-columns.php:3041
397
+ msgid "By default WordPress let's you sort by title, date, comments and author. This will make you be able to <strong>sort by any column of any type!</strong>"
398
+ msgstr "Par défaut WordPress permet de trier par titre, par date, par auteur et par commentaires, cela vous permettera de trier en ordre <strong> selon n'importe quelle colonne et selon n'importe quel type ! </ strong>"
399
+
400
+ #: ../codepress-admin-columns.php:3042
401
+ msgid "Perfect for sorting your articles, media files, comments, links and users"
402
+ msgstr "Parfait pour le tri de vos articles, de vos fichiers multimédias, des commentaires, des liens et des utilisateurs"
403
+
404
+ #: ../codepress-admin-columns.php:3051
405
+ #: ../codepress-admin-columns.php:3053
406
+ msgid "Sortorder"
407
+ msgstr "Ordre de tri"
408
+
409
+ #: ../codepress-admin-columns.php:3061
410
+ msgid "Inactive"
411
+ msgstr "Inatif"
412
+
413
+ #: ../codepress-admin-columns.php:3064
414
+ msgid "Active"
415
+ msgstr "Actif"
416
+
417
+ #: ../codepress-admin-columns.php:3069
418
+ msgid "Fill in your activation code"
419
+ msgstr "Remplissez votre code d'activation"
420
+
421
+ #: ../codepress-admin-columns.php:3070
422
+ msgid "Activate"
423
+ msgstr "Activer"
424
+
425
+ #: ../codepress-admin-columns.php:3074
426
+ msgid "Deactivate"
427
+ msgstr "Désactiver"
428
+
429
+ #: ../codepress-admin-columns.php:3089
430
+ msgid "Activate Add-ons"
431
+ msgstr "Activer modules complémentaires"
432
+
433
+ #: ../codepress-admin-columns.php:3090
434
+ msgid "Add-ons can be unlocked by purchasing a license key. Each key can be used on multiple sites"
435
+ msgstr "Modules complémentaires peuvent être débloqués par l'achat d'une clé de licence. Chaque clé peut être utilisée sur plusieurs sites"
436
+
437
+ #: ../codepress-admin-columns.php:3094
438
+ msgid "Addon"
439
+ msgstr "Module complémentaire"
440
+
441
+ #: ../codepress-admin-columns.php:3096
442
+ msgid "Activation Code"
443
+ msgstr "Code d'activation"
444
+
445
+ #: ../codepress-admin-columns.php:3105
446
+ msgid "Enter your activation code"
447
+ msgstr "Entrez votre code d'activation"
448
+
449
+ #: ../codepress-admin-columns.php:3106
450
+ msgid "Activation code unrecognised"
451
+ msgstr "Code d'activation non reconnue"
452
+
453
+ #: ../codepress-admin-columns.php:3200
454
+ msgid "You will find a short overview at the <strong>Help</strong> section in the top-right screen."
455
+ msgstr "Vous trouverez un bref aperçu de l' <strong>Aide </ strong> section dans l'écran en haut à droite."
456
+
457
+ #: ../codepress-admin-columns.php:3208
458
+ msgid "Codepress Admin Columns"
459
+ msgstr "Codepress Admin Columns"
460
+
461
+ #: ../codepress-admin-columns.php:3221
462
+ msgid "By default WordPress let's you only sort by title, date, comments and author."
463
+ msgstr "Par défaut WordPress permet de trier par titre, par date, par auteur et par commentaires."
464
+
465
+ #: ../codepress-admin-columns.php:3222
466
+ msgid "Make <strong>all columns</strong> of <strong>all types</strong> support sorting &#8212; with the sorting addon."
467
+ msgstr "Faire <strong> que toutes les colonnes </ strong> de <strong> tous types </ strong> supportent le tri &#8212; avec le module complémentaire de tri."
468
+
469
+ #: ../codepress-admin-columns.php:3230
470
+ msgid "Like this plugin?"
471
+ msgstr "Vous aimez ce plugin?"
472
+
473
+ #: ../codepress-admin-columns.php:3233
474
+ msgid "Why not do any or all of the following"
475
+ msgstr "Pourquoi ne pas faire tout ou partie de ce qui suit"
476
+
477
+ #: ../codepress-admin-columns.php:3235
478
+ msgid "Link to it so other folks can find out about it."
479
+ msgstr "Lien vers d'autres gens qui ont trouvés par rapport à ceci."
480
+
481
+ #: ../codepress-admin-columns.php:3236
482
+ msgid "Give it a 5 star rating on WordPress.org."
483
+ msgstr "Donnez une cote de 5 étoiles sur WordPress.org."
484
+
485
+ #: ../codepress-admin-columns.php:3237
486
+ msgid "Donate a token of your appreciation."
487
+ msgstr "Faites un don pour signifier votre appréciation."
488
+
489
+ #: ../codepress-admin-columns.php:3245
490
+ msgid "Need support?"
491
+ msgstr "Besoin d'aide?"
492
+
493
+ #: ../codepress-admin-columns.php:3249
494
+ #, php-format
495
+ 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."
496
+ msgstr "Si vous rencontrez des problèmes avec cette extension, s'il vous plaît parlez à leur sujet dans le <a href=\"%s\"> Forum de Soutien</ a> ou envoyez-moi un message à %s."
497
+
498
+ #: ../codepress-admin-columns.php:3250
499
+ #, php-format
500
+ msgid "If you're sure you've found a bug, or have a feature request, please <a href='%s'>submit your feedback</a>."
501
+ msgstr "Si vous êtes sûr que vous avez trouvé un bug, ou vous avez une demande spéciale, s'il vous plaît <a href='%s'>soumettre vos commentaires </a>."
502
+