Admin Columns - Version 1.4.6.2

Version Description

  • bug fix with a static function which could cause an error in some cases
  • added filter to enable taxonomy filtering. add this to your functions.php to enable taxonomy filtering: add_filter( 'cpac-remove-filtering-columns', '__return_false' )
Download this release

Release Info

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

Code changes from version 1.4.6.1 to 1.4.6.2

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 );
@@ -190,15 +190,15 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
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
 
@@ -712,9 +712,10 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
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'] ) )
@@ -1114,7 +1115,7 @@ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
1114
  */
1115
  function register_filtering_columns()
1116
  {
1117
- if ( ! $this->unlocked )
1118
  return false;
1119
 
1120
  // hook into wordpress
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 );
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
 
712
  {
713
  $post_type = $vars['post_type'];
714
 
715
+ // todo: fix default sorting
716
  // apply default sorting when it has been set
717
  if ( empty( $vars['orderby'] ) ) {
718
+ $vars = $this->get_default_sorting_vars( $post_type, $vars );
719
 
720
  // when sorting still isn't set we will just return the requested vars
721
  if ( empty( $vars['orderby'] ) )
1115
  */
1116
  function register_filtering_columns()
1117
  {
1118
+ if ( ! $this->unlocked || apply_filters( 'cpac-remove-filtering-columns', true ) )
1119
  return false;
1120
 
1121
  // hook into wordpress
classes/{wordpress_seo_fix.php → utility.php} RENAMED
File without changes
codepress-admin-columns.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Codepress Admin Columns
4
- Version: 1.4.6.1
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
@@ -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.6.1' );
30
  define( 'CPAC_TEXTDOMAIN', 'codepress-admin-columns' );
31
  define( 'CPAC_SLUG', 'codepress-admin-columns' );
32
  define( 'CPAC_URL', plugins_url('', __FILE__) );
@@ -40,6 +40,7 @@ if ( !is_admin() )
40
  *
41
  * @since 1.3
42
  */
 
43
  require_once dirname( __FILE__ ) . '/classes/sortable.php';
44
  require_once dirname( __FILE__ ) . '/classes/values.php';
45
  require_once dirname( __FILE__ ) . '/classes/values/posts.php';
@@ -47,7 +48,6 @@ require_once dirname( __FILE__ ) . '/classes/values/users.php';
47
  require_once dirname( __FILE__ ) . '/classes/values/media.php';
48
  require_once dirname( __FILE__ ) . '/classes/values/link.php';
49
  require_once dirname( __FILE__ ) . '/classes/values/comments.php';
50
- require_once dirname( __FILE__ ) . '/classes/wordpress_seo_fix.php';
51
 
52
  /**
53
  * Codepress Admin Columns Class
@@ -2375,7 +2375,7 @@ class Codepress_Admin_Columns
2375
  *
2376
  * @since 1.3.1
2377
  */
2378
- public function get_post_count( $post_type, $user_id )
2379
  {
2380
  if ( ! post_type_exists($post_type) || ! get_userdata($user_id) )
2381
  return false;
1
  <?php
2
  /*
3
  Plugin Name: Codepress Admin Columns
4
+ Version: 1.4.6.2
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
26
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
  */
28
 
29
+ define( 'CPAC_VERSION', '1.4.6.2' );
30
  define( 'CPAC_TEXTDOMAIN', 'codepress-admin-columns' );
31
  define( 'CPAC_SLUG', 'codepress-admin-columns' );
32
  define( 'CPAC_URL', plugins_url('', __FILE__) );
40
  *
41
  * @since 1.3
42
  */
43
+ require_once dirname( __FILE__ ) . '/classes/utility.php';
44
  require_once dirname( __FILE__ ) . '/classes/sortable.php';
45
  require_once dirname( __FILE__ ) . '/classes/values.php';
46
  require_once dirname( __FILE__ ) . '/classes/values/posts.php';
48
  require_once dirname( __FILE__ ) . '/classes/values/media.php';
49
  require_once dirname( __FILE__ ) . '/classes/values/link.php';
50
  require_once dirname( __FILE__ ) . '/classes/values/comments.php';
 
51
 
52
  /**
53
  * Codepress Admin Columns Class
2375
  *
2376
  * @since 1.3.1
2377
  */
2378
+ public static function get_post_count( $post_type, $user_id )
2379
  {
2380
  if ( ! post_type_exists($post_type) || ! get_userdata($user_id) )
2381
  return false;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
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.1
6
  Tested up to: 3.4
7
- Stable tag: 1.4.6.1
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
 
@@ -170,7 +170,7 @@ add_filter('cpac_thumbnail_size', function() {
170
  = How can I enable the use of Hidden Custom Fields? =
171
 
172
  I am currently working on settings page where you can enable this feature. In the meanwhile you can enable this by adding
173
- this piece of code to your theme's functions.php to:
174
 
175
  `
176
  <?php
@@ -180,6 +180,18 @@ add_filter('cpac_use_hidden_custom_fields', '__return_true'); // enables the use
180
 
181
  Now you can select your HIDDEN custom fields in de dropdown menu under "Custom Field:".
182
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  == Screenshots ==
184
 
185
  1. Settings page for Post(type) columns.
@@ -192,6 +204,11 @@ Now you can select your HIDDEN custom fields in de dropdown menu under "Custom F
192
 
193
  == Changelog ==
194
 
 
 
 
 
 
195
  = 1.4.6.1 =
196
 
197
  * bug fix for possible warning when using Custompress ( props to scottsalisbury for the fix! )
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.1
6
  Tested up to: 3.4
7
+ Stable tag: 1.4.6.2
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
 
170
  = How can I enable the use of Hidden Custom Fields? =
171
 
172
  I am currently working on settings page where you can enable this feature. In the meanwhile you can enable this by adding
173
+ this piece of code to your theme's functions.php:
174
 
175
  `
176
  <?php
180
 
181
  Now you can select your HIDDEN custom fields in de dropdown menu under "Custom Field:".
182
 
183
+ = How can I add the dropdown menu for taxonomy filtering? =
184
+
185
+ This will also be included in the upcoming settings page, in the meanwhile you can enable this by adding
186
+ this piece of code to your theme's functions.php:
187
+
188
+ `
189
+ <?php
190
+ add_filter( 'cpac-remove-filtering-columns', '__return_false' ); // add dropdown taxonomy filtering to the overview pages
191
+ ?>
192
+ `
193
+
194
+
195
  == Screenshots ==
196
 
197
  1. Settings page for Post(type) columns.
204
 
205
  == Changelog ==
206
 
207
+ = 1.4.6.2 =
208
+
209
+ * bug fix with a static function which could cause an error in some cases
210
+ * added filter to enable taxonomy filtering. add this to your functions.php to enable taxonomy filtering: `add_filter( 'cpac-remove-filtering-columns', '__return_false' )`
211
+
212
  = 1.4.6.1 =
213
 
214
  * bug fix for possible warning when using Custompress ( props to scottsalisbury for the fix! )