From 587808cc6bfa3a11bb5624dbaef9a6e1ffd284d3 Mon Sep 17 00:00:00 2001 From: Joel Date: Mon, 18 Aug 2014 14:17:47 -0400 Subject: [PATCH] Bug fix * Multiple content sections not working. --- README.md | 3 +++ client-dash.php | 4 ++-- core/functions.php | 31 +++++++++++++------------------ readme.txt | 5 ++++- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index a3a21fd7..1fc56f5c 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,9 @@ Using this plugin is very simple. All you have to do is: ## Changelog +### [1.5.3](https://github.com/brashrebel/client-dash/releases/tag/v1.5.3) +* Multiple content sections not working. + ### [1.5.2](https://github.com/brashrebel/client-dash/releases/tag/v1.5.2) * Postboxes being half width was targeting all pages, when it should have only been targeting the dashboard. diff --git a/client-dash.php b/client-dash.php index 4d8c1b70..c00ee07f 100644 --- a/client-dash.php +++ b/client-dash.php @@ -3,7 +3,7 @@ /* Plugin Name: Client Dash Description: Creating a more intuitive admin interface for clients. -Version: 1.5.2 +Version: 1.5.3 Author: Kyle Maurer Author URI: http://realbigmarketing.com/staff/kyle */ @@ -29,7 +29,7 @@ class ClientDash extends ClientDash_Functions { * * @since Client Dash 1.5 */ - public $version = '1.5'; + public $version = '1.5.3'; /** * A list of all tab files to include. diff --git a/core/functions.php b/core/functions.php index ccfe0326..4c2a8385 100644 --- a/core/functions.php +++ b/core/functions.php @@ -173,27 +173,22 @@ public function add_content_section( $content_section ) { // Fix up the page name (to allow spaces and such) $page = $this->translate_name_to_id( $content_section['page'] ); - $ClientDash->content_sections[ $page ][ $tab_ID ] = array( - 'name' => $content_section['tab'], - 'content-sections' => array( - $ID => array( - 'name' => $content_section['name'], - 'callback' => $content_section['callback'], - 'priority' => $content_section['priority'] - ) - ) + // Add to the array + $ClientDash->content_sections[ $page ][ $tab_ID ]['name'] = $content_section['tab']; + + $ClientDash->content_sections[ $page ][ $tab_ID ]['content-sections'][ $ID ] = array( + 'name' => $content_section['name'], + 'callback' => $content_section['callback'], + 'priority' => $content_section['priority'] ); // Also add for the unmodified version - $ClientDash->content_sections_unmodified[ $page ][ $tab_ID ] = array( - 'name' => $content_section['tab'], - 'content-sections' => array( - $ID => array( - 'name' => $content_section['name'], - 'callback' => $content_section['callback'], - 'priority' => $content_section['priority'] - ) - ) + $ClientDash->content_sections_unmodified[ $page ][ $tab_ID ]['name'] = $content_section['tab']; + + $ClientDash->content_sections_unmodified[ $page ][ $tab_ID ]['content-sections'][ $ID ] = array( + 'name' => $content_section['name'], + 'callback' => $content_section['callback'], + 'priority' => $content_section['priority'] ); } diff --git a/readme.txt b/readme.txt index ef7da96c..e98a6d8d 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Contributors: BrashRebel, joelworsham Tags: client, portal, dashboard, admin, users, webmaster Requires at least: 3.8.0 Tested up to: 3.9.2 -Stable tag: 1.5.2 +Stable tag: 1.5.3 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -47,6 +47,9 @@ Using this plugin is very simple. All you have to do is: == Changelog == += 1.5.3 = +* Multiple content sections not working. + = 1.5.2 = * Postboxes being half width was targeting all pages, when it should have only been targeting the dashboard.