From 73e62f907e9aa703e80fd345730749e2f8800645 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Tue, 6 Mar 2018 12:44:08 -0500 Subject: [PATCH] Updated section that can add Management and Settings parameters when registering add-on --- SAMPLE_index.php | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/SAMPLE_index.php b/SAMPLE_index.php index 54c7d58..a6558a7 100644 --- a/SAMPLE_index.php +++ b/SAMPLE_index.php @@ -142,11 +142,24 @@ if (is_file({definedPrefix}_PLUGIN_DB_SCRIPTS.'/dbVersions.php')) { require_once {definedPrefix}_PLUGIN_DB_SCRIPTS.'/dbVersions.php'; } -// Load Add-On Management Settings data -/* None - Need to figure out a smooth way to do this. -${camelcasePrefix}ManagementSettings = $wpdb->get_row( "SELECT * FROM ".{definedPrefix}_PLUGIN_DB_PREFIX."management WHERE id = 1", ARRAY_A ); -unset(${camelcasePrefix}ManagementSettings['id']); -*/ +/* + * Load Add-On Management Settings data + * + * To have management and settings data from this add-on added to the main plugin config, + * uncomment the two sections and fix anything that's need to be corrected. + * + * Then add the data to the "config" array under "// Add this add-on to the add-ons array" below. + */ + +// Management +// ${camelcasePrefix}ManagementSettings = $wpdb->get_row( "SELECT * FROM ".{definedPrefix}_PLUGIN_DB_PREFIX."management WHERE id = 1", ARRAY_A ); +// unset(${camelcasePrefix}ManagementSettings['id']); + +// Settings +// ${camelcasePrefix}SettingsTerms = $wpdb->get_row( "SELECT * FROM ".{definedPrefix}_PLUGIN_DB_PREFIX."settings_terms WHERE id = 1", ARRAY_A ); +// unset(${camelcasePrefix}SettingsTerms['id']); + + function {camelcasePrefix}RegisterAddOn($addOns) { @@ -158,6 +171,8 @@ function {camelcasePrefix}RegisterAddOn($addOns) { 'slug' => {definedPrefix}_PLUGIN_SLUG, 'actions' => $GLOBALS['{camelcasePrefix}AddOnValidActions'], 'config' => array( +// 'settings' => $GLOBALS['{camelcasePrefix}ManagementSettings'], +// 'terms' => $GLOBALS['{camelcasePrefix}SettingsTerms'] ), 'shortcodes' => $GLOBALS['{camelcasePrefix}Shortcodes'], 'shortcodesDescription' => $GLOBALS['{camelcasePrefix}ShortcodesDescription'] -- 2.17.1