wpseek.com
A WordPress-centric search engine for devs and theme authors
_media_states › WordPress Function
Since3.2.0
Deprecatedn/a
› _media_states ( $post, $display = true )
Parameters: (2) |
|
Returns: |
|
Defined at: |
|
Codex: | |
Change Log: |
|
Outputs the attachment media states as HTML.
Source
function _media_states( $post, $display = true ) { $media_states = get_media_states( $post ); $media_states_string = ''; if ( ! empty( $media_states ) ) { $state_count = count( $media_states ); $i = 0; $media_states_string .= ' — '; foreach ( $media_states as $state ) { ++$i; $separator = ( $i < $state_count ) ? ', ' : ''; $media_states_string .= "<span class='post-state'>{$state}{$separator}</span>"; } } if ( $display ) { echo $media_states_string; } return $media_states_string; }