Member page creation & management, members only section
authorLaury GvR <laury@gaslightmedia.com>
Wed, 4 May 2016 13:34:17 +0000 (09:34 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Wed, 4 May 2016 13:34:17 +0000 (09:34 -0400)
defines.php
index.php
setup/requiredPages.php

index 7df9856..f1d4f7b 100644 (file)
@@ -10,6 +10,7 @@
 define('GLM_MEMBERS_PACKAGING_PLUGIN_NAME', 'Gaslight Media Members Database Packaging');
 define('GLM_MEMBERS_PACKAGING_PLUGIN_SHORT_NAME', 'Packaging');
 define('GLM_MEMBERS_PACKAGING_PLUGIN_SLUG', 'glm-member-db-packaging');
+define('GLM_MEMBERS_PACKAGING_PLUGIN_UNDERSCORED_NAME', 'glm_member_db_packaging');
 
 // Database table prefixes - change if using add-on tables
 global $wpdb;
@@ -43,6 +44,9 @@ define('GLM_MEMBERS_PACKAGING_PLUGIN_ADMIN_URL', admin_url('admin.php'));
 define('GLM_MEMBERS_PACKAGING_PLUGIN_BASE_URL', WP_PLUGIN_URL.'/'.GLM_MEMBERS_PACKAGING_PLUGIN_SLUG);
 define('GLM_MEMBERS_PACKAGING_PLUGIN_CURRENT_URL', $urlParts['scheme'].'://'.$urlParts['host'].$pageUri[0]);
 
+// WP Options
+define('GLM_MEMBERS_PLUGIN_OPTION_PACKAGING_LIST_ID', 'packaging_list_id');
 // Directories
 define('GLM_MEMBERS_PACKAGING_PLUGIN_PATH', dirname(__FILE__));
 define('GLM_MEMBERS_PACKAGING_PLUGIN_SETUP_PATH', GLM_MEMBERS_PACKAGING_PLUGIN_PATH.'/setup');
index 5d017f6..94be9ad 100644 (file)
--- a/index.php
+++ b/index.php
@@ -152,6 +152,7 @@ function glmMembersRegisterPackaging($addOns) {
             'name' =>  GLM_MEMBERS_PACKAGING_PLUGIN_NAME,
             'short_name' => GLM_MEMBERS_PACKAGING_PLUGIN_SHORT_NAME,
             'slug' => GLM_MEMBERS_PACKAGING_PLUGIN_SLUG,
+            'underscored_name' => GLM_MEMBERS_PACKAGING_PLUGIN_UNDERSCORED_NAME,
             'actions' => $GLOBALS['glmMembersPackagingAddOnValidActions'],
             'config' => array(
                 'settings' => $GLOBALS['packagingManagementSettings']
@@ -165,7 +166,7 @@ function glmMembersRegisterPackaging($addOns) {
                 'dbScriptPath' => GLM_MEMBERS_PACKAGING_PLUGIN_DB_SCRIPTS,
                 'dbVersions' => $GLOBALS['glmMembersPackagingDbVersions']
             ),
-            'requiredPages' => $GLOBALS['glmMembersPackagingRequiredPages']
+            //'requiredPages' => $GLOBALS['glmMembersPackagingRequiredPages']
     );
 
     // Return the array with our data added
index 6169d5d..36651a9 100644 (file)
  * Array of required pages
  *
  * This array lists all of the required pages made available to the main
- * member plugin
+ * member plugin, utilised by createPages() in admin.php
  *
  * This array is merged with the data from any registered add-ons
  * providing required pages. The plugin providing the required pages
  * is designated in the 'plugin' elemeent.
+ * 
+ * Leaving 'template' blank will result in index.php default. Any alternative
+ * can be entered, but particularly useful may be 'glm-members-only-template.php'
+ * (providing it exists in the theme!) 
+ * 
+ * Leaving 'parent' blank will set it to 0. A page ID can be used, as well as:
+ * - 'membersonly' : this will make the page a child of the Members Only locked 
+ *                   area
+ * - 'associate'   : this will make the page a child of the GLM Associate page 
+ *                   for management purposes
+ *
+ * When in doubt just use 'associate'
  *
  */
 
 $glmMembersPackagingRequiredPages = array(
     'Packages List' => array(
+        'name' => 'Packages List',
         'content' => '[glm-members-packaging-list]',
-        'parent' => 'GLM Associate'
+        'parent' => 'associate',
+        'optionSuffix' => 'packaging_list_id',
     ),
     'Package Detail' => array(
+        'name' => 'Package Detail',
         'content' => '[glm-members-packaging-detail]',
-        'parent' => 'GLM Associate'
+        'parent' => 'associate',
+        'optionSuffix' => 'packaging_detail_id',
     )
 );