wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
_post_states › WordPress Function
Seit2.7.0
Veraltetn/v
› _post_states ( $post, $echo = true )
Parameter: (2) |
|
Siehe: | |
Gibt zurück: |
|
Definiert in: |
|
Codex: | |
Changelog: |
|
Function to echo or return the post states as HTML.
Ähnliche Funktionen: get_post_states, get_post_statuses, get_post_status, get_post_stati, post_exists
Quellcode
function _post_states( $post, $echo = true ) { $post_states = get_post_states( $post ); $post_states_string = ''; if ( ! empty( $post_states ) ) { $state_count = count( $post_states ); $i = 0; $post_states_string .= ' — '; foreach ( $post_states as $state ) { $sep = ( ++$i === $state_count ) ? '' : ', '; $post_states_string .= "<span class='post-state'>$state$sep</span>"; } } if ( $echo ) { echo $post_states_string; } return $post_states_string; }