_media_states [ WordPress Function ]
_media_states ( $post )
| Defined at: |
|
No description yet.
Source
<?php
function _media_states( $post ) {
$media_states = array();
$stylesheet = get_option('stylesheet');
if ( current_theme_supports( 'custom-header') ) {
$meta_header = get_post_meta($post->ID, '_wp_attachment_is_custom_header', true );
if ( ! empty( $meta_header ) && $meta_header == $stylesheet )
$media_states[] = __( 'Header Image' );
}
if ( current_theme_supports( 'custom-background') ) {
$meta_background = get_post_meta($post->ID, '_wp_attachment_is_custom_background', true );
if ( ! empty( $meta_background ) && $meta_background == $stylesheet )
$media_states[] = __( 'Background Image' );
}
$media_states = apply_filters( 'display_media_states', $media_states );
if ( ! empty( $media_states ) ) {
$state_count = count( $media_states );
$i = 0;
echo ' - ';
foreach ( $media_states as $state ) {
++$i;
( $i == $state_count ) ? $sep = '' : $sep = ', ';
echo "<span class='post-state'>$state$sep</span>";
}
}
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- #17291 (Introduce _media_states() to show the status (background ...
Screenshot: http://d.pr/WEf7. _media_states() should show if the image is used as a background and/or header image. This is related to #15100 and #17240.
core.trac.wordpress.org - _media_states | A HitchHackers guide through WordPress
Jul 5, 2011 ... function _media_states( $post ) { $media_states = array(); $stylesheet = get_option('stylesheet'); if ( current_theme_supports( 'custom-header') ) ...
hitchhackerguide.com - Microsoft Windows XP - Media states
Each tape or disk in a Removable Storage system has a state associated with it that determines the operations that can be performed with the media When ...
www.microsoft.com - minh carrico : multi-media : states of demise
minh carrico : visually driven by art and photography.
minhcarrico.com