Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Last active August 24, 2017 16: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 joshfeck/1a574f951fea3941ef8bcd3681abbb5c to your computer and use it in GitHub Desktop.
Save joshfeck/1a574f951fea3941ef8bcd3681abbb5c to your computer and use it in GitHub Desktop.
WP User Integration required ticket capability message: Add a custom message that includes a link to log into the website.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__EED_WP_Users_Ticket_Selector__maybe_restrict_ticket_option_by_cap__no_access_msg',
'my_custom_no_access_message',
10,
4
);
function my_custom_no_access_message( $content, $tkt, $ticket_price, $tkt_status ) {
$url = wp_login_url( get_permalink() );
$content = $tkt->name() . ' becomes available if you log in to your account. ';
$content .= 'You can <a href="'. $url .'" title="Log in">log in here</a>.';
return $content;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment