Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#37931 closed feature request (invalid)

new function post_type_exists()

Reported by: mifr45's profile mifr45 Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.6
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

New function post_type_exists()

<?php
function post_type_exists($type){
                $types = get_post_types();
                if(in_array($type,$types)){
                        return true;
                }
                else{
                        return false;
                }
        }
?>

Change History (1)

#1 @swissspidy
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Hey there,

Thanks for your report and welcome to WordPress Trac!

The function post_type_exists() exists in WordPress since version 3.0.0.

Note: See TracTickets for help on using tickets.