ID, $format, null ); if ( ! $format || !$value) return false; $markup = null; switch ( $format ) { case 'aside': $markup = $value; break; case 'audio': $background = has_post_thumbnail() ? get_the_post_thumbnail_url( $post, 'full' ) : ''; $markup .= benjamin_get_the_audio_markup( $value ); break; case 'image': $markup .= ''; $markup .= ''; $markup .= ''; break; case 'quote': $markup .= benjamin_get_quote_markup( $value ); break; case 'status': $markup .= benjamin_get_status_markup( $value ); break; case 'video': $markup .= benjamin_get_the_video_markup( $value ); break; } if ( ! $markup ) { return ''; } $output = '
'; $output .= $markup; $output .='
'; return $output; } function benjamin_post_format_markup( $post = null, $format = 'standard' ) { if ( ! $post ) { global $post; } echo benjamin_get_post_format_markup( $post, $format ); //WPCS: xss ok. } /** * The markup for quotes, as created by the quote post format */ function benjamin_get_quote_markup( $quote = array() ) { if( ! is_array( $quote ) || ! isset( $quote['author'] ) || ! isset( $quote['body'] ) ){ return; } $output = ''; $output .= '
'; $output .= '

' . $quote['body'] . '

'; if ( $quote['author'] ) { $output .= ' ' . $quote['author'] . ''; } $output .= '
'; return $output; } /** * The markup for the chat logs - this isnt used yet as it requires some work */ function benjamin_get_chat_log( $chat = null ) { if ( ! $chat || empty( $chat ) || empty( $chat['messages'] ) ) { return; } $messages = $chat['messages']; $style = 'graphical'; $output = ''; $output .= '
    '; foreach ( $messages as $message ) { $output .= '
  1. '; $output .= '
    ' . $message['displayName'] . '
    '; $output .= '

    ' . $message['text'] . '

    '; $output .= '
  2. '; } $output .= '
'; return $output; } /** * The markup for the chat logs - this isnt used yet as it requires some work */ function benjamin_get_status_markup( $status = null ) { if ( ! $status || empty( $status ) ) { return; } $output = '

' . $status . '

'; return $output; }