Admin Columns - Version 2.2.8

Version Description

  • [Fixed] support for WPML columns
Download this release

Release Info

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

Code changes from version 2.2.7 to 2.2.8

Files changed (39) hide show
  1. assets/images/addon_sortable_1.png +0 -0
  2. assets/images/arrows.png +0 -0
  3. assets/images/checkbox.png +0 -0
  4. assets/images/checkmark.png +0 -0
  5. assets/images/checkmark_single.png +0 -0
  6. assets/images/comment_edit.png +0 -0
  7. assets/images/cross.png +0 -0
  8. assets/images/facebook.png +0 -0
  9. assets/images/icon.png +0 -0
  10. assets/images/import_export.png +0 -0
  11. assets/images/information.png +0 -0
  12. assets/images/loading.gif +0 -0
  13. assets/images/no.png +0 -0
  14. assets/images/settings.png +0 -0
  15. assets/images/sort.png +0 -0
  16. assets/images/square.png +0 -0
  17. assets/images/trash.png +0 -0
  18. assets/images/twitter.png +0 -0
  19. assets/js/upgrade.js +0 -0
  20. assets/ui-theme/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  21. assets/ui-theme/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  22. assets/ui-theme/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  23. assets/ui-theme/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  24. assets/ui-theme/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  25. assets/ui-theme/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  26. assets/ui-theme/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  27. assets/ui-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  28. assets/ui-theme/images/ui-icons_222222_256x240.png +0 -0
  29. assets/ui-theme/images/ui-icons_2e83ff_256x240.png +0 -0
  30. assets/ui-theme/images/ui-icons_454545_256x240.png +0 -0
  31. assets/ui-theme/images/ui-icons_888888_256x240.png +0 -0
  32. assets/ui-theme/images/ui-icons_cd0a0a_256x240.png +0 -0
  33. assets/ui-theme/jquery-ui-1.8.18.custom.css +0 -0
  34. classes/column.php +5 -2
  35. classes/settings.php +5 -2
  36. classes/storage_model.php +4 -1
  37. classes/third_party.php +17 -14
  38. codepress-admin-columns.php +3 -3
  39. readme.txt +4 -1
assets/images/addon_sortable_1.png CHANGED
File without changes
assets/images/arrows.png CHANGED
File without changes
assets/images/checkbox.png CHANGED
File without changes
assets/images/checkmark.png CHANGED
File without changes
assets/images/checkmark_single.png CHANGED
File without changes
assets/images/comment_edit.png CHANGED
File without changes
assets/images/cross.png CHANGED
File without changes
assets/images/facebook.png CHANGED
File without changes
assets/images/icon.png CHANGED
File without changes
assets/images/import_export.png CHANGED
File without changes
assets/images/information.png CHANGED
File without changes
assets/images/loading.gif CHANGED
File without changes
assets/images/no.png CHANGED
File without changes
assets/images/settings.png CHANGED
File without changes
assets/images/sort.png CHANGED
File without changes
assets/images/square.png CHANGED
File without changes
assets/images/trash.png CHANGED
File without changes
assets/images/twitter.png CHANGED
File without changes
assets/js/upgrade.js CHANGED
File without changes
assets/ui-theme/images/ui-bg_flat_0_aaaaaa_40x100.png CHANGED
File without changes
assets/ui-theme/images/ui-bg_flat_75_ffffff_40x100.png CHANGED
File without changes
assets/ui-theme/images/ui-bg_glass_55_fbf9ee_1x400.png CHANGED
File without changes
assets/ui-theme/images/ui-bg_glass_65_ffffff_1x400.png CHANGED
File without changes
assets/ui-theme/images/ui-bg_glass_75_dadada_1x400.png CHANGED
File without changes
assets/ui-theme/images/ui-bg_glass_75_e6e6e6_1x400.png CHANGED
File without changes
assets/ui-theme/images/ui-bg_glass_95_fef1ec_1x400.png CHANGED
File without changes
assets/ui-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png CHANGED
File without changes
assets/ui-theme/images/ui-icons_222222_256x240.png CHANGED
File without changes
assets/ui-theme/images/ui-icons_2e83ff_256x240.png CHANGED
File without changes
assets/ui-theme/images/ui-icons_454545_256x240.png CHANGED
File without changes
assets/ui-theme/images/ui-icons_888888_256x240.png CHANGED
File without changes
assets/ui-theme/images/ui-icons_cd0a0a_256x240.png CHANGED
File without changes
assets/ui-theme/jquery-ui-1.8.18.custom.css CHANGED
File without changes
classes/column.php CHANGED
@@ -310,7 +310,10 @@ class CPAC_Column {
310
 
311
  // Label can not contains the character ':', because
312
  // CPAC_Column::get_sanitized_label() will return an empty string
313
- $options['label'] = str_replace( ':', '', $options['label'] );
 
 
 
314
  }
