// Get the member name for use in the page title
global $wpdb;
- $GLOBALS['glmMembName'] = $wpdb->get_var( "SELECT name FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX . "members WHERE member_slug = '".$GLOBALS['glmDetailSlug']."'" );
+ $memberData = $wpdb->get_row(
+ "SELECT T.name,I.short_descr
+ FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX . "members T,
+ ".GLM_MEMBERS_PLUGIN_DB_PREFIX."member_info I
+ WHERE T.member_slug = '".$GLOBALS['glmDetailSlug']."'
+ AND T.id = I.member",
+ ARRAY_A
+ );
+ $GLOBALS['glmMembName'] = $memberData['name'];
+ $GLOBALS['glmMembIntro'] = $memberData['short_descr'];
// Set the page title to the member name - Using low priority so it's the last to set the title!
add_filter('wp_title', function($title) {
return $GLOBALS['glmMembName'];
}, 99, 1);
+ add_filter( 'wpseo_opengraph_title', function($tag){
+ return $GLOBALS['glmMembName'];
+ }, 99, 1 );
+ add_filter( 'wpseo_opengraph_desc', function($tag){
+ return $GLOBALS['glmMembIntro'];
+ }, 99, 1 );
+ add_filter( 'wpseo_twitter_title', function($tag){
+ return $GLOBALS['glmMembName'];
+ }, 99, 1 );
+ add_filter( 'wpseo_twitter_description', function($tag){
+ return $GLOBALS['glmMembIntro'];
+ }, 99, 1 );
}
// Squash Bread Crumbs if using Breadcrumb NavXT plugin -- NEED TO CREATE A MANAGEMENT OPTION FOR THIS TO TURN IT ON/OFF