Admin Columns - Version 2.5.6.2

Version Description

  • [Fixed] Hotfix cleanup.
Download this release

Release Info

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

Code changes from version 2.5.6.1 to 2.5.6.2

classes/settings.php CHANGED
@@ -698,6 +698,9 @@ class CPAC_Settings {
698
  }
699
  }
700
 
 
 
 
701
  return $storage_model;
702
  }
703
 
@@ -749,8 +752,6 @@ class CPAC_Settings {
749
  case 'general':
750
 
751
  $storage_model = $this->get_settings_storage_model();
752
- $storage_model->init_layout();
753
-
754
  $has_been_stored = $storage_model->get_stored_columns() ? true : false;
755
 
756
  // columns should not be editable when layout isn't
@@ -765,7 +766,7 @@ class CPAC_Settings {
765
  foreach ( cpac()->get_storage_models() as $_storage_model ) {
766
  $grouped[ $_storage_model->get_menu_type() ][] = (object) array(
767
  'key' => $_storage_model->key,
768
- 'link' => $_storage_model->get_edit_link(),
769
  'label' => $_storage_model->label
770
  );
771
  usort( $grouped[ $_storage_model->get_menu_type() ], array( $this, 'sort_by_label' ) );
698
  }
699
  }
700
 
701
+ // Init layout
702
+ $storage_model->init_settings_layout();
703
+
704
  return $storage_model;
705
  }
706
 
752
  case 'general':
753
 
754
  $storage_model = $this->get_settings_storage_model();
 
 
755
  $has_been_stored = $storage_model->get_stored_columns() ? true : false;
756
 
757
  // columns should not be editable when layout isn't
766
  foreach ( cpac()->get_storage_models() as $_storage_model ) {
767
  $grouped[ $_storage_model->get_menu_type() ][] = (object) array(
768
  'key' => $_storage_model->key,
769
+ 'link' => $_storage_model->settings_url(),
770
  'label' => $_storage_model->label
771
  );
772
  usort( $grouped[ $_storage_model->get_menu_type() ], array( $this, 'sort_by_label' ) );
classes/storage_model.php CHANGED
@@ -512,23 +512,52 @@ abstract class CPAC_Storage_Model {
512
  $this->flush_columns(); // forces $columns and $stored_columns to be repopulated
513
  }
514
 
515
- public function init_layout() {
516
 
517
- if ( $this->get_layout() ) {
518
- return;
519
- }
520
-
521
- // try user preference..
522
  $layout_id = $this->get_user_layout_preference();
523
 
524
  // ..when not found use the first one
525
- if ( ! $this->layout_exists( $layout_id ) ) {
526
  $layout_id = $this->get_single_layout_id();
527
  }
528
 
529
  $this->set_layout( $layout_id );
530
  }
531
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
532
  public function set_single_layout_id() {
533
  $this->set_layout( $this->get_single_layout_id() );
534
  }
512
  $this->flush_columns(); // forces $columns and $stored_columns to be repopulated
513
  }
514
 
515
+ public function init_settings_layout() {
516
 
517
+ // try admin preference..
 
 
 
 
518
  $layout_id = $this->get_user_layout_preference();
519
 
520
  // ..when not found use the first one
521
+ if ( false === $layout_id ) {
522
  $layout_id = $this->get_single_layout_id();
523
  }
524
 
525
  $this->set_layout( $layout_id );
526
  }
527
 
528
+ public function init_listings_layout() {
529
+ $layout_id = null;
530
+
531
+ // User layouts
532
+ if ( $layouts_current_user = $this->get_layouts_for_current_user() ) {
533
+ $layout_preference = $this->get_user_layout_preference();
534
+
535
+ $layout_found = false;
536
+
537
+ // try user preference..
538
+ foreach ( $layouts_current_user as $_layout ) {
539
+ if ( $_layout->id == $layout_preference ) {
540
+ $layout_id = $_layout->id;
541
+ $layout_found = true;
542
+ break;
543
+ }
544
+ }
545
+
546
+ // when no longer available use the first user layout
547
+ if ( ! $layout_found ) {
548
+ $_layouts_current_user = array_values( $layouts_current_user );
549
+ $layout_id = $_layouts_current_user[0]->id;
550
+ }
551
+ }
552
+
553
+ // User doesn't have eligible layouts.. but the current (null) layout does exists, then the WP default columns are loaded
554
+ else if ( $this->get_layout_by_id( $layout_id ) ) {
555
+ $layout_id = '_wp_default_'; // _wp_default_ does not exists therefor will load WP default
556
+ }
557
+
558
+ $this->set_layout( $layout_id );
559
+ }
560
+
561
  public function set_single_layout_id() {
562
  $this->set_layout( $this->get_single_layout_id() );
563
  }
codepress-admin-columns.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Admin Columns
4
- Version: 2.5.6.1
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.6.1' ); // 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__ ) );
@@ -315,7 +315,7 @@ class CPAC {
315
  }
316
 
317
  if ( $storage_model ) {
318
- $storage_model->init_layout();
319
  $storage_model->init_manage_columns();
320
  }
321
  }
1
  <?php
2
  /*
3
  Plugin Name: Admin Columns
4
+ Version: 2.5.6.2
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.2' ); // 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__ ) );
315
  }
316
 
317
  if ( $storage_model ) {
318
+ $storage_model->init_listings_layout();
319
  $storage_model->init_manage_columns();
320
  }
321
  }
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.5.1
7
- Stable tag: 2.5.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
 
@@ -210,8 +210,11 @@ You can find a list of the available actions and filters (and examples on how to
210
 
211
  == Changelog ==
212
 
 
 
 
213
  = 2.5.6.1 =
214
- * [Fixed] Column settings were no longer available
215
 
216
  = 2.5.6 =
217
  * [Fixed] Row actions are now only added to the first column when the primary column isn't available
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.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
 
210
 
211
  == Changelog ==
212
 
213
+ = 2.5.6.2 =
214
+ * [Fixed] Hotfix cleanup.
215
+
216
  = 2.5.6.1 =
217
+ * [Fixed] Hotfix. Version 2.5.6 did not display the stored column settings, which has been hotfixed.
218
 
219
  = 2.5.6 =
220
  * [Fixed] Row actions are now only added to the first column when the primary column isn't available