315
 
316
  // used by child classes for additional sanitizing
@@ -998,7 +1001,7 @@ class CPAC_Column {
998
  asort( $_columns );
999
 
1000
  $list = "<optgroup label='{$label}'>";
1001
- foreach ( $_columns as $type => $label ){
1002
  $selected = selected( $this->properties->type, $type, false );
1003
  $list .= "<option value='{$type}'{$selected}>{$label}</option>";
1004
  }
310
 
311
  // Label can not contains the character ':', because
312
  // CPAC_Column::get_sanitized_label() will return an empty string
313
+ // and make an exception for site_url()
314
+ if ( false === strpos( $options['label'], site_url() ) ) {
315
+ $options['label'] = str_replace( ':', '', $options['label'] );
316
+ }
317
  }
318
 
319
  // used by child classes for additional sanitizing
1001
  asort( $_columns );
1002
 
1003
  $list = "<optgroup label='{$label}'>";
1004
+ foreach ( $_columns as $type => $label ) {
1005
  $selected = selected( $this->properties->type, $type, false );
1006
  $list .= "<option value='{$type}'{$selected}>{$label}</option>";
1007
  }
classes/settings.php CHANGED
@@ -210,8 +210,9 @@ class CPAC_Settings {
210
  public function handle_column_request() {
211
 
212
  // only handle updates from the admin columns page
213
- if ( ! ( isset($_GET['page'] ) && in_array( $_GET['page'], array( 'codepress-admin-columns' ) ) && isset( $_REQUEST['cpac_action'] ) ) )
214
  return false;
 
215
 
216
  // use $_REQUEST because the values are send both over $_GET and $_POST
217
  $action = isset( $_REQUEST['cpac_action'] ) ? $_REQUEST['cpac_action'] : '';
@@ -575,7 +576,9 @@ class CPAC_Settings {
575
  */
576
  public function display() {
577
 
578
- if ( $this->welcome_screen() ) return;
 
 
579
 
580
  $tabs = array(
581
  'general' => __( 'Admin Columns', 'cpac' ),
210
  public function handle_column_request() {
211
 
212
  // only handle updates from the admin columns page
213
+ if ( ! ( isset($_GET['page'] ) && in_array( $_GET['page'], array( 'codepress-admin-columns' ) ) && isset( $_REQUEST['cpac_action'] ) ) ) {
214
  return false;
215
+ }
216
 
217
  // use $_REQUEST because the values are send both over $_GET and $_POST
218
  $action = isset( $_REQUEST['cpac_action'] ) ? $_REQUEST['cpac_action'] : '';
576
  */
577
  public function display() {
578
 
579
+ if ( $this->welcome_screen() ) {
580
+ return;
581
+ }
582
 
583
  $tabs = array(
584
  'general' => __( 'Admin Columns', 'cpac' ),
classes/storage_model.php CHANGED
@@ -376,8 +376,9 @@ abstract class CPAC_Storage_Model {
376
  foreach ( $this->get_default_columns() as $column_name => $label ) {
377
 
378
  // checkboxes are mandatory
379
- if ( 'cb' == $column_name )
380
  continue;
 
381
 
382
  $column = $this->create_column_instance( $column_name, $label );
383
 
@@ -485,6 +486,8 @@ abstract class CPAC_Storage_Model {
485
  */
486
  public function set_columns() {
487
 
 
 
488
  $this->custom_columns = $this->get_custom_registered_columns();
489
  $this->default_columns = $this->get_default_registered_columns();
490
  $this->column_types = $this->get_grouped_column_types();
376
  foreach ( $this->get_default_columns() as $column_name => $label ) {
377
 
378
  // checkboxes are mandatory
379
+ if ( 'cb' == $column_name ) {
380
  continue;
381
+ }
382
 
383
  $column = $this->create_column_instance( $column_name, $label );
384
 
486
  */
487
  public function set_columns() {
488
 
489
+ do_action( 'cac/set_columns', $this );
490
+
491
  $this->custom_columns = $this->get_custom_registered_columns();
492
  $this->default_columns = $this->get_default_registered_columns();
493
  $this->column_types = $this->get_grouped_column_types();
classes/third_party.php CHANGED
@@ -35,30 +35,33 @@ add_action( 'plugins_loaded', 'cpac_pre_load_wordpress_seo_class_metabox', 0 );
35
  */
36
  function cac_add_wpml_columns( $storage_model ) {
37
 
38
- if( ! class_exists('SitePress') ) return;
 
 
39
 
40
- global $pagenow;
 
 
41
 
42
- // only for posts
43
- if ( 'options-general.php' !== $pagenow || 'post' !== $storage_model->type ) return;
44
 
45
- global $sitepress, $posts, $__management_columns_posts_translations;
 
 
 
46
 
47
- // prevent DB error
 
48
  $__management_columns_posts_translations = 'not_null';
49
-
50
- $post_type = $storage_model->key;
51
-
52
- // Is needed by SitePress::add_posts_management_column()
53
  $posts = get_posts( array(
54
- 'post_type' => $post_type,
55
  'numberposts' => -1
56
  ));
57
 
58
- // Trigger SitePress::add_posts_management_column() so admin coumkns can pick up it's added column heading
59
- add_filter( "manage_{$post_type}s_columns", array( $sitepress, 'add_posts_management_column' ) );
60
  }
61
- add_action( 'cac/get_columns', 'cac_add_wpml_columns' );
62
 
63
  /**
64
  * Fix which remove the Advanced Custom Fields Type (acf) from the admin columns settings page
35
  */
36
  function cac_add_wpml_columns( $storage_model ) {
37
 
38
+ if ( ! class_exists('SitePress') ) {
39
+ return;
40
+ }
41
 
42
+ if ( 'post' !== $storage_model->type ) {
43
+ return;
44
+ }
45
 
46
+ global $pagenow, $cpac;
 
47
 
48
+ // check if we are on the correct page or when a columns is being refreshed by ajax.
49
+ if ( ( 'options-general.php' !== $pagenow ) && ( empty( $_POST['action'] ) || 'cpac_column_refresh' !== $_POST['action'] ) ) {
50
+ return;
51
+ }
52
 
53
+ // prevent PHP errors from SitePress
54
+ global $sitepress, $posts, $__management_columns_posts_translations;
55
  $__management_columns_posts_translations = 'not_null';
 
 
 
 
56
  $posts = get_posts( array(
57
+ 'post_type' => $storage_model->post_type,
58
  'numberposts' => -1
59
  ));
60
 
61
+ // Trigger SitePress::add_posts_management_column()
62
+ add_filter( 'manage_' . $storage_model->post_type . 's_columns', array( $sitepress, 'add_posts_management_column' ) );
63
  }
64
+ add_action( 'cac/set_columns', 'cac_add_wpml_columns' );
65
 
66
  /**
67
  * Fix which remove the Advanced Custom Fields Type (acf) from the admin columns settings page
codepress-admin-columns.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Admin Columns
4
- Version: 2.2.7
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: http://www.admincolumns.com
@@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
30
 
31
  // Plugin information
32
- define( 'CPAC_VERSION', '2.2.7' ); // Current plugin version
33
  define( 'CPAC_UPGRADE_VERSION', '2.0.0' ); // Latest version which requires an upgrade
34
  define( 'CPAC_URL', plugin_dir_url( __FILE__ ) );
35
  define( 'CPAC_DIR', plugin_dir_path( __FILE__ ) );
@@ -531,4 +531,4 @@ global $cpac;
531
  *
532
  * @since 1.0
533
  */
534
- $cpac = new CPAC();
1
  <?php
2
  /*
3
  Plugin Name: Admin Columns
4
+ Version: 2.2.8
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: http://www.admincolumns.com
29
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
30
 
31
  // Plugin information
32
+ define( 'CPAC_VERSION', '2.2.8' ); // Current plugin version
33
  define( 'CPAC_UPGRADE_VERSION', '2.0.0' ); // Latest version which requires an upgrade
34
  define( 'CPAC_URL', plugin_dir_url( __FILE__ ) );
35
  define( 'CPAC_DIR', plugin_dir_path( __FILE__ ) );
531
  *
532
  * @since 1.0
533
  */
534
+ $cpac = new CPAC();
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.5
6
  Tested up to: 4.0
7
- Stable tag: 2.2.7
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
 
@@ -248,6 +248,9 @@ You can find a list of the available actions and filters (and examples on how to
248
 
249
  == Changelog ==
250
 
 
 
 
251
  = 2.2.7 =
252
  * [Added] Added date format option for "Last modified" column
253
  * [Updated] Change references from Codepress Admin Columns to Admin Columns
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.0
7
+ Stable tag: 2.2.8
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
 
248
 
249
  == Changelog ==
250
 
251
+ = 2.2.8 =
252
+ * [Fixed] support for WPML columns
253
+
254
  = 2.2.7 =
255
  * [Added] Added date format option for "Last modified" column
256
  * [Updated] Change references from Codepress Admin Columns to Admin Columns