Skip to content

Instantly share code, notes, and snippets.

@braddalton
Last active November 29, 2017 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save braddalton/5e74d2c0063aa733f820b2ffa02000b3 to your computer and use it in GitHub Desktop.
Save braddalton/5e74d2c0063aa733f820b2ffa02000b3 to your computer and use it in GitHub Desktop.
Change Site Title URL If Current User Has Contributor Capability https://wp.me/p1lTu0-hdt
add_filter( 'genesis_seo_title', 'child_header_title', 10, 3 );
function child_header_title( $title, $inside, $wrap ) {
$about = home_url( 'about' );
$home = home_url();
$url = current_user_can('contributor') ? $about : $home;
$inside = sprintf( '<a href="%s" title="%s">%s</a>', esc_url( $url ), esc_attr( get_bloginfo( 'name' ) ), get_bloginfo( 'name' ) );
return sprintf( '<%1$s class="site-title">%2$s</%1$s>', $wrap, $inside );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment