Admin Columns - Version 2.5.6

Version Description

  • [Fixed] Row actions are now only added to the first column when the primary column isn't available
  • [Fixed] The true/false field option for the Custom Field column will display a cross icon when the value is empty or zero
Download this release

Release Info

Developer tschutter
Plugin Icon 128x128 Admin Columns
Version 2.5.6
Comparing to
See all releases

Code changes from version 2.5.5 to 2.5.6

classes/column.php CHANGED
@@ -556,7 +556,7 @@ class CPAC_Column {
556
* @param string $label Column instance label
557
* @param CPAC_Column $column_instance Column class instance
558
*/
559
- return apply_filters( 'cac/column/settings_label', stripslashes( str_replace( '[cpac_site_url]', site_url(), $this->options->label ) ), $this );
560
}
561
562
/**
@@ -574,7 +574,7 @@ class CPAC_Column {
574
}
575
576
else {
577
- $string = $this->options->label;
578
$string = strip_tags( $string );
579
$string = preg_replace( "/[^a-zA-Z0-9]+/", "", $string );
580
$string = str_replace( 'http://', '', $string );
@@ -618,7 +618,7 @@ class CPAC_Column {
618
public function get_raw_post_field( $field, $id ) {
619
global $wpdb;
620
621
- return $id ? $wpdb->get_var( $wpdb->prepare( "SELECT " . $wpdb->_real_escape( $field ) . " FROM {$wpdb->posts} WHERE ID = %d LIMIT 1", $id ) ) : false;
622
}
623
624
// since 2.4.8
@@ -948,7 +948,9 @@ class CPAC_Column {
948
);
949
$args = wp_parse_args( $args, $defaults );
950
951
- extract( $args );
952
953
$thumbnails = array();
954
foreach ( $images as $value ) {
@@ -1038,16 +1040,22 @@ class CPAC_Column {
1038
* @return string Imploded array
1039
*/
1040
public function recursive_implode( $glue, $pieces ) {
1041
- foreach ( $pieces as $r_pieces ) {
1042
- if ( is_array( $r_pieces ) ) {
1043
- $retVal[] = $this->recursive_implode( $glue, $r_pieces );
1044
}
1045
- else {
1046
- $retVal[] = $r_pieces;
1047
}
1048
}
1049
- if ( isset( $retVal ) && is_array( $retVal ) ) {
1050
- return implode( $glue, $retVal );
1051
}
1052
1053
return false;
@@ -1149,9 +1157,7 @@ class CPAC_Column {
1149
1150
$name = '';
1151
1152
- if ( ! empty( $this->options->display_author_as ) ) {
1153
-
1154
- $display_as = $this->options->display_author_as;
1155
1156
if ( 'first_last_name' == $display_as ) {
1157
$first = ! empty( $userdata->first_name ) ? $userdata->first_name : '';
@@ -1226,7 +1232,7 @@ class CPAC_Column {
1226
<tr class="column_<?php echo $field_key; ?>">
1227
<?php $this->label_view( $label, $description, $field_key ); ?>
1228
<td class="input">
1229
- <input type="text" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>" value="<?php echo $this->options->excerpt_length; ?>"/>
1230
</td>
1231
</tr>
1232
<?php
@@ -1244,7 +1250,7 @@ class CPAC_Column {
1244
<tr class="column_<?php echo $field_key; ?>">
1245
<?php $this->label_view( $label, $description, $field_key ); ?>
1246
<td class="input">
1247
- <input type="text" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>" value="<?php echo $this->options->link_label; ?>"/>
1248
</td>
1249
</tr>
1250
<?php
@@ -1258,6 +1264,7 @@ class CPAC_Column {
1258
$field_key = 'image_size';
1259
$label = __( 'Preview size', 'codepress-admin-columns' );
1260
1261
?>
1262
<tr class="column_<?php echo $field_key; ?>">
1263
@@ -1265,7 +1272,7 @@ class CPAC_Column {
1265
1266
<td class="input">
1267
<?php foreach ( $sizes = $this->get_all_image_sizes() as $id => $image_label ) : $_sizes = array_keys( $sizes ); ?>
1268
- <?php $selected = $this->options->image_size ? $this->options->image_size : $_sizes[0]; ?>
1269
<label for="<?php $this->attr_id( $field_key ); ?>-<?php echo $id ?>" class="custom-size">
1270
<input type="radio" value="<?php echo $id; ?>" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-<?php echo $id ?>"<?php checked( $selected, $id ); ?>>
1271
<?php echo $image_label; ?>
@@ -1274,15 +1281,15 @@ class CPAC_Column {
1274
1275
<div class="custom_image_size">
1276
<label for="<?php $this->attr_id( $field_key ); ?>-custom" class="custom-size image-size-custom">
1277
- <input type="radio" value="cpac-custom" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-custom"<?php checked( $this->options->image_size, 'cpac-custom' ); ?>><?php _e( 'Custom', 'codepress-admin-columns' ); ?>
1278
</label>
1279
<label for="<?php $this->attr_id( $field_key ); ?>-w"
1280
- class="custom-size-w<?php echo $this->options->image_size != 'cpac-custom' ? ' hidden' : ''; ?>">
1281
- <input type="text" name="<?php $this->attr_name( 'image_size_w' ); ?>" id="<?php $this->attr_id( $field_key ); ?>-w" value="<?php echo $this->options->image_size_w; ?>"/><?php _e( 'width', 'codepress-admin-columns' ); ?>
1282
</label>
1283
<label for="<?php $this->attr_id( $field_key ); ?>-h"
1284
- class="custom-size-h<?php echo $this->options->image_size != 'cpac-custom' ? ' hidden' : ''; ?>">
1285
- <input type="text" name="<?php $this->attr_name( 'image_size_h' ); ?>" id="<?php $this->attr_id( $field_key ); ?>-h" value="<?php echo $this->options->image_size_h; ?>"/><?php _e( 'height', 'codepress-admin-columns' ); ?>
1286
</label>
1287
</div>
1288
</td>
@@ -1314,6 +1321,8 @@ class CPAC_Column {
1314
'first_last_name' => __( 'First and Last Name', 'codepress-admin-columns' ),
1315
);
1316
1317
$this->display_field_select( 'display_author_as', __( 'Display format', 'codepress-admin-columns' ), $nametypes, __( 'This is the format of the author name.', 'codepress-admin-columns' ) );
1318
}
1319
@@ -1447,7 +1456,7 @@ class CPAC_Column {
1447
<div class="meta">
1448
1449
<span title="<?php echo esc_attr( __( 'width', 'codepress-admin-columns' ) ); ?>" class="width" data-indicator-id="">
1450
- <?php echo ! empty( $this->options->width ) ? $this->options->width . $this->options->width_unit : ''; ?>
1451
</span>
1452
1453
<?php
@@ -1503,7 +1512,7 @@ class CPAC_Column {
1503
<tr class="column_label<?php echo $this->properties->hide_label ? ' hidden' : ''; ?>">
1504
<?php $this->label_view( __( 'Label', 'codepress-admin-columns' ), __( 'This is the name which will appear as the column header.', 'codepress-admin-columns' ), 'label' ); ?>
1505
<td class="input">
1506
- <input class="text" type="text" name="<?php $this->attr_name( 'label' ); ?>" id="<?php $this->attr_id( 'label' ); ?>" value="<?php echo esc_attr( $this->options->label ); //echo sanitize_text_field( $this->options->label ); ?>"/>
1507
</td>
1508
</tr><!--.column_label-->
1509
@@ -1511,17 +1520,17 @@ class CPAC_Column {
1511
<?php $this->label_view( __( 'Width', 'codepress-admin-columns' ), '', 'width' ); ?>
1512
<td class="input">
1513
<div class="description" title="<?php _e( 'default', 'codepress-admin-columns' ); ?>">
1514
- <input class="width" type="text" placeholder="<?php _e( 'auto', 'codepress-admin-columns' ); ?>" name="<?php $this->attr_name( 'width' ); ?>" id="<?php $this->attr_id( 'width' ); ?>" value="<?php echo $this->options->width; ?>"/>
1515
- <span class="unit"><?php echo $this->options->width_unit; ?></span>
1516
</div>
1517
<div class="width-slider"></div>
1518
1519
<div class="unit-select">
1520
<label for="<?php $this->attr_id( 'width_unit_px' ); ?>">
1521
- <input type="radio" class="unit" name="<?php $this->attr_name( 'width_unit' ); ?>" id="<?php $this->attr_id( 'width_unit_px' ); ?>" value="px"<?php checked( $this->options->width_unit, 'px' ); ?>/>px
1522
</label>
1523
<label for="<?php $this->attr_id( 'width_unit_perc' ); ?>">
1524
- <input type="radio" class="unit" name="<?php $this->attr_name( 'width_unit' ); ?>" id="<?php $this->attr_id( 'width_unit_perc' ); ?>" value="%"<?php checked( $this->options->width_unit, '%' ); ?>/>%
1525
</label>
1526
</div>
1527
556
* @param string $label Column instance label
557
* @param CPAC_Column $column_instance Column class instance
558
*/
559
+ return apply_filters( 'cac/column/settings_label', stripslashes( str_replace( '[cpac_site_url]', site_url(), $this->get_option( 'label' ) ) ), $this );
560
}
561
562
/**
574
}
575
576
else {
577
+ $string = $this->get_option( 'label' );
578
$string = strip_tags( $string );
579
$string = preg_replace( "/[^a-zA-Z0-9]+/", "", $string );
580
$string = str_replace( 'http://', '', $string );
618
public function get_raw_post_field( $field, $id ) {
619
global $wpdb;
620
621
+ return $id && is_numeric( $id ) ? $wpdb->get_var( $wpdb->prepare( "SELECT " . $wpdb->_real_escape( $field ) . " FROM {$wpdb->posts} WHERE ID = %d LIMIT 1", $id ) ) : false;
622
}
623
624
// since 2.4.8
948
);
949
$args = wp_parse_args( $args, $defaults );
950
951
+ $image_size = $args['image_size'];
952
+ $image_size_w = $args['image_size_w'];
953
+ $image_size_h = $args['image_size_h'];
954
955
$thumbnails = array();
956
foreach ( $images as $value ) {
1040
* @return string Imploded array
1041
*/
1042
public function recursive_implode( $glue, $pieces ) {
1043
+ if ( is_array( $pieces ) ) {
1044
+ foreach ( $pieces as $r_pieces ) {
1045
+ if ( is_array( $r_pieces ) ) {
1046
+ $retVal[] = $this->recursive_implode( $glue, $r_pieces );
1047
+ }
1048
+ else {
1049
+ $retVal[] = $r_pieces;
1050
+ }
1051
}
1052
+ if ( isset( $retVal ) && is_array( $retVal ) ) {
1053
+ return implode( $glue, $retVal );
1054
}
1055
}
1056
+
1057
+ if ( is_scalar( $pieces ) ) {
1058
+ return $pieces;
1059
}
1060
1061
return false;
1157
1158
$name = '';
1159
1160
+ if ( $display_as = $this->get_option( 'display_author_as' ) ) {
1161
1162
if ( 'first_last_name' == $display_as ) {
1163
$first = ! empty( $userdata->first_name ) ? $userdata->first_name : '';
1232
<tr class="column_<?php echo $field_key; ?>">
1233
<?php $this->label_view( $label, $description, $field_key ); ?>
1234
<td class="input">
1235
+ <input type="text" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>" value="<?php echo $this->get_option( 'excerpt_length' ); ?>"/>
1236
</td>
1237
</tr>
1238
<?php
1250
<tr class="column_<?php echo $field_key; ?>">
1251
<?php $this->label_view( $label, $description, $field_key ); ?>
1252
<td class="input">
1253
+ <input type="text" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>" value="<?php echo $this->get_option( 'link_label' ); ?>"/>
1254
</td>
1255
</tr>
1256
<?php
1264
$field_key = 'image_size';
1265
$label = __( 'Preview size', 'codepress-admin-columns' );
1266
1267
+ $image_size = $this->get_option( 'image_size' );
1268
?>
1269
<tr class="column_<?php echo $field_key; ?>">
1270
1272
1273
<td class="input">
1274
<?php foreach ( $sizes = $this->get_all_image_sizes() as $id => $image_label ) : $_sizes = array_keys( $sizes ); ?>
1275
+ <?php $selected = $image_size ? $image_size : $_sizes[0]; ?>
1276
<label for="<?php $this->attr_id( $field_key ); ?>-<?php echo $id ?>" class="custom-size">
1277
<input type="radio" value="<?php echo $id; ?>" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-<?php echo $id ?>"<?php checked( $selected, $id ); ?>>
1278
<?php echo $image_label; ?>
1281
1282
<div class="custom_image_size">
1283
<label for="<?php $this->attr_id( $field_key ); ?>-custom" class="custom-size image-size-custom">
1284
+ <input type="radio" value="cpac-custom" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-custom"<?php checked( $image_size, 'cpac-custom' ); ?>><?php _e( 'Custom', 'codepress-admin-columns' ); ?>
1285
</label>
1286
<label for="<?php $this->attr_id( $field_key ); ?>-w"
1287
+ class="custom-size-w<?php echo $image_size != 'cpac-custom' ? ' hidden' : ''; ?>">
1288
+ <input type="text" name="<?php $this->attr_name( 'image_size_w' ); ?>" id="<?php $this->attr_id( $field_key ); ?>-w" value="<?php echo $this->get_option( 'image_size_w' ); ?>"/><?php _e( 'width', 'codepress-admin-columns' ); ?>
1289
</label>
1290
<label for="<?php $this->attr_id( $field_key ); ?>-h"
1291
+ class="custom-size-h<?php echo $image_size != 'cpac-custom' ? ' hidden' : ''; ?>">
1292
+ <input type="text" name="<?php $this->attr_name( 'image_size_h' ); ?>" id="<?php $this->attr_id( $field_key ); ?>-h" value="<?php echo $this->get_option( 'image_size_h' );; ?>"/><?php _e( 'height', 'codepress-admin-columns' ); ?>
1293
</label>
1294
</div>
1295
</td>
1321
'first_last_name' => __( 'First and Last Name', 'codepress-admin-columns' ),
1322
);
1323
1324
+ asort( $nametypes ); // sorts also when translated
1325
+
1326
$this->display_field_select( 'display_author_as', __( 'Display format', 'codepress-admin-columns' ), $nametypes, __( 'This is the format of the author name.', 'codepress-admin-columns' ) );
1327
}
1328
1456
<div class="meta">
1457
1458
<span title="<?php echo esc_attr( __( 'width', 'codepress-admin-columns' ) ); ?>" class="width" data-indicator-id="">
1459
+ <?php echo $this->get_option( 'width' ) ? $this->get_option( 'width' ) . $this->get_option( 'width_unit' ) : ''; ?>
1460
</span>
1461
1462
<?php
1512
<tr class="column_label<?php echo $this->properties->hide_label ? ' hidden' : ''; ?>">
1513
<?php $this->label_view( __( 'Label', 'codepress-admin-columns' ), __( 'This is the name which will appear as the column header.', 'codepress-admin-columns' ), 'label' ); ?>
1514
<td class="input">
1515
+ <input class="text" type="text" name="<?php $this->attr_name( 'label' ); ?>" id="<?php $this->attr_id( 'label' ); ?>" value="<?php echo esc_attr( $this->get_option( 'label' ) ); ?>"/>
1516
</td>
1517
</tr><!--.column_label-->
1518
1520
<?php $this->label_view( __( 'Width', 'codepress-admin-columns' ), '', 'width' ); ?>
1521
<td class="input">
1522
<div class="description" title="<?php _e( 'default', 'codepress-admin-columns' ); ?>">
1523
+ <input class="width" type="text" placeholder="<?php _e( 'auto', 'codepress-admin-columns' ); ?>" name="<?php $this->attr_name( 'width' ); ?>" id="<?php $this->attr_id( 'width' ); ?>" value="<?php echo $this->get_option( 'width' ); ?>"/>
1524
+ <span class="unit"><?php echo $this->get_option( 'width_unit' ); ?></span>
1525
</div>
1526
<div class="width-slider"></div>
1527
1528
<div class="unit-select">
1529
<label for="<?php $this->attr_id( 'width_unit_px' ); ?>">
1530
+ <input type="radio" class="unit" name="<?php $this->attr_name( 'width_unit' ); ?>" id="<?php $this->attr_id( 'width_unit_px' ); ?>" value="px"<?php checked( $this->get_option( 'width_unit' ), 'px' ); ?>/>px
1531
</label>
1532
<label for="<?php $this->attr_id( 'width_unit_perc' ); ?>">
1533
+ <input type="radio" class="unit" name="<?php $this->attr_name( 'width_unit' ); ?>" id="<?php $this->attr_id( 'width_unit_perc' ); ?>" value="%"<?php checked( $this->get_option( 'width_unit' ), '%' ); ?>/>%
1534
</label>
1535
</div>
1536
classes/column/actions.php CHANGED
@@ -44,7 +44,7 @@ abstract class CPAC_Column_Actions extends CPAC_Column {
44
return false;
45
}
46
47
- if ( ! empty( $this->options->use_icons ) ) {
48
return implode( '', $this->convert_actions_to_icons( $actions ) );
49
}
50
@@ -98,11 +98,11 @@ abstract class CPAC_Column_Actions extends CPAC_Column {
98
<?php $this->label_view( __( 'Use icons?', 'codepress-admin-columns' ), __( 'Use icons instead of text for displaying the actions.', 'codepress-admin-columns' ), 'use_icons' ); ?>
99
<td class="input">
100
<label for="<?php $this->attr_id( 'use_icons' ); ?>-yes">
101
- <input type="radio" value="1" name="<?php $this->attr_name( 'use_icons' ); ?>" id="<?php $this->attr_id( 'use_icons' ); ?>-yes"<?php checked( $this->options->use_icons, '1' ); ?> />
102
<?php _e( 'Yes' ); ?>
103
</label>
104
<label for="<?php $this->attr_id( 'use_icons' ); ?>-no">
105
- <input type="radio" value="" name="<?php $this->attr_name( 'use_icons' ); ?>" id="<?php $this->attr_id( 'use_icons' ); ?>-no"<?php checked( $this->options->use_icons, '' ); ?> />
106
<?php _e( 'No' ); ?>
107
</label>
108
</td>
44
return false;
45
}
46
47
+ if ( $this->get_option( 'use_icons' ) ) {
48
return implode( '', $this->convert_actions_to_icons( $actions ) );
49
}
50
98
<?php $this->label_view( __( 'Use icons?', 'codepress-admin-columns' ), __( 'Use icons instead of text for displaying the actions.', 'codepress-admin-columns' ), 'use_icons' ); ?>
99
<td class="input">
100
<label for="<?php $this->attr_id( 'use_icons' ); ?>-yes">
101
+ <input type="radio" value="1" name="<?php $this->attr_name( 'use_icons' ); ?>" id="<?php $this->attr_id( 'use_icons' ); ?>-yes"<?php checked( $this->get_option( 'use_icons' ), '1' ); ?> />
102
<?php _e( 'Yes' ); ?>
103
</label>
104
<label for="<?php $this->attr_id( 'use_icons' ); ?>-no">
105
+ <input type="radio" value="" name="<?php $this->attr_name( 'use_icons' ); ?>" id="<?php $this->attr_id( 'use_icons' ); ?>-no"<?php checked( $this->get_option( 'use_icons' ), '' ); ?> />
106
<?php _e( 'No' ); ?>
107
</label>
108
</td>
classes/column/comment/excerpt.php CHANGED
@@ -27,7 +27,7 @@ class CPAC_Column_Comment_Excerpt extends CPAC_Column {
27
* @since 2.0
28
*/
29
public function get_value( $id ) {
30
- return $this->get_shortened_string( $this->get_raw_value( $id ), $this->options->excerpt_length );
31
}
32
33
/**
27
* @since 2.0
28
*/
29
public function get_value( $id ) {
30
+ return $this->get_shortened_string( $this->get_raw_value( $id ), $this->get_option( 'excerpt_length' ) );
31
}
32
33
/**
classes/column/custom-field.php CHANGED
@@ -61,7 +61,7 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
61
* @since 3.2.1
62
*/
63
public function get_field_type() {
64
- return $this->options->field_type;
65
}
66
67
/**
@@ -122,6 +122,8 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
122
*/
123
$custom_field_types = apply_filters( 'cac/column/meta/types', $custom_field_types );
124
125
return $custom_field_types;
126
}
127
@@ -139,7 +141,6 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
139
//remove white spaces and strip tags
140
$meta = $this->strip_trim( str_replace( ' ', '', $meta ) );
141
142
- // var
143
$ids = array();
144
145
// check for multiple id's
@@ -154,239 +155,154 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
154
}
155
156
/**
157
- * Get Title by ID - Value method
158
- *
159
- * @since 1.0
160
*
161
- * @param string $meta
162
*
163
- * @return string Titles
164
- */
165
- private function get_titles_by_id( $ids ) {
166
-
167
- $titles = array();
168
-
169
- // display title with link
170
- if ( $ids = $this->get_ids_from_meta( $ids ) ) {
171
- foreach ( (array) $ids as $id ) {
172
-
173
- if ( ! is_numeric( $id ) ) {
174
- continue;
175
- }
176
-
177
- if ( $title = $this->get_post_title( $id ) ) {
178
- $link = get_edit_post_link( $id );
179
- $titles[] = $link ? "<a href='{$link}'>{$title}</a>" : $title;
180
- }
181
- }
182
- }
183
-
184
- return implode( '<span class="cpac-divider"></span>', $titles );
185
- }
186
-
187
- /**
188
- * @since 2.4.9
189
*/
190
- private function get_link_by_meta( $meta ) {
191
- $label = $meta;
192
- if ( filter_var( $meta, FILTER_VALIDATE_URL ) || preg_match( '/[^\w.-]/', $meta ) ) {
193
- if ( ! empty( $this->options->link_label ) ) {
194
- $label = $this->options->link_label;
195
- }
196
- $meta = '<a href="' . $meta . '">' . $label . '</a>';
197
- }
198
199
- return $meta;
200
}
201
202
/**
203
- * Get Users by ID - Value method
204
*
205
* @since 1.0
206
*
207
- * @param string $meta
208
*
209
- * @return string Users
210
*/
211
- private function get_users_by_id( $meta ) {
212
-
213
- $names = array();
214
-
215
- // display username
216
- if ( $ids = $this->get_ids_from_meta( $meta ) ) {
217
- foreach ( (array) $ids as $id ) {
218
- if ( ! is_numeric( $id ) ) {
219
- continue;
220
- }
221
222
- $userdata = get_userdata( $id );
223
- if ( is_object( $userdata ) && ! empty( $userdata->display_name ) ) {
224
225
- // link
226
- $link = get_edit_user_link( $id );
227
228
- $names[] = $link ? "<a href='{$link}'>{$userdata->display_name}</a>" : $userdata->display_name;
229
- }
230
- }
231
}
232
233
- return implode( '<span class="cpac-divider"></span>', $names );
234
}
235
236
/**
237
- * Get Terms by ID - Value method
238
- *
239
- * @since 2.3.2
240
- *
241
- * @param array $meta_value Term ID's
242
- *
243
- * @return string Terms
244
*/
245
- public function get_terms_by_id( $meta_value ) {
246
- // as used by Pods, @todo
247
- if ( ! is_array( $meta_value ) || ! isset( $meta_value['term_id'] ) || ! isset( $meta_value['taxonomy'] ) ) {
248
- return false;
249
}
250
251
- return $this->get_terms_for_display( $meta_value['term_id'], $meta_value['taxonomy'] );
252
}
253
254
/**
255
- * Get meta value
256
- *
257
- * @since 2.0
258
- *
259
- * @param string $meta Contains Meta Value
260
- * @param int $id Optional Object ID
261
- *
262
- * @return string Users
263
*/
264
- public function get_value_by_meta( $meta, $id = null ) {
265
266
- switch ( $this->options->field_type ) :
267
268
case "image" :
269
case "library_id" :
270
- $meta = implode( $this->get_thumbnails( $meta, array(
271
- 'image_size' => $this->options->image_size,
272
- 'image_size_w' => $this->options->image_size_w,
273
- 'image_size_h' => $this->options->image_size_h,
274
) ) );
275
break;
276
277
case "excerpt" :
278
- $meta = $this->get_shortened_string( $meta, $this->options->excerpt_length );
279
break;
280
281
case "date" :
282
- $meta = $this->get_date( $meta, $this->options->date_format );
283
break;
284
285
case "link" :
286
- $meta = $this->get_link_by_meta( $this->get_raw_value( $id ) );
287
break;
288
289
case "title_by_id" :
290
- $meta = $this->get_titles_by_id( $meta );
291
break;
292
293
case "user_by_id" :
294
- $meta = $this->get_users_by_id( $meta );
295
break;
296
297
case "term_by_id" :
298
- $meta = $this->get_terms_by_id( $this->get_raw_value( $id ) );
299
break;
300
301
case "checkmark" :
302
- $checkmark = '<span class="dashicons dashicons-yes cpac_status_yes"></span>';
303
-
304
- if ( empty( $meta ) || 'false' === $meta || '0' === $meta ) {
305
- $checkmark = '<span class="dashicons dashicons-no cpac_status_no"></span>';
306
- }
307
-
308
- $meta = $checkmark;
309
break;
310
311
case "color" :
312
- if ( ! empty( $meta ) ) {
313
- $meta = $this->get_color_for_display( $meta );
314
- }
315
break;
316
317
case "count" :
318
- if ( $count = $this->get_raw_value( $id, false ) ) {
319
- $meta = count( $count );
320
- }
321
break;
322
323
- endswitch;
324
-
325
- return $meta;
326
- }
327
-
328
- /**
329
- * Get Field key
330
- *
331
- * @since 2.0.3
332
- *
333
- * @param string Custom Field Key
334
- */
335
- public function get_field_key() {
336
-
337
- return substr( $this->options->field, 0, 10 ) == "cpachidden" ? str_replace( 'cpachidden', '', $this->options->field ) : $this->options->field;
338
- }
339
-
340
- /**
341
- * Get meta by ID
342
- *
343
- * @since 1.0
344
- *
345
- * @param int $id ID
346
- *
347
- * @return string Meta Value
348
- */
349
- public function get_meta_by_id( $id ) {
350
351
- $meta = $this->get_raw_value( $id );
352
-
353
- // try to turn any array into a comma seperated string for further use
354
- if ( ( 'array' == $this->options->field_type && is_array( $meta ) ) || is_array( $meta ) ) {
355
- $meta = $this->recursive_implode( ', ', $meta );
356
- }
357
-
358
- if ( ! is_string( $meta ) && ! is_numeric( $meta ) ) {
359
- return false;
360
- }
361
-
362
- return $meta;
363
- }
364
-
365
- /**
366
- * @see CPAC_Column::get_raw_value()
367
- * @since 2.0.3
368
- */
369
- public function get_raw_value( $id, $single = true ) {
370
-
371
- $raw_value = '';
372
-
373
- if ( $field_key = $this->get_field_key() ) {
374
- $raw_value = get_metadata( $this->get_meta_type(), $id, $field_key, $single );
375
- }
376
-
377
- return apply_filters( 'cac/column/meta/raw_value', $raw_value, $id, $field_key, $this );
378
- }
379
-
380
- /**
381
- * @see CPAC_Column::get_value()
382
- * @since 1.0
383
- */
384
- public function get_value( $id ) {
385
- $value = '';
386
-
387
- if ( $meta = $this->get_meta_by_id( $id ) ) {
388
- $value = $this->get_value_by_meta( $meta, $id );
389
- }
390
391
/**
392
* Filter the display value for Custom Field columns
@@ -426,7 +342,7 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
426
foreach ( $lists as $type => $fields ) {
427
$list .= "<optgroup label='" . ( 'hidden' == $type ? __( 'Hidden Custom Fields', 'codepress-admin-columns' ) : __( 'Custom Fields', 'codepress-admin-columns' ) ) . "'>";
428
foreach ( $fields as $field ) {
429
- $list .= "<option value='{$field}'" . selected( $field, $this->options->field, false ) . ">" . str_replace( 'cpachidden', '', $field ) . "</option>";
430
}
431
$list .= "</optgroup>";
432
}
@@ -463,19 +379,19 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
463
<?php endif; ?>
464
465
<tr class="column_field_type" data-refresh="1">
466
- <?php $this->label_view( __( "Field Type", 'codepress-admin-columns' ), __( 'This will determine how the value will be displayed.', 'codepress-admin-columns' ) . '<em>' . __( 'Type', 'codepress-admin-columns' ) . ': ' . $this->options->field_type . '</em>', 'field_type' ); ?>
467
<td class="input">
468
<select name="<?php $this->attr_name( 'field_type' ); ?>" id="<?php $this->attr_id( 'field_type' ); ?>">
469
<?php foreach ( $this->get_custom_field_types() as $fieldkey => $fieldtype ) : ?>
470
<option
471
- value="<?php echo $fieldkey ?>"<?php selected( $fieldkey, $this->options->field_type ) ?>><?php echo $fieldtype; ?></option>
472
<?php endforeach; ?>
473
</select>
474
</td>
475
</tr>
476
477
<?php
478
- switch ( $this->options->field_type ) {
479
case 'date':
480
$this->display_field_date_format();
481
break;
61
* @since 3.2.1
62
*/
63
public function get_field_type() {
64
+ return $this->get_option( 'field_type' );
65
}
66
67
/**
122
*/
123
$custom_field_types = apply_filters( 'cac/column/meta/types', $custom_field_types );
124
125
+ asort( $custom_field_types );
126
+
127
return $custom_field_types;
128
}
129
141
//remove white spaces and strip tags
142
$meta = $this->strip_trim( str_replace( ' ', '', $meta ) );
143
144
$ids = array();
145
146
// check for multiple id's
155
}
156
157
/**
158
+ * Get Field key
159
*
160
+ * @since 2.0.3
161
*
162
+ * @param string Custom Field Key
163
*/
164
+ public function get_field_key() {
165
+ $field = $this->get_option( 'field' );
166
167
+ return substr( $field, 0, 10 ) == "cpachidden" ? str_replace( 'cpachidden', '', $field ) : $field;
168
}
169
170
/**
171
+ * Get meta by ID
172
*
173
* @since 1.0
174
*
175
+ * @param int $id ID
176
*
177
+ * @deprecated
178
+ * @return string Meta Value
179
*/
180
+ public function get_meta_by_id( $id ) {
181
+ _deprecated_function( __CLASS__ . '::' . __FUNCTION__ . '()', '2.5.6', __CLASS__ . '::' . 'recursive_implode()' );
182
183
+ return $this->recursive_implode( ', ', $this->get_raw_value( $id ) );
184
+ }
185
186
+ /**
187
+ * @see CPAC_Column::get_raw_value()
188
+ * @since 2.0.3
189
+ */
190
+ public function get_raw_value( $id, $single = true ) {
191
+ $raw_value = '';
192
193
+ if ( $field_key = $this->get_field_key() ) {
194
+ $raw_value = get_metadata( $this->get_meta_type(), $id, $field_key, $single );
195
}
196
197
+ return apply_filters( 'cac/column/meta/raw_value', $raw_value, $id, $field_key, $this );
198
}
199
200
/**
201
+ * @since 2.5.6
202
*/
203
+ public function get_username_by_id( $user_id ) {
204
+ $username = false;
205
+ if ( $user_id && is_numeric( $user_id ) && ( $userdata = get_userdata( $user_id ) ) ) {
206
+ $username = $userdata->display_name;
207
}
208
209
+ return $username;
210
}
211
212
/**
213
+ * @since 2.5.6
214
+ */
215
+ public function get_date_by_string( $date_string ) {
216
+ return $this->get_date( $date_string, $this->get_option( 'date_format' ) );
217
+ }
218
+
219
+ /**
220
+ * @see CPAC_Column::get_value()
221
+ * @since 1.0
222
*/
223
+ public function get_value( $id ) {
224
+
225
+ $value = '';
226
227
+ $raw_value = $this->get_raw_value( $id );
228
+ $raw_string = $this->recursive_implode( ', ', $raw_value );
229
230
+ switch ( $this->get_option( 'field_type' ) ) :
231
case "image" :
232
case "library_id" :
233
+ $value = implode( $this->get_thumbnails( $raw_string, array(
234
+ 'image_size' => $this->get_option( 'image_size' ),
235
+ 'image_size_w' => $this->get_option( 'image_size_w' ),
236
+ 'image_size_h' => $this->get_option( 'image_size_h' ),
237
) ) );
238
break;
239
240
case "excerpt" :
241
+ $value = $this->get_shortened_string( $raw_value, $this->get_option( 'excerpt_length' ) );
242
break;
243
244
case "date" :
245
+ $value = $this->get_date_by_string( $raw_value );
246
break;
247
248
case "link" :
249
+ if ( filter_var( $raw_value, FILTER_VALIDATE_URL ) || preg_match( '/[^\w.-]/', $raw_value ) ) {
250
+ $label = $this->get_option( 'link_label' );
251
+ if ( ! $label ) {
252
+ $label = $raw_value;
253
+ }
254
+ $value = '<a href="' . $raw_value . '">' . $label . '</a>';
255
+ }
256
break;
257
258
case "title_by_id" :
259
+ $titles = array();
260
+ if ( $ids = $this->get_ids_from_meta( $raw_string ) ) {
261
+ foreach ( (array) $ids as $id ) {
262
+ if ( $title = $this->get_post_title( $id ) ) {
263
+ $link = get_edit_post_link( $id );
264
+ $titles[] = $link ? "<a href='{$link}'>{$title}</a>" : $title;
265
+ }
266
+ }
267
+ }
268
+ $value = implode( '<span class="cpac-divider"></span>', $titles );
269
break;
270
271
case "user_by_id" :
272
+ $names = array();
273
+ if ( $ids = $this->get_ids_from_meta( $raw_string ) ) {
274
+ foreach ( (array) $ids as $id ) {
275
+ if ( $username = $this->get_username_by_id( $id ) ) {
276
+ $link = get_edit_user_link( $id );
277
+ $names[] = $link ? "<a href='{$link}'>{$username}</a>" : $username;
278
+ }
279
+ }
280
+ }
281
+ $value = implode( '<span class="cpac-divider"></span>', $names );
282
break;
283
284
case "term_by_id" :
285
+ if ( is_array( $raw_value ) && isset( $raw_value['term_id'] ) && isset( $raw_value['taxonomy'] ) ) {
286
+ $value = $this->get_terms_for_display( $raw_value['term_id'], $raw_value['taxonomy'] );
287
+ }
288
break;
289
290
case "checkmark" :
291
+ $value = ( empty( $raw_value ) || 'false' === $raw_value || '0' === $raw_value ) ? '<span class="dashicons dashicons-no cpac_status_no"></span>' : '<span class="dashicons dashicons-yes cpac_status_yes"></span>';
292
break;
293
294
case "color" :
295
+ $value = $raw_value && is_scalar( $raw_value ) ? $this->get_color_for_display( $raw_value ) : $this->get_empty_char();
296
break;
297
298
case "count" :
299
+ $value = $raw_value ? count( $raw_value ) : $this->get_empty_char();
300
break;
301
302
+ default :
303
+ $value = $raw_string;
304
305
+ endswitch;
306
307
/**
308
* Filter the display value for Custom Field columns
342
foreach ( $lists as $type => $fields ) {
343
$list .= "<optgroup label='" . ( 'hidden' == $type ? __( 'Hidden Custom Fields', 'codepress-admin-columns' ) : __( 'Custom Fields', 'codepress-admin-columns' ) ) . "'>";
344
foreach ( $fields as $field ) {
345
+ $list .= "<option value='{$field}'" . selected( $field, $this->get_option( 'field' ), false ) . ">" . str_replace( 'cpachidden', '', $field ) . "</option>";
346
}
347
$list .= "</optgroup>";
348
}
379
<?php endif; ?>
380
381
<tr class="column_field_type" data-refresh="1">
382
+ <?php $this->label_view( __( "Field Type", 'codepress-admin-columns' ), __( 'This will determine how the value will be displayed.', 'codepress-admin-columns' ) . '<em>' . __( 'Type', 'codepress-admin-columns' ) . ': ' . $this->get_option( 'field_type' ) . '</em>', 'field_type' ); ?>
383
<td class="input">
384
<select name="<?php $this->attr_name( 'field_type' ); ?>" id="<?php $this->attr_id( 'field_type' ); ?>">
385
<?php foreach ( $this->get_custom_field_types() as $fieldkey => $fieldtype ) : ?>
386
<option
387
+ value="<?php echo $fieldkey ?>"<?php selected( $fieldkey, $this->get_option( 'field_type' ) ) ?>><?php echo $fieldtype; ?></option>
388
<?php endforeach; ?>
389
</select>
390
</td>
391
</tr>
392
393
<?php
394
+ switch ( $this->get_option( 'field_type' ) ) {
395
case 'date':
396
$this->display_field_date_format();
397
break;
classes/column/link/notes.php CHANGED
@@ -30,7 +30,7 @@ class CPAC_Column_Link_Notes extends CPAC_Column {
30
31
$bookmark = get_bookmark( $id );
32
33
- return $this->get_shortened_string( $bookmark->link_notes, $this->options->excerpt_length );
34
}
35
36
/**
30
31
$bookmark = get_bookmark( $id );
32
33
+ return $this->get_shortened_string( $bookmark->link_notes, $this->get_option( 'excerpt_length' ) );
34
}
35
36
/**
classes/column/media/full-path.php CHANGED
@@ -23,6 +23,10 @@ class CPAC_Column_Media_Full_Path extends CPAC_Column {
23
$this->options['path_scope'] = 'full';
24
}
25
26
/**
27
* @see CPAC_Column::get_value()
28
* @since 2.0
@@ -32,7 +36,7 @@ class CPAC_Column_Media_Full_Path extends CPAC_Column {
32
$value = '';
33
34
if ( $file = wp_get_attachment_url( $id ) ) {
35
- switch ( $this->options->path_scope ) {
36
case 'relative-domain':
37
$file = str_replace( 'https://', 'http://', $file );
38
$url = str_replace( 'https://', 'http://', home_url( '/' ) );
@@ -86,17 +90,17 @@ class CPAC_Column_Media_Full_Path extends CPAC_Column {
86
<?php $this->label_view( $label, $description, $field_key ); ?>
87
<td class="input">
88
<label for="<?php $this->attr_id( $field_key ); ?>-full">
89
- <input type="radio" value="full" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-full"<?php checked( $this->options->path_scope, 'full' ); ?> />
90
<?php _e( 'Full path', 'codepress-admin-columns' ); ?>
91
</label>
92
<br/>
93
<label for="<?php $this->attr_id( $field_key ); ?>-relative-domain">
94
- <input type="radio" value="relative-domain" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-relative-domain"<?php checked( $this->options->path_scope, 'relative-domain' ); ?> />
95
<?php _e( 'Relative to domain', 'codepress-admin-columns' ); ?>
96
</label>
97
<br/>
98
<label for="<?php $this->attr_id( $field_key ); ?>-relative-uploads">
99
- <input type="radio" value="relative-uploads" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-relative-uploads"<?php checked( $this->options->path_scope, 'relative-uploads' ); ?> />
100
<?php _e( 'Relative to main uploads folder ', 'codepress-admin-columns' ); ?>
101
</label>
102
</td>
23
$this->options['path_scope'] = 'full';
24
}
25
26
+ private function get_pathscope() {
27
+ return $this->get_option( 'path_scope' );
28
+ }
29
+
30
/**
31
* @see CPAC_Column::get_value()
32
* @since 2.0
36
$value = '';
37
38
if ( $file = wp_get_attachment_url( $id ) ) {
39
+ switch ( $this->get_pathscope() ) {
40
case 'relative-domain':
41
$file = str_replace( 'https://', 'http://', $file );
42
$url = str_replace( 'https://', 'http://', home_url( '/' ) );
90
<?php $this->label_view( $label, $description, $field_key ); ?>
91
<td class="input">
92
<label for="<?php $this->attr_id( $field_key ); ?>-full">
93
+ <input type="radio" value="full" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-full"<?php checked( $this->get_pathscope(), 'full' ); ?> />
94
<?php _e( 'Full path', 'codepress-admin-columns' ); ?>
95
</label>
96
<br/>
97
<label for="<?php $this->attr_id( $field_key ); ?>-relative-domain">
98
+ <input type="radio" value="relative-domain" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-relative-domain"<?php checked( $this->get_pathscope(), 'relative-domain' ); ?> />
99
<?php _e( 'Relative to domain', 'codepress-admin-columns' ); ?>
100
</label>
101
<br/>
102
<label for="<?php $this->attr_id( $field_key ); ?>-relative-uploads">
103
+ <input type="radio" value="relative-uploads" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-relative-uploads"<?php checked( $this->get_pathscope(), 'relative-uploads' ); ?> />
104
<?php _e( 'Relative to main uploads folder ', 'codepress-admin-columns' ); ?>
105
</label>
106
</td>
classes/column/post/before-moretag.php CHANGED
@@ -43,7 +43,7 @@ class CPAC_Column_Post_Before_Moretag extends CPAC_Column {
43
$extended = get_extended( $p->post_content );
44
45
if ( ! empty( $extended['extended'] ) ) {
46
- $value = $this->get_shortened_string( $extended['main'], $this->options->excerpt_length );
47
}
48
49
return $value;
43
$extended = get_extended( $p->post_content );
44
45
if ( ! empty( $extended['extended'] ) ) {
46
+ $value = $this->get_shortened_string( $extended['main'], $this->get_option( 'excerpt_length' ) );
47
}
48
49
return $value;
classes/column/post/comment-count.php CHANGED
@@ -42,7 +42,7 @@ class CPAC_Column_Post_Comment_Count extends CPAC_Column {
42
function get_value( $post_id ) {
43
$value = '';
44
45
- $status = $this->options->comment_status;
46
$count = $this->get_raw_value( $post_id );
47
48
if ( $count !== '' ) {
@@ -62,7 +62,7 @@ class CPAC_Column_Post_Comment_Count extends CPAC_Column {
62
function get_raw_value( $post_id ) {
63
$value = '';
64
65
- $status = $this->options->comment_status;
66
$count = wp_count_comments( $post_id );
67
68
if ( isset( $count->{$status} ) ) {
@@ -92,7 +92,7 @@ class CPAC_Column_Post_Comment_Count extends CPAC_Column {
92
<td class="input">
93
<select name="<?php $this->attr_name( 'comment_status' ); ?>" id="<?php $this->attr_id( 'comment-status' ); ?>">
94
<?php foreach ( $this->get_comment_stati() as $key => $label ) : ?>
95
- <option value="<?php echo $key; ?>"<?php selected( $key, $this->options->comment_status ) ?>><?php echo $label; ?></option>
96
<?php endforeach; ?>
97
</select>
98
</td>
42
function get_value( $post_id ) {
43
$value = '';
44
45
+ $status = $this->get_option( 'comment_status' );
46
$count = $this->get_raw_value( $post_id );
47
48
if ( $count !== '' ) {
62
function get_raw_value( $post_id ) {
63
$value = '';
64
65
+ $status = $this->get_option( 'comment_status' );
66
$count = wp_count_comments( $post_id );
67
68
if ( isset( $count->{$status} ) ) {
92
<td class="input">
93
<select name="<?php $this->attr_name( 'comment_status' ); ?>" id="<?php $this->attr_id( 'comment-status' ); ?>">
94
<?php foreach ( $this->get_comment_stati() as $key => $label ) : ?>
95
+ <option value="<?php echo $key; ?>"<?php selected( $key, $this->get_option( 'comment_status' ) ) ?>><?php echo $label; ?></option>
96
<?php endforeach; ?>
97
</select>
98
</td>
classes/column/post/content.php CHANGED
@@ -1,4 +1,5 @@
1
<?php
2
/**
3
* CPAC_Column_Post_Content
4
*
@@ -13,9 +14,9 @@ class CPAC_Column_Post_Content extends CPAC_Column {
13
public function init() {
14
parent::init();
15
16
- $this->properties['type'] = 'column-content';
17
- $this->properties['label'] = __( 'Content', 'codepress-admin-columns' );
18
- $this->properties['object_property'] = 'post_content';
19
20
$this->options['excerpt_length'] = 30;
21
}
@@ -25,7 +26,7 @@ class CPAC_Column_Post_Content extends CPAC_Column {
25
* @since 2.4
26
*/
27
public function get_value( $post_id ) {
28
- return $this->get_shortened_string( $this->get_raw_value( $post_id ), $this->options->excerpt_length );
29
}
30
31
/**
1
<?php
2
+
3
/**
4
* CPAC_Column_Post_Content
5
*
14
public function init() {
15
parent::init();
16
17
+ $this->properties['type'] = 'column-content';
18
+ $this->properties['label'] = __( 'Content', 'codepress-admin-columns' );
19
+ $this->properties['object_property'] = 'post_content';
20
21
$this->options['excerpt_length'] = 30;
22
}
26
* @since 2.4
27
*/
28
public function get_value( $post_id ) {
29
+ return $this->get_shortened_string( $this->get_raw_value( $post_id ), $this->get_option( 'excerpt_length' ) );
30
}
31
32
/**
classes/column/post/estimated-reading-time.php CHANGED
@@ -20,6 +20,10 @@ class CPAC_Column_Post_Estimated_Reading_Time extends CPAC_Column {
20
$this->options['words_per_minute'] = 200;
21
}
22
23
/**
24
* Estimate read time in readable format
25
*
@@ -80,7 +84,7 @@ class CPAC_Column_Post_Estimated_Reading_Time extends CPAC_Column {
80
return 0;
81
}
82
83
- return (int) floor( ( $word_count / $this->options->words_per_minute ) * 60 );
84
}
85
86
/**
@@ -103,7 +107,7 @@ class CPAC_Column_Post_Estimated_Reading_Time extends CPAC_Column {
103
<tr class="column_<?php echo $field_key; ?>">
104
<?php $this->label_view( $label, $description, $field_key ); ?>
105
<td class="input">
106
- <input type="text" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>" value="<?php echo $this->options->words_per_minute; ?>"/>
107
</td>
108
</tr>
109
<?php
20
$this->options['words_per_minute'] = 200;
21
}
22
23
+ private function get_words_per_minute( ) {
24
+ return $this->get_option( 'words_per_minute' );
25
+ }
26
+
27
/**
28
* Estimate read time in readable format
29
*
84
return 0;
85
}
86
87
+ return (int) floor( ( $word_count / $this->get_words_per_minute() ) * 60 );
88
}
89
90
/**
107
<tr class="column_<?php echo $field_key; ?>">
108
<?php $this->label_view( $label, $description, $field_key ); ?>
109
<td class="input">
110
+ <input type="text" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>" value="<?php echo $this->get_words_per_minute(); ?>"/>
111
</td>
112
</tr>
113
<?php
classes/column/post/excerpt.php CHANGED
@@ -26,7 +26,7 @@ class CPAC_Column_Post_Excerpt extends CPAC_Column {
26
* @since 2.0
27
*/
28
public function get_value( $post_id ) {
29
- $value = $this->get_post_excerpt( $post_id, $this->options->excerpt_length );
30
if ( ! has_excerpt( $post_id ) && $value ) {
31
$value = '<span class="cpac-inline-info">' . __( 'Excerpt from content', 'codepress-admin-columns' ) . '</span> ' . $value;
32
}
26
* @since 2.0
27
*/
28
public function get_value( $post_id ) {
29
+ $value = $this->get_post_excerpt( $post_id, $this->get_option( 'excerpt_length' ) );
30
if ( ! has_excerpt( $post_id ) && $value ) {
31
$value = '<span class="cpac-inline-info">' . __( 'Excerpt from content', 'codepress-admin-columns' ) . '</span> ' . $value;
32
}
classes/column/post/permalink.php CHANGED
@@ -30,7 +30,7 @@ class CPAC_Column_Post_Permalink extends CPAC_Column {
30
31
$value = $this->get_raw_value( $post_id );
32
33
- if ( $this->options->link_to_post == 'on' ) {
34
$value = '<a href="' . esc_attr( $value ) .'" target="_blank">' . $value . '</a>';
35
}
36
@@ -61,18 +61,17 @@ class CPAC_Column_Post_Permalink extends CPAC_Column {
61
* @since 2.2.1
62
*/
63
public function display_field_link_to_post() {
64
-
65
$field_key = 'link_to_post';
66
?>
67
<tr class="column_<?php echo $field_key; ?>">
68
<?php $this->label_view( __( 'Link to post', 'codepress-admin-columns' ), __( 'This will make the permalink clickable.', 'codepress-admin-columns' ), $field_key ); ?>
69
<td class="input">
70
<label for="<?php $this->attr_id( $field_key ); ?>-on">
71
- <input type="radio" value="on" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-on"<?php checked( $this->options->link_to_post, 'on' ); ?> />
72
<?php _e( 'Yes' ); ?>
73
</label>
74
<label for="<?php $this->attr_id( $field_key ); ?>-off">
75
- <input type="radio" value="off" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-off"<?php checked( in_array( $this->options->link_to_post, array( '', 'off' ) ) ); ?> />
76
<?php _e( 'No' ); ?>
77
</label>
78
</td>
30
31
$value = $this->get_raw_value( $post_id );
32
33
+ if ( 'on' == $this->get_option( 'link_to_post' ) ) {
34
$value = '<a href="' . esc_attr( $value ) .'" target="_blank">' . $value . '</a>';
35
}
36
61
* @since 2.2.1
62
*/
63
public function display_field_link_to_post() {
64
$field_key = 'link_to_post';
65
?>
66
<tr class="column_<?php echo $field_key; ?>">
67
<?php $this->label_view( __( 'Link to post', 'codepress-admin-columns' ), __( 'This will make the permalink clickable.', 'codepress-admin-columns' ), $field_key ); ?>
68
<td class="input">
69
<label for="<?php $this->attr_id( $field_key ); ?>-on">
70
+ <input type="radio" value="on" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-on"<?php checked( $this->get_option( 'link_to_post' ), 'on' ); ?> />
71
<?php _e( 'Yes' ); ?>
72
</label>
73
<label for="<?php $this->attr_id( $field_key ); ?>-off">
74
+ <input type="radio" value="off" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-off"<?php checked( in_array( $this->get_option( 'link_to_post' ), array( '', 'off' ) ) ); ?> />
75
<?php _e( 'No' ); ?>
76
</label>
77
</td>
classes/column/used-by-menu.php CHANGED
@@ -46,7 +46,7 @@ class CPAC_Column_Used_By_Menu extends CPAC_Column {
46
$term = get_term_by( 'id', $menu_id, 'nav_menu' );
47
48
$title = $term->name;
49
- if ( 'on' == $this->options->link_to_menu ) {
50
$title = '<a href="' . esc_url( add_query_arg( array( 'menu' => $menu_id ), admin_url('nav-menus.php') ) ) . '">' . $term->name . '</a>';
51
}
52
@@ -130,11 +130,11 @@ class CPAC_Column_Used_By_Menu extends CPAC_Column {
130
<?php $this->label_view( __( 'Link to menu', 'codepress-admin-columns' ), __( 'This will make the title link to the menu.', 'codepress-admin-columns' ), $field_key ); ?>
131
<td class="input">
132
<label for="<?php $this->attr_id( $field_key ); ?>-on">
133
- <input type="radio" value="on" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-on"<?php checked( $this->options->link_to_menu, 'on' ); ?> />
134
<?php _e( 'Yes'); ?>
135
</label>
136
<label for="<?php $this->attr_id( $field_key ); ?>-off">
137
- <input type="radio" value="off" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-off"<?php checked( in_array( $this->options->link_to_menu, array( '', 'off' ) ) ); ?> />
138
<?php _e( 'No'); ?>
139
</label>
140
</td>
46
$term = get_term_by( 'id', $menu_id, 'nav_menu' );
47
48
$title = $term->name;
49
+ if ( 'on' == $this->get_option( 'link_to_menu' ) ) {
50
$title = '<a href="' . esc_url( add_query_arg( array( 'menu' => $menu_id ), admin_url('nav-menus.php') ) ) . '">' . $term->name . '</a>';
51
}
52
130
<?php $this->label_view( __( 'Link to menu', 'codepress-admin-columns' ), __( 'This will make the title link to the menu.', 'codepress-admin-columns' ), $field_key ); ?>
131
<td class="input">
132
<label for="<?php $this->attr_id( $field_key ); ?>-on">
133
+ <input type="radio" value="on" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-on"<?php checked( $this->get_option( 'link_to_menu' ), 'on' ); ?> />
134
<?php _e( 'Yes'); ?>
135
</label>
136
<label for="<?php $this->attr_id( $field_key ); ?>-off">
137
+ <input type="radio" value="off" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-off"<?php checked( in_array( $this->get_option( 'link_to_menu' ), array( '', 'off' ) ) ); ?> />
138
<?php _e( 'No'); ?>
139
</label>
140
</td>
classes/column/user/description.php CHANGED
@@ -33,7 +33,7 @@ class CPAC_Column_User_Description extends CPAC_Column {
33
* @since 2.0.3
34
*/
35
function get_raw_value( $user_id ) {
36
- return $this->get_shortened_string( get_the_author_meta( 'user_description', $user_id ), $this->options->excerpt_length );
37
}
38
39
/**
33
* @since 2.0.3
34
*/
35
function get_raw_value( $user_id ) {
36
+ return $this->get_shortened_string( get_the_author_meta( 'user_description', $user_id ), $this->get_option( 'excerpt_length' ) );
37
}
38
39
/**
classes/column/user/post-count.php CHANGED
@@ -29,7 +29,7 @@ class CPAC_Column_User_Post_Count extends CPAC_Column {
29
* @since 2.0
30
*/
31
public function get_count( $user_id ) {
32
- return $this->get_user_postcount( $user_id, $this->options->post_type );
33
}
34
35
/**
@@ -41,7 +41,7 @@ class CPAC_Column_User_Post_Count extends CPAC_Column {
41
42
$count = $this->get_raw_value( $user_id );
43
if ( $count > 0 ) {
44
- $value = "<a href='edit.php?post_type={$this->options->post_type}&author={$user_id}'>{$count}</a>";
45
}
46
47
return $value;
@@ -89,7 +89,7 @@ class CPAC_Column_User_Post_Count extends CPAC_Column {
89
<td class="input">
90
<select name="<?php $this->attr_name( 'post_type' ); ?>" id="<?php $this->attr_id( 'post_type' ); ?>">
91
<?php foreach ( $post_types as $key => $label ) : ?>
92
- <option value="<?php echo $key; ?>"<?php selected( $key, $this->options->post_type ) ?>><?php echo $label; ?></option>
93
<?php endforeach; ?>
94
</select>
95
</td>
29
* @since 2.0
30
*/
31
public function get_count( $user_id ) {
32
+ return $this->get_user_postcount( $user_id, $this->get_option( 'post_type' ) );
33
}
34
35
/**
41
42
$count = $this->get_raw_value( $user_id );
43
if ( $count > 0 ) {
44
+ $value = "<a href='edit.php?post_type=" . $this->get_option( 'post_type' ) . "&author={$user_id}'>{$count}</a>";
45
}
46
47
return $value;
89
<td class="input">
90
<select name="<?php $this->attr_name( 'post_type' ); ?>" id="<?php $this->attr_id( 'post_type' ); ?>">
91
<?php foreach ( $post_types as $key => $label ) : ?>
92
+ <option value="<?php echo $key; ?>"<?php selected( $key, $this->get_option( 'post_type' ) ); ?>><?php echo $label; ?></option>
93
<?php endforeach; ?>
94
</select>
95
</td>
classes/column/user/registered.php CHANGED
@@ -30,7 +30,7 @@ class CPAC_Column_User_Registered extends CPAC_Column {
30
$user_registered = $this->get_raw_value( $user_id );
31
32
// GMT offset is used
33
- return $this->get_date( get_date_from_gmt( $user_registered ), $this->options->date_format );
34
}
35
36
/**
30
$user_registered = $this->get_raw_value( $user_id );
31
32
// GMT offset is used
33
+ return $this->get_date( get_date_from_gmt( $user_registered ), $this->get_option( 'date_format' ) );
34
}
35
36
/**
classes/storage_model.php CHANGED
@@ -135,7 +135,8 @@ abstract class CPAC_Storage_Model {
135
*
136
* @since 2.5
137
*/
138
- protected function get_default_column_widths() {}
139
140
/**
141
* @since 2.5
@@ -512,18 +513,37 @@ abstract class CPAC_Storage_Model {
512
}
513
514
public function init_layout() {
515
if ( $this->get_layout() ) {
516
return;
517
}
518
519
- // try user preference..
520
- $layout_id = $this->get_user_layout_preference();
521
522
- // ..when not found use the first one
523
- if ( ! $this->layout_exists( $layout_id ) ) {
524
- $layout_id = $this->get_single_layout_id();
525
}
526
527
$this->set_layout( $layout_id );
528
}
529
@@ -623,6 +643,7 @@ abstract class CPAC_Storage_Model {
623
'roles' => '',
624
'users' => '',
625
);
626
return array_merge( $default, $args );
627
}
628
@@ -786,7 +807,7 @@ abstract class CPAC_Storage_Model {
786
}
787
788
// only allow php files, exclude .SVN .DS_STORE and such
789
- if ( substr( $leaf->getFilename(), - 4 ) !== '.php' ) {
790
continue;
791
}
792
135
*
136
* @since 2.5
137
*/
138
+ protected function get_default_column_widths() {
139
+ }
140
141
/**
142
* @since 2.5
513
}
514
515
public function init_layout() {
516
+
517
+ // skip when layout is already set
518
if ( $this->get_layout() ) {
519
return;
520
}
521
522
+ $layout_id = null;
523
+
524
+ if ( $layouts_current_user = $this->get_layouts_for_current_user() ) {
525
+ $layout_preference = $this->get_user_layout_preference();
526
527
+ // try user preference..
528
+ foreach ( $layouts_current_user as $_layout ) {
529
+ if ( $_layout->id === $layout_preference ) {
530
+ $layout_id = $_layout->id;
531
+ break;
532
+ }
533
+ }
534
+
535
+ // when no longer available use the first user layout
536
+ if ( ! $layout_id ) {
537
+ $_layouts_current_user = array_values( $layouts_current_user );
538
+ $layout_id = $_layouts_current_user[0]->id;
539
+ }
540
}
541
542
+ // use default WordPress layout
543
+ //else {
544
+ // $layout_id = '_wp_default_'; // layout does not exists and therefor WP default columns will be loaded
545
+ //}
546
+
547
$this->set_layout( $layout_id );
548
}
549
643
'roles' => '',
644
'users' => '',
645
);
646
+
647
return array_merge( $default, $args );
648
}
649
807
}
808
809
// only allow php files, exclude .SVN .DS_STORE and such
810
+ if ( substr( $leaf->getFilename(), -4 ) !== '.php' ) {
811
continue;
812
}
813
codepress-admin-columns.php CHANGED
@@ -1,7 +1,7 @@
1
<?php
2
/*
3
Plugin Name: Admin Columns
4
- Version: 2.5.5
5
Description: Customize 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: AdminColumns.com
7
Author URI: https://www.admincolumns.com
@@ -32,7 +32,7 @@ if ( ! defined( 'ABSPATH' ) ) {
32
}
33
34
// Plugin information
35
- define( 'CPAC_VERSION', '2.5.5' ); // Current plugin version
36
define( 'CPAC_UPGRADE_VERSION', '2.0.0' ); // Latest version which requires an upgrade
37
define( 'CPAC_URL', plugin_dir_url( __FILE__ ) );
38
define( 'CPAC_DIR', plugin_dir_path( __FILE__ ) );
@@ -221,7 +221,9 @@ class CPAC {
221
*/
222
public function set_primary_column( $default ) {
223
if ( $storage_model = $this->get_current_storage_model() ) {
224
- $default = key( $storage_model->get_columns() );
225
}
226
227
return $default;
1
<?php
2
/*
3
Plugin Name: Admin Columns
4
+ Version: 2.5.6
5
Description: Customize 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: AdminColumns.com
7
Author URI: https://www.admincolumns.com
32
}
33
34
// Plugin information
35
+ define( 'CPAC_VERSION', '2.5.6' ); // Current plugin version
36
define( 'CPAC_UPGRADE_VERSION', '2.0.0' ); // Latest version which requires an upgrade
37
define( 'CPAC_URL', plugin_dir_url( __FILE__ ) );
38
define( 'CPAC_DIR', plugin_dir_path( __FILE__ ) );
221
*/
222
public function set_primary_column( $default ) {
223
if ( $storage_model = $this->get_current_storage_model() ) {
224
+ if ( ! $storage_model->get_column_by_name( $default ) ) {
225
+ $default = key( $storage_model->get_columns() );
226
+ }
227
}
228
229
return $default;
languages/codepress-admin-columns.pot CHANGED
@@ -17,7 +17,7 @@ msgstr ""
17
"X-Poedit-SearchPathExcluded-0: *.js\n"
18
"Plural-Forms: nplurals=2; plural=(n != 1);\n\n"
19
20
- #: ../codepress-admin-columns.php:951
21
msgid "Edit columns"
22
msgstr ""
23
@@ -61,211 +61,211 @@ msgstr ""
61
msgid "Enhance the products, orders and coupons overviews with new columns and inline editing."
62
msgstr ""
63
64
- #: ../classes/column.php:347, ../classes/column.php:2543
65
msgid "Custom"
66
msgstr ""
67
68
- #: ../classes/column.php:1445
69
msgid "Thumbnail"
70
msgstr ""
71
72
- #: ../classes/column.php:1447
73
msgid "Medium"
74
msgstr ""
75
76
- #: ../classes/column.php:1449
77
msgid "Large"
78
msgstr ""
79
80
- #: ../classes/column.php:1451
81
msgid "Full"
82
msgstr ""
83
84
- #: ../classes/column.php:2385
85
msgid "Date Format"
86
msgstr ""
87
88
- #: ../classes/column.php:2387
89
msgid "This will determine how the date will be displayed."
90
msgstr ""
91
92
- #: ../classes/column.php:2397
93
msgid "Example:"
94
msgstr ""
95
96
- #: ../classes/column.php:2403
97
msgid "Leave empty for WordPress date format, change your <a href='%s'>default date format here</a>."
98
msgstr ""
99
100
- #: ../classes/column.php:2405
101
msgid "Documentation on date and time formatting."
102
msgstr ""
103
104
- #: ../classes/column.php:2433
105
msgid "Excerpt length"
106
msgstr ""
107
108
- #: ../classes/column.php:2435
109
msgid "Number of words"
110
msgstr ""
111
112
- #: ../classes/column.php:2469
113
msgid "Link label"
114
msgstr ""
115
116
- #: ../classes/column.php:2471
117
msgid "Leave blank to display the url"
118
msgstr ""
119
120
- #: ../classes/column.php:2507
121
msgid "Preview size"
122
msgstr ""
123
124
- #: ../classes/column.php:2551, ../classes/column.php:2885
125
msgid "width"
126
msgstr ""
127
128
- #: ../classes/column.php:2559
129
msgid "height"
130
msgstr ""
131
132
- #: ../classes/column.php:2583
133
msgid "Before"
134
msgstr ""
135
136
- #: ../classes/column.php:2583
137
msgid "This text will appear before the custom field value."
138
msgstr ""
139
140
- #: ../classes/column.php:2585
141
msgid "After"
142
msgstr ""
143
144
- #: ../classes/column.php:2585
145
msgid "This text will appear after the custom field value."
146
msgstr ""
147
148
- #: ../classes/column.php:2603
149
msgid "Display Name"
150
msgstr ""
151
152
- #: ../classes/column.php:2605
153
msgid "First Name"
154
msgstr ""
155
156
- #: ../classes/column.php:2607
157
msgid "Last Name"
158
msgstr ""
159
160
- #: ../classes/column.php:2609, ../classes/column/user/nickname.php:37
161
msgid "Nickname"
162
msgstr ""
163
164
- #: ../classes/column.php:2611
165
msgid "User Login"
166
msgstr ""
167
168
- #: ../classes/column.php:2613
169
msgid "User Email"
170
msgstr ""
171
172
- #: ../classes/column.php:2615, ../classes/column/user/ID.php:35
173
msgid "User ID"
174
msgstr ""
175
176
- #: ../classes/column.php:2617
177
msgid "First and Last Name"
178
msgstr ""
179
180
- #: ../classes/column.php:2623
181
msgid "Display format"
182
msgstr ""
183
184
- #: ../classes/column.php:2623
185
msgid "This is the format of the author name."
186
msgstr ""
187
188
- #: ../classes/column.php:2929
189
msgid "Edit"
190
msgstr ""
191
192
- #: ../classes/column.php:2933, ../classes/column.php:3139
193
msgid "Clone"
194
msgstr ""
195
196
- #: ../classes/column.php:2937
197
msgid "Remove"
198
msgstr ""
199
200
- #: ../classes/column.php:2973, ../classes/column.php:2973, ../classes/column/custom-field.php:466, ../classes/column/comment/type.php:27
201
msgid "Type"
202
msgstr ""
203
204
- #: ../classes/column.php:2973
205
msgid "Choose a column type."
206
msgstr ""
207
208
- #: ../classes/column.php:2973
209
msgid "Name"
210
msgstr ""
211
212
- #: ../classes/column.php:2995
213
msgid "Label"
214
msgstr ""
215
216
- #: ../classes/column.php:2995
217
msgid "This is the name which will appear as the column header."
218
msgstr ""
219
220
- #: ../classes/column.php:3009, ../classes/column/media/width.php:25
221
msgid "Width"
222
msgstr ""
223
224
- #: ../classes/column.php:3013
225
msgid "default"
226
msgstr ""
227
228
- #: ../classes/column.php:3015
229
msgid "auto"
230
msgstr ""
231
232
- #: ../classes/column.php:3183
233
msgid "Property To Display"
234
msgstr ""
235
236
- #: ../classes/column.php:3195
237
msgid "Post property to display for related post(s)."
238
msgstr ""
239
240
- #: ../classes/column.php:3219, ../classes/column/post/author-name.php:179
241
msgid "Link To"
242
msgstr ""
243
244
- #: ../classes/column.php:3229
245
msgid "Edit Post Author"
246
msgstr ""
247
248
- #: ../classes/column.php:3231
249
msgid "View Public Post Author Page"
250
msgstr ""
251
252
- #: ../classes/column.php:3235
253
msgid "Page the posts should link to."
254
msgstr ""
255
256
- #: ../classes/column.php:3255
257
msgid "The %s column is only available in Admin Columns Pro - Business or Developer."
258
msgstr ""
259
260
- #: ../classes/column.php:3263
261
msgid "If you have a business or developer licence please download & install your %s add-on from the <a href='%s'>add-ons tab</a>."
262
msgstr ""
263
264
- #: ../classes/column.php:3271
265
msgid "Admin Columns Pro offers full %s integration, allowing you to easily display and edit %s fields from within your overview."
266
msgstr ""
267
268
- #: ../classes/column.php:3283
269
msgid "Find out more"
270
msgstr ""
271
@@ -393,7 +393,7 @@ msgstr ""
393
msgid "By clicking on the triangle you will see the column options. By using the draggable slider you can set the width of the columns in percentages."
394
msgstr ""
395
396
- #: ../classes/settings.php:765, ../classes/column/custom-field.php:24, ../classes/column/custom-field.php:26, ../classes/column/custom-field.php:447, ../classes/column/custom-field.php:451
397
msgid "Custom Field"
398
msgstr ""
399
@@ -405,7 +405,7 @@ msgstr ""
405
msgid "The custom field colum uses the custom fields from posts and users. There are 10 types which you can set."
406
msgstr ""
407
408
- #: ../classes/settings.php:773, ../classes/storage_model.php:1699, ../classes/column/custom-field.php:97, ../classes/column/default.php:22
409
msgid "Default"
410
msgstr ""
411
@@ -445,7 +445,7 @@ msgstr ""
445
msgid "Value: Can be unix time stamp or a date format as described in the <a href='%s'>Codex</a>. You can change the outputted date format at the <a href='%s'>general settings</a> page."
446
msgstr ""
447
448
- #: ../classes/settings.php:783, ../classes/column/post/excerpt.php:39
449
msgid "Excerpt"
450
msgstr ""
451
@@ -761,7 +761,7 @@ msgstr ""
761
msgid "Get this add-on"
762
msgstr ""
763
764
- #: ../classes/storage_model.php:429
765
msgid "Columns by Plugins"
766
msgstr ""
767
@@ -769,15 +769,15 @@ msgstr ""
769
msgid "Other"
770
msgstr ""
771
772
- #: ../classes/storage_model.php:1395
773
msgid "No columns settings available."
774
msgstr ""
775
776
- #: ../classes/storage_model.php:1437
777
msgid "You are trying to store the same settings for %s."
778
msgstr ""
779
780
- #: ../classes/storage_model.php:2109
781
msgid "View"
782
msgstr ""
783
@@ -873,39 +873,39 @@ msgstr ""
873
msgid "Term Name (Term ID's)"
874
msgstr ""
875
876
- #: ../classes/column/custom-field.php:427
877
msgid "Hidden Custom Fields"
878
msgstr ""
879
880
- #: ../classes/column/custom-field.php:427
881
msgid "Custom Fields"
882
msgstr ""
883
884
- #: ../classes/column/custom-field.php:447
885
msgid "Enter your custom field key."
886
msgstr ""
887
888
- #: ../classes/column/custom-field.php:451
889
msgid "Select your custom field."
890
msgstr ""
891
892
- #: ../classes/column/custom-field.php:458
893
msgid "No custom fields available."
894
msgstr ""
895
896
- #: ../classes/column/custom-field.php:458
897
msgid "Please create a %s item first."
898
msgstr ""
899
900
- #: ../classes/column/custom-field.php:466
901
msgid "Field Type"
902
msgstr ""
903
904
- #: ../classes/column/custom-field.php:466
905
msgid "This will determine how the value will be displayed."
906
msgstr ""
907
908
- #: ../classes/column/taxonomy.php:39, ../classes/column/taxonomy.php:165
909
msgid "Taxonomy"
910
msgstr ""
911
@@ -925,7 +925,7 @@ msgstr ""
925
msgid "Post Type"
926
msgstr ""
927
928
- #: ../classes/column/comment/ID.php:37, ../classes/column/link/ID.php:37, ../classes/column/media/ID.php:37, ../classes/column/post/ID.php:37
929
msgid "ID"
930
msgstr ""
931
@@ -965,7 +965,7 @@ msgstr ""
965
msgid "Date GMT"
966
msgstr ""
967
968
- #: ../classes/column/comment/excerpt.php:37, ../classes/column/post/content.php:37
969
msgid "Content"
970
msgstr ""
971
@@ -989,7 +989,7 @@ msgstr ""
989
msgid "Word count"
990
msgstr ""
991
992
- #: ../classes/column/link/description.php:37, ../classes/column/media/description.php:39, ../classes/column/user/description.php:35
993
msgid "Description"
994
msgstr ""
995
@@ -1013,104 +1013,28 @@ msgstr ""
1013
msgid "Target"
1014
msgstr ""
1015
1016
- #: ../classes/column/media/alternate-text.php:37
1017
- msgid "Alt"
1018
- msgstr ""
1019
-
1020
- #: ../classes/column/media/attached-to.php:37
1021
- msgid "Attached to post"
1022
- msgstr ""
1023
-
1024
- #: ../classes/column/media/available-sizes.php:39
1025
- msgid "Available Sizes"
1026
- msgstr ""
1027
-
1028
- #: ../classes/column/media/available-sizes.php:79
1029
- msgid "full size"
1030
- msgstr ""
1031
-
1032
- #: ../classes/column/media/caption.php:37, ../classes/column/media/exif-data.php:81
1033
- msgid "Caption"
1034
- msgstr ""
1035
-
1036
- #: ../classes/column/media/dimensions.php:39
1037
- msgid "Dimensions"
1038
- msgstr ""
1039
-
1040
- #: ../classes/column/media/exif-data.php:37
1041
- msgid "EXIF data"
1042
- msgstr ""
1043
-
1044
- #: ../classes/column/media/exif-data.php:75
1045
- msgid "Aperture"
1046
- msgstr ""
1047
-
1048
- #: ../classes/column/media/exif-data.php:77
1049
- msgid "Credit"
1050
- msgstr ""
1051
-
1052
- #: ../classes/column/media/exif-data.php:79
1053
- msgid "Camera"
1054
- msgstr ""
1055
-
1056
- #: ../classes/column/media/exif-data.php:83
1057
- msgid "Timestamp"
1058
- msgstr ""
1059
-
1060
- #: ../classes/column/media/exif-data.php:85
1061
- msgid "Copyright EXIF"
1062
- msgstr ""
1063
-
1064
- #: ../classes/column/media/exif-data.php:87
1065
- msgid "Focal Length"
1066
- msgstr ""
1067
-
1068
- #: ../classes/column/media/exif-data.php:89
1069
- msgid "ISO"
1070
- msgstr ""
1071
-
1072
- #: ../classes/column/media/exif-data.php:91
1073
- msgid "Shutter Speed"
1074
- msgstr ""
1075
-
1076
- #: ../classes/column/media/exif-data.php:93
1077
- msgid "Title"
1078
- msgstr ""
1079
-
1080
- #: ../classes/column/media/file-name.php:37
1081
- msgid "File name"
1082
- msgstr ""
1083
-
1084
- #: ../classes/column/media/file-size.php:37
1085
- msgid "File size"
1086
- msgstr ""
1087
-
1088
- #: ../classes/column/media/full-path.php:39, ../classes/column/media/full-path.php:179
1089
- msgid "Full path"
1090
- msgstr ""
1091
-
1092
- #: ../classes/column/media/full-path.php:161
1093
- msgid "Path scope"
1094
msgstr ""
1095
1096
- #: ../classes/column/media/full-path.php:163
1097
- msgid "Part of the file path to display"
1098
msgstr ""
1099
1100
- #: ../classes/column/media/full-path.php:189
1101
- msgid "Relative to domain"
1102
msgstr ""
1103
1104
- #: ../classes/column/media/full-path.php:199
1105
- msgid "Relative to main uploads folder "
1106
msgstr ""
1107
1108
- #: ../classes/column/media/height.php:27
1109
- msgid "Height"
1110
msgstr ""
1111
1112
- #: ../classes/column/media/mime-type.php:37
1113
- msgid "Mime type"
1114
msgstr ""
1115
1116
#: ../classes/column/post/attachment-count.php:27
@@ -1173,27 +1097,27 @@ msgstr ""
1173
msgid "Estimated Reading Time"
1174
msgstr ""
1175
1176
- #: ../classes/column/post/estimated-reading-time.php:127
1177
msgid "second"
1178
msgid_plural "seconds"
1179
msgstr[0] ""
1180
msgstr[1] ""
1181
1182
- #: ../classes/column/post/estimated-reading-time.php:133
1183
msgid "minute"
1184
msgid_plural "minutes"
1185
msgstr[0] ""
1186
msgstr[1] ""
1187
1188
- #: ../classes/column/post/estimated-reading-time.php:197
1189
msgid "Words per minute"
1190
msgstr ""
1191
1192
- #: ../classes/column/post/estimated-reading-time.php:199
1193
msgid "Estimated reading time in words per minute"
1194
msgstr ""
1195
1196
- #: ../classes/column/post/excerpt.php:69
1197
msgid "Excerpt from content"
1198
msgstr ""
1199
@@ -1209,7 +1133,7 @@ msgstr ""
1209
msgid "Last Modified Author"
1210
msgstr ""
1211
1212
- #: ../classes/column/post/modified.php:37
1213
msgid "Last modified"
1214
msgstr ""
1215
@@ -1233,11 +1157,11 @@ msgstr ""
1233
msgid "Permalink"
1234
msgstr ""
1235
1236
- #: ../classes/column/post/permalink.php:135
1237
msgid "Link to post"
1238
msgstr ""
1239
1240
- #: ../classes/column/post/permalink.php:135
1241
msgid "This will make the permalink clickable."
1242
msgstr ""
1243
@@ -1265,26 +1189,102 @@ msgstr ""
1265
msgid "Title without actions"
1266
msgstr ""
1267
1268
- #: ../classes/column/user/display-name.php:33
1269
- msgid "Display name"
1270
msgstr ""
1271
1272
- #: ../classes/column/user/first-name.php:35
1273
- msgid "First name"
1274
msgstr ""
1275
1276
- #: ../classes/column/user/last-name.php:35
1277
- msgid "Last name"
1278
msgstr ""
1279
1280
- #: ../classes/column/user/post-count.php:37
1281
- msgid "Post Count"
1282
msgstr ""
1283
1284
- #: ../classes/column/user/registered.php:37
1285
- msgid "Registered"
1286
msgstr ""
1287
1288
- #: ../classes/column/user/rich-editing.php:25
1289
- msgid "Visual Editor"
1290
msgstr ""
17
"X-Poedit-SearchPathExcluded-0: *.js\n"
18
"Plural-Forms: nplurals=2; plural=(n != 1);\n\n"
19
20
+ #: ../codepress-admin-columns.php:993
21
msgid "Edit columns"
22
msgstr ""
23
61
msgid "Enhance the products, orders and coupons overviews with new columns and inline editing."
62
msgstr ""
63
64
+ #: ../classes/column.php:355, ../classes/column.php:2567
65
msgid "Custom"
66
msgstr ""
67
68
+ #: ../classes/column.php:1453
69
msgid "Thumbnail"
70
msgstr ""
71
72
+ #: ../classes/column.php:1455
73
msgid "Medium"
74
msgstr ""
75
76
+ #: ../classes/column.php:1457
77
msgid "Large"
78
msgstr ""
79
80
+ #: ../classes/column.php:1459
81
msgid "Full"
82
msgstr ""
83
84
+ #: ../classes/column.php:2407
85
msgid "Date Format"
86
msgstr ""
87
88
+ #: ../classes/column.php:2409
89
msgid "This will determine how the date will be displayed."
90
msgstr ""
91
92
+ #: ../classes/column.php:2419
93
msgid "Example:"
94
msgstr ""
95
96
+ #: ../classes/column.php:2425
97
msgid "Leave empty for WordPress date format, change your <a href='%s'>default date format here</a>."
98
msgstr ""
99
100
+ #: ../classes/column.php:2427
101
msgid "Documentation on date and time formatting."
102
msgstr ""
103
104
+ #: ../classes/column.php:2455
105
msgid "Excerpt length"
106
msgstr ""
107
108
+ #: ../classes/column.php:2457
109
msgid "Number of words"
110
msgstr ""
111
112
+ #: ../classes/column.php:2491
113
msgid "Link label"
114
msgstr ""
115
116
+ #: ../classes/column.php:2493
117
msgid "Leave blank to display the url"
118
msgstr ""
119
120
+ #: ../classes/column.php:2529
121
msgid "Preview size"
122
msgstr ""
123
124
+ #: ../classes/column.php:2575, ../classes/column.php:2915
125
msgid "width"
126
msgstr ""
127
128
+ #: ../classes/column.php:2583
129
msgid "height"
130
msgstr ""
131
132
+ #: ../classes/column.php:2607
133
msgid "Before"
134
msgstr ""
135
136
+ #: ../classes/column.php:2607
137
msgid "This text will appear before the custom field value."
138
msgstr ""
139
140
+ #: ../classes/column.php:2609
141
msgid "After"
142
msgstr ""
143
144
+ #: ../classes/column.php:2609
145
msgid "This text will appear after the custom field value."
146
msgstr ""
147
148
+ #: ../classes/column.php:2627
149
msgid "Display Name"
150
msgstr ""
151
152
+ #: ../classes/column.php:2629
153
msgid "First Name"
154
msgstr ""
155
156
+ #: ../classes/column.php:2631
157
msgid "Last Name"
158
msgstr ""
159
160
+ #: ../classes/column.php:2633, ../classes/column/user/nickname.php:37
161
msgid "Nickname"
162
msgstr ""
163
164
+ #: ../classes/column.php:2635
165
msgid "User Login"
166
msgstr ""
167
168
+ #: ../classes/column.php:2637
169
msgid "User Email"
170
msgstr ""
171
172
+ #: ../classes/column.php:2639, ../classes/column/user/ID.php:35
173
msgid "User ID"
174
msgstr ""
175
176
+ #: ../classes/column.php:2641
177
msgid "First and Last Name"
178
msgstr ""
179
180
+ #: ../classes/column.php:2651
181
msgid "Display format"
182
msgstr ""
183
184
+ #: ../classes/column.php:2651
185
msgid "This is the format of the author name."
186
msgstr ""
187
188
+ #: ../classes/column.php:2959
189
msgid "Edit"
190
msgstr ""
191
192
+ #: ../classes/column.php:2963, ../classes/column.php:3169
193
msgid "Clone"
194
msgstr ""
195
196
+ #: ../classes/column.php:2967
197
msgid "Remove"
198
msgstr ""
199
200
+ #: ../classes/column.php:3003, ../classes/column.php:3003, ../classes/column/custom-field.php:382, ../classes/column/comment/type.php:27
201
msgid "Type"
202
msgstr ""
203
204
+ #: ../classes/column.php:3003
205
msgid "Choose a column type."
206
msgstr ""
207
208
+ #: ../classes/column.php:3003
209
msgid "Name"
210
msgstr ""
211
212
+ #: ../classes/column.php:3025
213
msgid "Label"
214
msgstr ""
215
216
+ #: ../classes/column.php:3025
217
msgid "This is the name which will appear as the column header."
218
msgstr ""
219
220
+ #: ../classes/column.php:3039, ../classes/column/media/width.php:25
221
msgid "Width"
222
msgstr ""
223
224
+ #: ../classes/column.php:3043
225
msgid "default"
226
msgstr ""
227
228
+ #: ../classes/column.php:3045
229
msgid "auto"
230
msgstr ""
231
232
+ #: ../classes/column.php:3213
233
msgid "Property To Display"
234
msgstr ""
235
236
+ #: ../classes/column.php:3225
237
msgid "Post property to display for related post(s)."
238
msgstr ""
239
240
+ #: ../classes/column.php:3249, ../classes/column/post/author-name.php:179
241
msgid "Link To"
242
msgstr ""
243
244
+ #: ../classes/column.php:3259
245
msgid "Edit Post Author"
246
msgstr ""
247
248
+ #: ../classes/column.php:3261
249
msgid "View Public Post Author Page"
250
msgstr ""
251
252
+ #: ../classes/column.php:3265
253
msgid "Page the posts should link to."
254
msgstr ""
255
256
+ #: ../classes/column.php:3285
257
msgid "The %s column is only available in Admin Columns Pro - Business or Developer."
258
msgstr ""
259
260
+ #: ../classes/column.php:3293
261
msgid "If you have a business or developer licence please download & install your %s add-on from the <a href='%s'>add-ons tab</a>."
262
msgstr ""
263
264
+ #: ../classes/column.php:3301
265
msgid "Admin Columns Pro offers full %s integration, allowing you to easily display and edit %s fields from within your overview."
266
msgstr ""
267
268
+ #: ../classes/column.php:3313
269
msgid "Find out more"
270
msgstr ""
271
393
msgid "By clicking on the triangle you will see the column options. By using the draggable slider you can set the width of the columns in percentages."
394
msgstr ""
395
396
+ #: ../classes/settings.php:765, ../classes/column/custom-field.php:24, ../classes/column/custom-field.php:26, ../classes/column/custom-field.php:363, ../classes/column/custom-field.php:367
397
msgid "Custom Field"
398
msgstr ""
399
405
msgid "The custom field colum uses the custom fields from posts and users. There are 10 types which you can set."
406
msgstr ""
407
408
+ #: ../classes/settings.php:773, ../classes/storage_model.php:1739, ../classes/column/custom-field.php:97, ../classes/column/default.php:22
409
msgid "Default"
410
msgstr ""
411
445
msgid "Value: Can be unix time stamp or a date format as described in the <a href='%s'>Codex</a>. You can change the outputted date format at the <a href='%s'>general settings</a> page."
446
msgstr ""
447
448
+ #: ../classes/settings.php:783, ../classes/column/post/excerpt.php:35
449
msgid "Excerpt"
450
msgstr ""
451
761
msgid "Get this add-on"
762
msgstr ""
763
764
+ #: ../classes/storage_model.php:407
765
msgid "Columns by Plugins"
766
msgstr ""
767
769
msgid "Other"
770
msgstr ""
771
772
+ #: ../classes/storage_model.php:1435
773
msgid "No columns settings available."
774
msgstr ""
775
776
+ #: ../classes/storage_model.php:1477
777
msgid "You are trying to store the same settings for %s."
778
msgstr ""
779
780
+ #: ../classes/storage_model.php:2149
781
msgid "View"
782
msgstr ""
783
873
msgid "Term Name (Term ID's)"
874
msgstr ""
875
876
+ #: ../classes/column/custom-field.php:343
877
msgid "Hidden Custom Fields"
878
msgstr ""
879
880
+ #: ../classes/column/custom-field.php:343
881
msgid "Custom Fields"
882
msgstr ""
883
884
+ #: ../classes/column/custom-field.php:363
885
msgid "Enter your custom field key."
886
msgstr ""
887
888
+ #: ../classes/column/custom-field.php:367
889
msgid "Select your custom field."
890
msgstr ""
891
892
+ #: ../classes/column/custom-field.php:374
893
msgid "No custom fields available."
894
msgstr ""
895
896
+ #: ../classes/column/custom-field.php:374
897
msgid "Please create a %s item first."
898
msgstr ""
899
900
+ #: ../classes/column/custom-field.php:382
901
msgid "Field Type"
902
msgstr ""
903
904
+ #: ../classes/column/custom-field.php:382
905
msgid "This will determine how the value will be displayed."
906
msgstr ""
907
908
+ #: ../classes/column/taxonomy.php:31, ../classes/column/taxonomy.php:157
909
msgid "Taxonomy"
910
msgstr ""
911
925
msgid "Post Type"
926
msgstr ""
927
928
+ #: ../classes/column/comment/ID.php:37, ../classes/column/link/ID.php:37, ../classes/column/post/ID.php:37, ../classes/column/media/ID.php:37
929
msgid "ID"
930
msgstr ""
931
965
msgid "Date GMT"
966
msgstr ""
967
968
+ #: ../classes/column/comment/excerpt.php:37, ../classes/column/post/content.php:35
969
msgid "Content"
970
msgstr ""
971
989
msgid "Word count"
990
msgstr ""
991
992
+ #: ../classes/column/link/description.php:37, ../classes/column/user/description.php:35, ../classes/column/media/description.php:39
993
msgid "Description"
994
msgstr ""
995
1013
msgid "Target"
1014
msgstr ""
1015
1016
+ #: ../classes/column/user/display-name.php:33
1017
+ msgid "Display name"
1018
msgstr ""
1019
1020
+ #: ../classes/column/user/first-name.php:35
1021
+ msgid "First name"
1022
msgstr ""
1023
1024
+ #: ../classes/column/user/last-name.php:35
1025
+ msgid "Last name"
1026
msgstr ""
1027
1028
+ #: ../classes/column/user/post-count.php:37
1029
+ msgid "Post Count"
1030
msgstr ""
1031
1032
+ #: ../classes/column/user/registered.php:37
1033
+ msgid "Registered"
1034
msgstr ""
1035
1036
+ #: ../classes/column/user/rich-editing.php:25
1037
+ msgid "Visual Editor"
1038
msgstr ""
1039
1040
#: ../classes/column/post/attachment-count.php:27
1097
msgid "Estimated Reading Time"
1098
msgstr ""
1099
1100
+ #: ../classes/column/post/estimated-reading-time.php:135
1101
msgid "second"
1102
msgid_plural "seconds"
1103
msgstr[0] ""
1104
msgstr[1] ""
1105
1106
+ #: ../classes/column/post/estimated-reading-time.php:141
1107
msgid "minute"
1108
msgid_plural "minutes"
1109
msgstr[0] ""
1110
msgstr[1] ""
1111
1112
+ #: ../classes/column/post/estimated-reading-time.php:205
1113
msgid "Words per minute"
1114
msgstr ""
1115
1116
+ #: ../classes/column/post/estimated-reading-time.php:207
1117
msgid "Estimated reading time in words per minute"
1118
msgstr ""
1119
1120
+ #: ../classes/column/post/excerpt.php:61
1121
msgid "Excerpt from content"
1122
msgstr ""
1123
1133
msgid "Last Modified Author"
1134
msgstr ""
1135
1136
+ #: ../classes/column/post/modified.php:25
1137
msgid "Last modified"
1138
msgstr ""
1139
1157
msgid "Permalink"
1158
msgstr ""
1159
1160
+ #: ../classes/column/post/permalink.php:133
1161
msgid "Link to post"
1162
msgstr ""
1163
1164
+ #: ../classes/column/post/permalink.php:133
1165
msgid "This will make the permalink clickable."
1166
msgstr ""
1167
1189
msgid "Title without actions"
1190
msgstr ""
1191
1192
+ #: ../classes/column/media/alternate-text.php:37
1193
+ msgid "Alt"
1194
msgstr ""
1195
1196
+ #: ../classes/column/media/attached-to.php:37
1197
+ msgid "Attached to post"
1198
msgstr ""
1199
1200
+ #: ../classes/column/media/available-sizes.php:27
1201
+ msgid "Available Sizes"
1202
msgstr ""
1203
1204
+ #: ../classes/column/media/available-sizes.php:61
1205
+ msgid "full size"
1206
msgstr ""
1207
1208
+ #: ../classes/column/media/caption.php:37, ../classes/column/media/exif-data.php:83
1209
+ msgid "Caption"
1210
msgstr ""
1211
1212
+ #: ../classes/column/media/dimensions.php:27
1213
+ msgid "Dimensions"
1214
+ msgstr ""
1215
+
1216
+ #: ../classes/column/media/exif-data.php:39
1217
+ msgid "EXIF data"
1218
+ msgstr ""
1219
+
1220
+ #: ../classes/column/media/exif-data.php:77
1221
+ msgid "Aperture"
1222
+ msgstr ""
1223
+
1224
+ #: ../classes/column/media/exif-data.php:79
1225
+ msgid "Credit"
1226
+ msgstr ""
1227
+
1228
+ #: ../classes/column/media/exif-data.php:81
1229
+ msgid "Camera"
1230
+ msgstr ""
1231
+
1232
+ #: ../classes/column/media/exif-data.php:85
1233
+ msgid "Timestamp"
1234
+ msgstr ""
1235
+
1236
+ #: ../classes/column/media/exif-data.php:87
1237
+ msgid "Copyright EXIF"
1238
+ msgstr ""
1239
+
1240
+ #: ../classes/column/media/exif-data.php:89
1241
+ msgid "Focal Length"
1242
+ msgstr ""
1243
+
1244
+ #: ../classes/column/media/exif-data.php:91
1245
+ msgid "ISO"
1246
+ msgstr ""
1247
+
1248
+ #: ../classes/column/media/exif-data.php:93
1249
+ msgid "Shutter Speed"
1250
+ msgstr ""
1251
+
1252
+ #: ../classes/column/media/exif-data.php:95
1253
+ msgid "Title"
1254
+ msgstr ""
1255
+
1256
+ #: ../classes/column/media/file-name.php:37
1257
+ msgid "File name"
1258
+ msgstr ""
1259
+
1260
+ #: ../classes/column/media/file-size.php:37
1261
+ msgid "File size"
1262
+ msgstr ""
1263
+
1264
+ #: ../classes/column/media/full-path.php:39, ../classes/column/media/full-path.php:187
1265
+ msgid "Full path"
1266
+ msgstr ""
1267
+
1268
+ #: ../classes/column/media/full-path.php:169
1269
+ msgid "Path scope"
1270
+ msgstr ""
1271
+
1272
+ #: ../classes/column/media/full-path.php:171
1273
+ msgid "Part of the file path to display"
1274
+ msgstr ""
1275
+
1276
+ #: ../classes/column/media/full-path.php:197
1277
+ msgid "Relative to domain"
1278
+ msgstr ""
1279
+
1280
+ #: ../classes/column/media/full-path.php:207
1281
+ msgid "Relative to main uploads folder "
1282
+ msgstr ""
1283
+
1284
+ #: ../classes/column/media/height.php:27
1285
+ msgid "Height"
1286
+ msgstr ""
1287
+
1288
+ #: ../classes/column/media/mime-type.php:37
1289
+ msgid "Mime type"
1290
msgstr ""
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: codepress, tschutter, davidmosterd, engelen, dungengronovius
3
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZDZRSYLQ4Z76J
4
Tags: plugins, wordpress, admin, column, columns, custom columns, custom fields, image, dashboard, sortable, filters, posts, media, users, pages, posttypes, manage columns, wp-admin
5
Requires at least: 3.5
6
- Tested up to: 4.4.2
7
- Stable tag: 2.5.5
8
9
Customise columns on the administration screens for post(types), pages, media, comments, links and users with an easy to use drag-and-drop interface.
10
@@ -210,6 +210,10 @@ You can find a list of the available actions and filters (and examples on how to
210
211
== Changelog ==
212
213
= 2.5.5 =
214
* [Improved] Columns with empty values will now display a dash symbol
215
* [Fixed] Excerpt column: The label "Excerpt from content" will now only display when the post has content
3
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZDZRSYLQ4Z76J
4
Tags: plugins, wordpress, admin, column, columns, custom columns, custom fields, image, dashboard, sortable, filters, posts, media, users, pages, posttypes, manage columns, wp-admin
5
Requires at least: 3.5
6
+ Tested up to: 4.5.1
7
+ Stable tag: 2.5.6
8
9
Customise columns on the administration screens for post(types), pages, media, comments, links and users with an easy to use drag-and-drop interface.
10
210
211
== Changelog ==
212
213
+ = 2.5.6 =
214
+ * [Fixed] Row actions are now only added to the first column when the primary column isn't available
215
+ * [Fixed] The true/false field option for the Custom Field column will display a cross icon when the value is empty or zero
216
+
217
= 2.5.5 =
218
* [Improved] Columns with empty values will now display a dash symbol
219
* [Fixed] Excerpt column: The label "Excerpt from content" will now only display when the post has content