public static function guest_object_id( $object_id = 0, $object_type = null ) {
		global $pagenow;

		if ( is_null( $object_type ) ) {
			$object_type = static::guest_object_type();
		}

		switch ( $object_type ) {
			case 'user':
				$object_id = isset( $_REQUEST['user_id'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['user_id'] ) ) : $object_id;

				if ( ! $object_id && 'user-new.php' !== $pagenow && isset( $GLOBALS['user_ID'] ) ) {
					$object_id = $GLOBALS['user_ID'];
				}
				break;

			case 'comment':
				$object_id = isset( $_REQUEST['c'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['c'] ) ) : $object_id;

				if ( ! $object_id && isset( $GLOBALS['comments']->comment_ID ) ) {
					$object_id = $GLOBALS['comments']->comment_ID;
				}
				break;

			case 'term':
				$object_id = isset( $_REQUEST['tag_ID'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['tag_ID'] ) ) : $object_id;
				break;

			default:
				$object_id = isset( $GLOBALS['post']->ID ) ? $GLOBALS['post']->ID : $object_id;

				if ( ! $object_id && isset( $_REQUEST['post'] ) ) {
					$object_id = sanitize_text_field( wp_unslash( $_REQUEST['post'] ) );
				}
				break;
		}

		return absint( $object_id );
	}
public static function guest_object_id( $object_id = 0, $object_type = null ) {
		global $pagenow;

		if ( is_null( $object_type ) ) {
			$object_type = static::guest_object_type();
		}

		switch ( $object_type ) {
			case 'user':
				$object_id = isset( $_REQUEST['user_id'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['user_id'] ) ) : $object_id;

				if ( ! $object_id && 'user-new.php' !== $pagenow && isset( $GLOBALS['user_ID'] ) ) {
					$object_id = $GLOBALS['user_ID'];
				}
				break;

			case 'comment':
				$object_id = isset( $_REQUEST['c'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['c'] ) ) : $object_id;

				if ( ! $object_id && isset( $GLOBALS['comments']->comment_ID ) ) {
					$object_id = $GLOBALS['comments']->comment_ID;
				}
				break;

			case 'term':
				$object_id = isset( $_REQUEST['tag_ID'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['tag_ID'] ) ) : $object_id;
				break;

			default:
				$object_id = isset( $GLOBALS['post']->ID ) ? $GLOBALS['post']->ID : $object_id;

				if ( ! $object_id && isset( $_REQUEST['post'] ) ) {
					$object_id = sanitize_text_field( wp_unslash( $_REQUEST['post'] ) );
				}
				break;
		}

		return absint( $object_id );
	}
public static function guest_object_id ( $ object_id = 0 , $ object_type = null ) { global $ pagenow ; if ( is_null ( $ object_type ) ) { $ object_type = static :: guest_object_type ( ) ; } switch ( $ object_type ) { case 'user' : $ object_id = isset ( $ _REQUEST [ 'user_id' ] ) ? sanitize_text_field ( wp_unslash ( $ _REQUEST [ 'user_id' ] ) ) : $ object_id ; if ( ! $ object_id && 'user-new.php' !== $ pagenow && isset ( $ GLOBALS [ 'user_ID' ] ) ) { $ object_id = $ GLOBALS [ 'user_ID' ] ; } break ; case 'comment' : $ object_id = isset ( $ _REQUEST [ 'c' ] ) ? sanitize_text_field ( wp_unslash ( $ _REQUEST [ 'c' ] ) ) : $ object_id ; if ( ! $ object_id && isset ( $ GLOBALS [ 'comments' ] -> comment_ID ) ) { $ object_id = $ GLOBALS [ 'comments' ] -> comment_ID ; } break ; case 'term' : $ object_id = isset ( $ _REQUEST [ 'tag_ID' ] ) ? sanitize_text_field ( wp_unslash ( $ _REQUEST [ 'tag_ID' ] ) ) : $ object_id ; break ; default : $ object_id = isset ( $ GLOBALS [ 'post' ] -> ID ) ? $ GLOBALS [ 'post' ] -> ID : $ object_id ; if ( ! $ object_id && isset ( $ _REQUEST [ 'post' ] ) ) { $ object_id = sanitize_text_field ( wp_unslash ( $ _REQUEST [ 'post' ] ) ) ; } break ; } return absint ( $ object_id ) ; }
Guest the object ID from global space.

@param  int    $object_id   Object ID.
@param  string $object_type Object type.
@return int
Guest the object ID from global space .