mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Remove redundant code from post_type_supports() and remove_post_type_support(). props obenland, bilalcoder. fixes #21527.
git-svn-id: http://core.svn.wordpress.org/trunk@23722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f4b2484cc9
commit
27298cd802
@ -1529,11 +1529,8 @@ function add_post_type_support( $post_type, $feature ) {
|
||||
function remove_post_type_support( $post_type, $feature ) {
|
||||
global $_wp_post_type_features;
|
||||
|
||||
if ( !isset($_wp_post_type_features[$post_type]) )
|
||||
return;
|
||||
|
||||
if ( isset($_wp_post_type_features[$post_type][$feature]) )
|
||||
unset($_wp_post_type_features[$post_type][$feature]);
|
||||
if ( isset( $_wp_post_type_features[$post_type][$feature] ) )
|
||||
unset( $_wp_post_type_features[$post_type][$feature] );
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1565,17 +1562,7 @@ function get_all_post_type_supports( $post_type ) {
|
||||
function post_type_supports( $post_type, $feature ) {
|
||||
global $_wp_post_type_features;
|
||||
|
||||
if ( !isset( $_wp_post_type_features[$post_type][$feature] ) )
|
||||
return false;
|
||||
|
||||
// If no args passed then no extra checks need be performed
|
||||
if ( func_num_args() <= 2 )
|
||||
return true;
|
||||
|
||||
// @todo Allow pluggable arg checking
|
||||
//$args = array_slice( func_get_args(), 2 );
|
||||
|
||||
return true;
|
||||
return ( isset( $_wp_post_type_features[$post_type][$feature] ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user