From 8cb135c4194e82366a8cb8ab06a282c3d633d5e4 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Tue, 18 Sep 2018 16:28:19 -0400 Subject: [PATCH] registering widget in the addOn array in config. creating admin hook for that specific module to create the widget filter --- index.php | 4 +++- setup/adminHooks.php | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 8673187..7368919 100644 --- a/index.php +++ b/index.php @@ -166,7 +166,9 @@ function glmMembersRegisterPackaging($addOns) { 'dbScriptPath' => GLM_MEMBERS_PACKAGING_PLUGIN_DB_SCRIPTS, 'dbVersions' => $GLOBALS['glmMembersPackagingDbVersions'] ), - 'requiredPages' => $GLOBALS['glmMembersPackagingRequiredPages'] + 'requiredPages' => $GLOBALS['glmMembersPackagingRequiredPages'], + 'dashboardWidget' => GLM_MEMBERS_PACKAGING_PLUGIN_SLUG . "-dashboard-widget" + ); // Return the array with our data added diff --git a/setup/adminHooks.php b/setup/adminHooks.php index 608c98d..8766786 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -43,7 +43,15 @@ add_filter('glm-member-db-admin-management-hooksHelp', function($content) { 10, 2 ); - +add_filter( + GLM_MEMBERS_PACKAGING_PLUGIN_SLUG .'-dashboard-widget', + function ( $member = null ) { + $content = GLM_MEMBERS_PACKAGING_PLUGIN_SLUG; + return $content; + }, + 13, + 1 +); add_filter( 'glm-member-db-dashboard-member-widgets', function ( $member = null ) { -- 2.17.1