bh_select_post_id( $p = null )


Description


Source

File: functions/common/resources.php

	function bh_select_post_id( $p = null ) {
		if ( is_null( $p ) ) {
			global $post;
			$p = $post;
		}

		if ( is_string( $p ) ) {
			$p = get_page_by_path( $p );
		}

		if ( is_array( $p ) ) {
			$p = (object) $p;
		}

		if ( is_object( $p ) ) {
			if ( 'nav_menu_item' === $p->post_type ) {
				$p = $p->object_id;
			} else {
				$p = $p->ID;
			}
		}

		return (int) $p;
	}

More Information

You are currently logged out. To view tickets you must first login.

I have read and understood the Terms of Service


User Contributed Notes

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.