You just need to check if $customID
is set, first. E.g.
if ($customID && get_permalink ($customID)) {
echo 'true';
} else {
echo 'false';
}
Related Posts:
- How to prefix post permalinks with /blog/ – without affecting custom post types?
- Permalink Structure for Multiple Post Type Archives by Taxonomy
- Taxonomy, Terms, and Template Files
- Disable permalink on custom post type
- Meta_Query as a way how to setup CPT permalinks – is it a good thing?
- custom post type and custom taxonomy permalink
- Adding meta values to permalink
- Hierachical Custom post types permalinks not working
- Custom Posttype Inheritance (and url structure)
- Dynamic taxonomy in permalink made all other posts NOT FOUND?
- Custom Post Type Permalink For Parent/Child, 404 Page Not Found Error
- Can you have two CPTs with the same permalink structure?
- Rewrite permalinks for custom posttype and custom taxonomy
- How to check if last uri segment is a custom post type or taxonomy term?
- Permalinks using event date (year & month) instead of publication date
- Custom taxonomy & post slug permalink
- Permalink Structure problem with cpt and custom taxonomy
- how to use two permalinks for one custom post type
- Custom Taxonomy List links being re-written
- Custom Post Types, Custom Taxonomies and Permalinks ?
- Add the .html extension to custom post types
- Custom Permalink Tag breaks Pagination
- Custom Permalink with Dynamic Taxonomy for Custom Post Type – Works, but breaks other permalinks
- Custom Permalink for Taxonimie and Custom Post Type
- Custom post type hierarchical permalinks not behaving as expected for parent/child pages
- removing custom tax & CPT slug, adding taxonomy term in front of custom type
- Custom post type and taxonomy permalinks – Structure
- Custom Post Type and Custom Taxonomy Permalinks
- Custom Post Type with two hierarchical Custom Taxonomies: strategy to generate best permalink structure
- Different permalink for CPT and regular Posts/Pages but why?
- remove permalink “front part” for custom post type
- Permalink Structure CPT With Custom Taxonomy Fails
- Change Permalink Structure for Tag.php template
- Remove post type slug of all post types from permalinks
- Add archive slug to default post post type
- Custom Post type and permalink settings
- add category name to permalinks on product page /category-name/product-name
- WordPress add_permastruct unwanted matches
- WordPress Custom Post Type Repeated 404 Errors
- Permalink for a custom post type isn’t working and I don’t know why
- Add custom post type settings to wordress default posts
- Assign same parrent Page to pages AND custom post types
- Remove CPT name from permalink but add %category% instead
- How to have this permalink structure: post_type/postname/custom_inner_page
- Additional section in custom post type permalink
- Custom taxonomy returns 404
- Removing Custom Permalink Structure for Custom Post Type
- Use the same date-based permalink structure for all post types
- permalink /category/post-name with custom post type and taxonomy
- “Post name” permalink returns home page for custom posts
- Flush Rewrite Rules when new site is created on network
- Pretty URLs and custom post types
- Lost of query parameter when using permalink
- Different results between permalink and query var search
- menu link to custom post_type?
- Custom permalink with child taxonomy terms
- Custom post type Permalinks with hierarchical Taxonomies
- Can’t use pagination with custom taxonomy
- make permalink go to a custom single.php file
- Post URL based on Custom Post Types variables
- Dynamic CPT permalink structure based on ACF field value
- Custom permalink not working and showing 404 page not error
- How to get all posts related to particular category name on button click?
- Custom Post Type Archive template not being called
- Enabling permalinks disables custom page template
- How to setup a permalink structure for a custom post type
- Query Custom Posts – Add To Selection
- add_query_arg() for custom post type on all visible links
- WordPress custom posts and permalinks
- Custom post type, permalink, add query variables problem
- Disable permalinks, but allow RSS feeds
- CPT permalinks Rewrite
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- Set priority to permalinks
- Modify category permalink to use post type slug
- Changing CPT permalink
- CPT relations use in permalinks under single post type
- Custom Post Type Single Page and Archive Page redirects to Home Page
- Missing permalink for custom post type
- How to change URL structure for custom post type in wordpress? Custom taxonomy + custom Post name [duplicate]
- hierarchical Custom post type child permalink not found
- Remove CPT Slug with 2 taxonomies and 1 post meta
- Custom post type and taxonomy same slug
- How to structure a website with custom post types and custom taxonomies?
- Allow duplicate permalinks slugs for custom posts by different authors
- Creating custom post type relationships
- Custom Post Type Taxonomy – Permalinks generating, but posts not found
- Change wordpress url permalink structure to show authors posts
- Custom Post type and Taxonomy in post URL error
- Custom Post Type + Category archive
- Multiple Custom Post Type permalink issue
- Custom Post Types and rewrite rules – One CPT works and a cloned one doesn’t
- How to retrieve the permalink for a specific (custom) term?
- Permalink Trouble with Custom Post Type
- What is the proper way implement a global $wp_rewrite?
- How can you preserve URLs when moving posts to a custom post type?
- Dynamically change Custom Post Type Template OR Change Permalink?
- Custom post type and category permalinks
- 404 Error On Custom Taxonomy Pages 2, 3, etc
- Custom post type with custom parent prefix slug