buycred_get_pending_payment_id

Description

This function attempts to get the WordPress post object ID for a given buyCRED pending payment ID.

This function is only available if the buyCRED add-on is enabled.

Available since version 1.7

Returns

(bool | int) Returns either the WordPress post object ID or FALSE on failure.

Parameters

Param Type Required Description
function buycred_get_pending_payment_id(
$payment_id string Yes

The buyCRED pending payment ID.

) { ... }

Examples

Example 1: Check if a given ID is a pending payment or not.

$payment_id = sanitize_text_field( $_GET['id'] );
$payment_id = buycred_get_pending_payment_id( $payment_id );

if ( $payment_id !== false ) {
	// This is a pending payment
}