mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- removed deprecated "UM_TEXTDOMAIN" constant;
- removed deprecated function UM()->get_ajax_route();
This commit is contained in:
@@ -54,43 +54,6 @@ if ( ! class_exists( 'UM_Functions' ) ) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get ajax routed URL
|
||||
*
|
||||
* @param string $route
|
||||
* @param string $method
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_ajax_route( $route, $method ) {
|
||||
|
||||
$route = str_replace( array( '\\', '/' ), '!', $route );
|
||||
$ip = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : '';
|
||||
$nonce = wp_create_nonce( $ip . get_current_user_id() . $route . $method );
|
||||
|
||||
if ( is_admin() ) {
|
||||
$url = add_query_arg( array(
|
||||
'action' => 'um_router',
|
||||
'um_action' => 'route',
|
||||
'um_resource' => $route,
|
||||
'um_method' => $method,
|
||||
'um_verify' => $nonce
|
||||
), get_admin_url( null, 'admin-ajax.php' ) );
|
||||
} else if ( get_option( 'permalink_structure' ) ) {
|
||||
$url = get_home_url( null, 'um-api/route/' . $route . '/' . $method . '/' . $nonce );
|
||||
} else {
|
||||
$url = add_query_arg( array(
|
||||
'um_page' => 'api',
|
||||
'um_action' => 'route',
|
||||
'um_resource' => $route,
|
||||
'um_method' => $method,
|
||||
'um_verify' => $nonce
|
||||
), get_home_url() );
|
||||
}
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Help Tip displaying
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user