From 6427f535c05fd77fcf35e22dfdb633ce07012745 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Fri, 15 Dec 2017 11:48:23 -0500 Subject: [PATCH] Fixed hook name conflicts between customfields and old fields plugins. --- setup/adminHooks.php | 7 +------ setup/commonHooks.php | 6 +++--- setup/hooksHelp.html | 4 ++-- setup/shortcodes.php | 2 +- views/admin/customFields/index.html | 16 ++++++++-------- 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/setup/adminHooks.php b/setup/adminHooks.php index e4ba99d..8b07856 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -51,13 +51,8 @@ add_filter('glm-member-db-admin-management-hooksHelp', function($content) { * {use} can be a description of the use or where it used (i.e. "reg-event-edit") * {id} should be an ID of the record these fields are associated with, for example a registration event ID */ -add_filter( 'glm-members-customfields-edit', function( $content, $fid ){ +add_filter( 'glm-members-customfields-form-edit', function( $content, $fid ){ unset( $_REQUEST['glm_action'] ); $content .= $this->controller( 'customFields', 'index', array( 'fid' => $fid ), true ); return $content; }, 10, 2 ); - - - - - diff --git a/setup/commonHooks.php b/setup/commonHooks.php index 593c1d8..8924960 100644 --- a/setup/commonHooks.php +++ b/setup/commonHooks.php @@ -60,9 +60,9 @@ * FID to reference other data. * * These are the hooks provided in this file. Also look at the adminHooks.php file for the - * glm-members-customfields-edit hook used to create and edit groups of custom form fields. + * glm-members-customfields-form-edit hook used to create and edit groups of custom form fields. * - * glm-members-customfields-active Is the add-on installed and active + * glm-members-customfields-plugin-active Is the add-on installed and active * glm-members-customfields-have-fields Does a particular FID exist (has fields) * glm-members-customfields-form-display Display a particular form by FID * glm-members-customfields-form-submit Submit data for a particular FID and optionally store it @@ -75,7 +75,7 @@ /** * Filter will return true if the plugin is active. */ -add_filter( 'glm-members-customfields-active', function( $active ){ +add_filter( 'glm-members-customfields-plugin-active', function( $active ){ return true; }, 10, 1 ); diff --git a/setup/hooksHelp.html b/setup/hooksHelp.html index 332f20e..03308dd 100644 --- a/setup/hooksHelp.html +++ b/setup/hooksHelp.html @@ -18,7 +18,7 @@

Custom Fields Add-On

Menu/Tab Hooks - glm-members-customfields-active + glm-members-customfields-plugin-active FILTER @@ -42,7 +42,7 @@ Fields Add/Delete/Edit - glm-members-customfields-edit + glm-members-customfields-form-edit FILTER $content, $fid diff --git a/setup/shortcodes.php b/setup/shortcodes.php index 5510a26..c2581b6 100644 --- a/setup/shortcodes.php +++ b/setup/shortcodes.php @@ -126,7 +126,7 @@ $glmMembersCustomFieldsShortcodesDescription = ' fid="{Form ID String}" The "fid" attribute is the Form ID string that is unique to the - custom form created using admin "glm-members-customfields-edit" filter. + custom form created using admin "glm-members-customfields-form-edit" filter.

The standard for this for ID is "{add-on-slug}-customfields-{descr-slug}-{optional-id}.
where:
diff --git a/views/admin/customFields/index.html b/views/admin/customFields/index.html index 79f2118..cf5d703 100644 --- a/views/admin/customFields/index.html +++ b/views/admin/customFields/index.html @@ -77,10 +77,10 @@ {* Fields Table *} - - - - + + + @@ -89,14 +89,14 @@ {if $haveCustomFields} {foreach $custom_fields as $t} - - + - -
Field NameTypeRequired + Field NameTypeRequired
Add a Custom Field
 
{$t.field_name} + {$t.field_name} {$t.field_type_descr} + {$t.required.name} +
Delete
-- 2.17.1