Cornerstone - Version 0.7.8

Version Description

  • Fix: Utilities: count() used on non-Countable value. (props @nikelaos)
Download this release

Release Info

Developer Archetyped
Plugin Icon wp plugin Cornerstone
Version 0.7.8
Comparing to
See all releases

Code changes from version 0.7.7 to 0.7.8

Files changed (4) hide show
  1. includes/class.utilities.php +18 -16
  2. main.php +1 -1
  3. package.json +1 -1
  4. readme.txt +5 -1
includes/class.utilities.php CHANGED
@@ -847,34 +847,36 @@ class CNR_Utilities {
847
  * @param mixed $default (optional) Default action if no action exists
848
  * @return string Current action
849
  */
850
- function get_action($default = null) {
851
  $action = '';
852
-
853
- //Check if action is set in URL
854
- if ( isset($_GET['action']) )
855
  $action = $_GET['action'];
856
- //Otherwise, Determine action based on plugin plugin admin page suffix
857
- elseif ( isset($_GET['page']) && ($pos = strrpos($_GET['page'], '-')) && $pos !== false && ( $pos != count($_GET['page']) - 1 ) )
858
- $action = trim(substr($_GET['page'], $pos + 1), '-_');
 
859
 
860
- //Determine action for core admin pages
861
- if ( ! isset($_GET['page']) || empty($action) ) {
862
  $actions = array(
863
- 'add' => array('page-new', 'post-new'),
864
- 'edit-item' => array('page', 'post'),
865
- 'edit' => array('edit', 'edit-pages')
866
  );
867
- $page = basename($_SERVER['SCRIPT_NAME'], '.php');
868
-
869
  foreach ( $actions as $act => $pages ) {
870
- if ( in_array($page, $pages) ) {
871
  $action = $act;
872
  break;
873
  }
874
  }
875
  }
876
- if ( empty($action) )
877
  $action = $default;
 
878
  return $action;
879
  }
880
 
847
  * @param mixed $default (optional) Default action if no action exists
848
  * @return string Current action
849
  */
850
+ function get_action( $default = null ) {
851
  $action = '';
852
+
853
+ // Check if action is set in URL
854
+ if ( isset( $_GET['action'] ) ) {
855
  $action = $_GET['action'];
856
+ } elseif ( isset( $_GET['page'] ) && ( $pos = strrpos( $_GET['page'], '-' ) ) && $pos !== false && ( $pos != strlen( $_GET['page'] ) - 1 ) ) {
857
+ // Otherwise, Determine action based on plugin admin page suffix
858
+ $action = trim( substr( $_GET['page'], $pos + 1 ), '-_' );
859
+ }
860
 
861
+ // Determine action for core admin pages
862
+ if ( ( ! isset( $_GET['page'] ) || empty( $action ) ) && isset( $_SERVER['SCRIPT_NAME'] ) ) {
863
  $actions = array(
864
+ 'add' => array( 'page-new', 'post-new' ),
865
+ 'edit-item' => array( 'page', 'post' ),
866
+ 'edit' => array( 'edit', 'edit-pages' ),
867
  );
868
+ $page = basename( $_SERVER['SCRIPT_NAME'], '.php' );
869
+
870
  foreach ( $actions as $act => $pages ) {
871
+ if ( in_array( $page, $pages ) ) {
872
  $action = $act;
873
  break;
874
  }
875
  }
876
  }
877
+ if ( empty( $action ) ) {
878
  $action = $default;
879
+ }
880
  return $action;
881
  }
882
 
main.php CHANGED
@@ -9,7 +9,7 @@
9
  * Plugin Name: Cornerstone
10
  * Plugin URI: http://archetyped.com/tools/cornerstone/
11
  * Description: Enhanced content management for WordPress
12
- * Version: 0.7.7
13
  * Requires at least: 5.3
14
  * Text Domain: cornerstone
15
  * Author: Archetyped
9
  * Plugin Name: Cornerstone
10
  * Plugin URI: http://archetyped.com/tools/cornerstone/
11
  * Description: Enhanced content management for WordPress
12
+ * Version: 0.7.8
13
  * Requires at least: 5.3
14
  * Text Domain: cornerstone
15
  * Author: Archetyped
package.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "cornerstone",
3
- "version": "0.7.7",
4
  "title": "Cornerstone",
5
  "description": "Enhanced content management for WordPress",
6
  "author": "Archetyped <support@archetyped.com>",
1
  {
2
  "name": "cornerstone",
3
+ "version": "0.7.8",
4
  "title": "Cornerstone",
5
  "description": "Enhanced content management for WordPress",
6
  "author": "Archetyped <support@archetyped.com>",
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate: https://gum.co/cnr-donate
4
  Tags: cornerstone, cms, content, management, system, structure, organization, sections
5
  Plugin Link: http://archetyped.com/tools/cornerstone/
6
  Requires at least: 5.3
7
- Tested up to: 5.3
8
  Stable tag: trunk
9
 
10
  Enhanced content management for WordPress
@@ -60,6 +60,10 @@ Post your questions/comments at [Cornerstone's official issue tracker](https://g
60
 
61
  == Changelog ==
62
 
 
 
 
 
63
  = 0.7.7 =
64
 
65
  * Fix: Spelling.
4
  Tags: cornerstone, cms, content, management, system, structure, organization, sections
5
  Plugin Link: http://archetyped.com/tools/cornerstone/
6
  Requires at least: 5.3
7
+ Tested up to: 5.4
8
  Stable tag: trunk
9
 
10
  Enhanced content management for WordPress
60
 
61
  == Changelog ==
62
 
63
+ = 0.7.8 =
64
+
65
+ * Fix: Utilities: `count()` used on non-Countable value. (props @nikelaos)
66
+
67
  = 0.7.7 =
68
 
69
  * Fix: Spelling.