is_noptin_campaign( int|WP_Post $post, bool|string $campaign_type = false )
Checks if a given post is a noptin campaign.
Parameters Parameters
- $post
(int|WP_Post) (Required) The post to check for.
- $campaign_type
(bool|string) (Optional) Specify if you need to check for a specific campaign type.
Default value: false
Return Return
(bool.)
Source Source
File: includes/functions.php
function is_noptin_campaign( $post, $campaign_type = false ) { $campaign = get_post( $post ); if ( empty( $campaign ) || 'noptin-campaign' !== $campaign->post_type ) { return false; } if ( empty( $campaign_type ) ) { return true; } return trim( $campaign_type ) === get_post_meta( $campaign->ID, 'campaign_type', true ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.2.0 | Introduced. |