From: Chuck Scott Date: Tue, 6 Mar 2018 17:44:08 +0000 (-0500) Subject: Updated section that can add Management and Settings parameters when registering... X-Git-Tag: v1.0.2^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=73e62f907e9aa703e80fd345730749e2f8800645;p=WP-Plugins%2Fglm-member-db-sample.git Updated section that can add Management and Settings parameters when registering add-on --- 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']