wpmem_current_post_id()

Description

This function returns the post ID of the current page.

The function does not echo output.  Since it returns a string, this can be used for comparisons.

Parameters

This function does not accept any arguments.

Return Values

(int) The post ID of the current page.

Notes

This function is a wrapper for url_to_postid(), passing the returned value of wpmem_current_url() as the URL.

Changelog

Introduced in version 3.1.7

Source

wpmem_current_post_id() is located in /includes/api/api.php.