Remove redundant code from post_type_supports() and remove_post_type_support(). props obenland, bilalcoder. fixes #21527.

git-svn-id: https://develop.svn.wordpress.org/trunk@23722 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2013-03-15 18:28:33 +00:00
parent b989307db1
commit c4f8e11df0
+3 -16
View File
@@ -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] ) );
}
/**