Hi gaz36f,
I have added some changes in the code snippet.
Please check now.
add_filter( 'geodir_review_form_args', function( $fields ) {
if( ! function_exists("um_get_core_page") ) return $fields;
$fields['must_log_in'] = sprintf(
__( '<p class="must-log-in">
You must <a href="%s">Register</a> or
<a href="%s">Login</a> to post a comment.</p>'
),
um_get_core_page("register"),
um_get_core_page("login")."?redirect_to=". apply_filters( 'the_permalink', get_permalink() )
);
return $fields;
});
add_filter( 'login_url', 'gd_ultimate_member_login_link', 10, 3 );
/**
* gd_ultimate_member_login_link the login URL.
*
* @since 2.8.0
* @since 4.2.0 The <code>$force_reauth
parameter was added.
*
* @param string $login_url The login URL. Not HTML-encoded.
* @param string $redirect The path to redirect to on login, if supplied.
* @param bool $force_reauth Whether to force reauthorization, even if a cookie is present.
*
* @return string
*/
function gd_ultimate_member_login_link($login_url, $redirect, $force_reauth ){
if( ! function_exists("um_get_core_page") ) return $login_url;
$login_url = um_get_core_page("login")."?redirect_to=". apply_filters( 'the_permalink', get_permalink() );
if ( $force_reauth ) {
$login_url = add_query_arg( 'reauth', '1', $login_url );
}
return $login_url;
}
Thanks