From: Chuck Scott Date: Tue, 23 May 2017 19:21:38 +0000 (-0400) Subject: Added function calls to clear shortcode cashe when packages are added, updated, or... X-Git-Tag: v1.2.10^2~1 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=6e9895d8c53f8b1e41d9735a0edd33b6448e3e7a;p=WP-Plugins%2Fglm-member-db-packaging.git Added function calls to clear shortcode cashe when packages are added, updated, or deleted. --- diff --git a/models/admin/member/packaging.php b/models/admin/member/packaging.php index ab889ae..8638cd9 100644 --- a/models/admin/member/packaging.php +++ b/models/admin/member/packaging.php @@ -193,6 +193,8 @@ class GlmMembersAdmin_member_packaging extends GlmDataPackages // Tell the template we're going to be editing. $option = 'edit'; + glmClearShortcodeCache(); + // Otherwise, the package didn't successfully submit } else { @@ -216,6 +218,7 @@ class GlmMembersAdmin_member_packaging extends GlmDataPackages break; case 'update': + // Get the original Package Status. Before the update. $old_package_status = $this->wpdb->get_var( $this->wpdb->prepare( @@ -249,6 +252,8 @@ class GlmMembersAdmin_member_packaging extends GlmDataPackages // Tell the template the package was updated $packageUpdated = true; + glmClearShortcodeCache(); + // Otherwise it didn't update, tell the template and let them try again } else { $packageError = true; @@ -272,6 +277,8 @@ class GlmMembersAdmin_member_packaging extends GlmDataPackages if ($packageID > 0) { $this->deleteEntry($packageID, true); $packageDeleted = true; + + glmClearShortcodeCache(); } // Look for matching package elements diff --git a/models/admin/packaging/index.php b/models/admin/packaging/index.php index 8cb4806..1bc8786 100644 --- a/models/admin/packaging/index.php +++ b/models/admin/packaging/index.php @@ -180,6 +180,8 @@ class GlmMembersAdmin_packaging_index extends GlmDataPackages // Tell the template we're going to be editing. $option = 'edit'; + glmClearShortcodeCache(); + // Otherwise, the package didn't successfully submit } else { @@ -225,9 +227,12 @@ class GlmMembersAdmin_packaging_index extends GlmDataPackages // Tell the template the package was updated $packageUpdated = true; + // Get the package prepared for editing $packageInfo = $this->editEntry($packageID); + glmClearShortcodeCache(); + // Otherwise it didn't update, tell the template and let them try again } else { $packageError = true; @@ -251,6 +256,8 @@ class GlmMembersAdmin_packaging_index extends GlmDataPackages if ($packageID > 0) { $this->deleteEntry($packageID, true); $packageDeleted = true; + + glmClearShortcodeCache(); } // Look for matching package elements