mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-13 11:46:27 +09:00
- fixed PHP notices in some cases when WP query is not canonical;
This commit is contained in:
@@ -1843,12 +1843,16 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
* @param \WP_Post|int $post Post ID or object
|
||||
* @return bool|array
|
||||
*/
|
||||
function get_post_privacy_settings( $post ) {
|
||||
public function get_post_privacy_settings( $post ) {
|
||||
// break for incorrect post
|
||||
if ( empty( $post ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! is_numeric( $post ) && ! is_a( $post, \WP_Post::class ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static $cache = array();
|
||||
|
||||
$cache_key = is_numeric( $post ) ? $post : $post->ID;
|
||||
|
||||
Reference in New Issue
Block a user