mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-16 05:03:33 +09:00
Fix custom access settings and redirection
This commit is contained in:
+24
-6
@@ -11,9 +11,10 @@ class UM_Access {
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @do actions based on priority
|
||||
***/
|
||||
|
||||
/**
|
||||
* Set custom access actions and redirection
|
||||
*/
|
||||
function template_redirect() {
|
||||
global $post, $ultimatemember;
|
||||
|
||||
@@ -44,9 +45,12 @@ class UM_Access {
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @get meta
|
||||
***/
|
||||
|
||||
/**
|
||||
* Get custom access settings meta
|
||||
* @param integer $post_id
|
||||
* @return array
|
||||
*/
|
||||
function get_meta( $post_id ) {
|
||||
global $post;
|
||||
$meta = get_post_custom( $post_id );
|
||||
@@ -64,4 +68,18 @@ class UM_Access {
|
||||
return array('');
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a custom access referer in a redirect URL
|
||||
* @param string $url
|
||||
* @param string $referer
|
||||
*/
|
||||
function set_referer( $url, $referer ){
|
||||
|
||||
$enable_referer = apply_filters("um_access_enable_referer", false );
|
||||
if( ! $enable_referer ) return $url;
|
||||
|
||||
$url = add_query_arg('um_ref',$referer, $url);
|
||||
return $url;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user