global $wpdb;
$GLOBALS['glmPackageName'] = $wpdb->get_var( "SELECT title FROM ".GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX . "packages WHERE package_slug = '".$GLOBALS['glmDetailSlug']."'" );
- // Set the page title to the event name
- add_filter('wp_title', function() {
+ // Set the page title to the event name - Using low priority so it's the last to set the title!
+ add_filter('wp_title', function($title) {
return $GLOBALS['glmPackageName'];
- });
+ }, 99, 1);
}
// Add package slug query var