current_theme_supports [ WordPress Function ]
current_theme_supports ( $feature )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: get_theme_support, remove_theme_support, current_theme_info, _remove_theme_support, require_if_theme_supports
Checks a theme's support for a given feature
Source
<?php
function current_theme_supports( $feature ) {
global $_wp_theme_features;
if ( 'custom-header-uploads' == $feature )
return current_theme_supports( 'custom-header', 'uploads' );
if ( !isset( $_wp_theme_features[$feature] ) )
return false;
// If no args passed then no extra checks need be performed
if ( func_num_args() <= 1 )
return true;
$args = array_slice( func_get_args(), 1 );
switch ( $feature ) {
case 'post-thumbnails':
// post-thumbnails can be registered for only certain content/post types by passing
// an array of types to add_theme_support(). If no array was passed, then
// any type is accepted
if ( true === $_wp_theme_features[$feature] ) // Registered for all types
return true;
$content_type = $args[0];
return in_array( $content_type, $_wp_theme_features[$feature][0] );
break;
case 'post-formats':
// specific post formats can be registered by passing an array of types to
// add_theme_support()
$post_format = $args[0];
return in_array( $post_format, $_wp_theme_features[$feature][0] );
break;
case 'custom-header':
case 'custom-background' :
// specific custom header and background capabilities can be registered by passing
// an array to add_theme_support()
$header_support = $args[0];
return ( isset( $_wp_theme_features[$feature][0][$header_support] ) && $_wp_theme_features[$feature][0][$header_support] );
break;
}
return apply_filters('current_theme_supports-' . $feature, true, $args, $_wp_theme_features[$feature]);
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/current theme supports « WordPress Codex
Function Reference/current theme supports ... <?php current_theme_supports( $ feature ); ?> ... current_theme_supports() is located in wp-includes/theme.php .
codex.wordpress.org - WordPress › Support » current_theme_supports function
Member Posted 1 year ago #. I'm trying to install a new theme but I'm getting the following error: Fatal error: Call to undefined function current_theme_supports() ...
wordpress.org - current_theme_supports
Function and Method Cross Reference. current_theme_supports(). Defined at: / wp-includes/theme.php -> line 1463. Referenced 84 times: ...
phpxref.ftwr.co.uk - current_theme_supports() WordPress function reference, arguments ...
function current_theme_supports( $feature ) { global $_wp_theme_features; if ( ! isset( $_wp_theme_features[$feature] ) ) return false; // If no args passed then no ...
queryposts.com