Description
This function attempts to get the current posts ID. It can be used inside a bbPress forum loop in which case the function will attempt to get the forum / topic or replies ID. Must be used inside the loop.
Returns
(int | bool) Either the current post objects ID or FALSE
.
Parameters
Param | Type | Required | Description | |
---|---|---|---|---|
function mycred_sell_content_post_id( |
||||
No params | ||||
) { ... } |
Example
Example 1: Default usage.
$post_id = mycred_sell_content_post_id(); if ( $post_id !== false ) { }