Conditional Functions

Below is a list of available plugin conditonals.

is_nmgr()

Returns true if we are viewing a page that uses NM Gift Registry templates or shortcodes.

is_nmgr_account()

Returns true if we are on the WooCommerce account page endpoint for NM Gift Registry or if the constant NMGR_ACCOUNT is set to true in a template file.

is_nmgr_account_section()

Returns true if we are on an NM Gift Registry account section. Account sections are determined by the post content having any of the account shortcodes or by the constant NMGR_ACCOUNT_SECTION being set to true in the template file. Registered account sections are: overview, profile, items, shipping, images (full version), messages (full version) and settings (full version).

is_nmgr_account_tab()

Returns true if we are in an NM Gift Registry account tab. Registered account tabs are: overview, profile, items, shipping, images (full version), messages (full version) and settings (full version). These are tabs that display the registered account sections for the plugin.

is_nmgr_admin()

Returns true if we are on an NM Gift Registry page in the WordPress backend.

is_nmgr_enabled( $user_id = ” )

Returns true if a user has enabled the wishlist module for his use. The function always returns true if user-specific enabling of the wishlist is disabled in the admin area.

Parameters accepted:

User id: [int] The user id. Optional. Defaults to the current logged in user.

is_nmgr_post( $post = null )

Returns true if the post is for an NM Gift Registry post type.

Parameters accepted:

Post: [int|WP_Post|null] The post id or object.

is_nmgr_search()

Returns true if we are on the NM Gift Registry search results page.

is_nmgr_shop_loop()

Returns true if we are in the WooCommerce shop loop.

is_nmgr_wishlist()

Returns true if we are on a single wishlist page on the frontend.