| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; // Exit if accessed directly |
| 5 |
} |
| 6 |
global $post; |
| 7 |
$user = uwp_get_displayed_user(); |
| 8 |
if ( has_post_thumbnail() ) { |
| 9 |
$thumb_url = get_the_post_thumbnail_url( get_the_ID(), 'medium' ); |
| 10 |
} else { |
| 11 |
$thumb_url = uwp_get_default_thumb_uri(); |
| 12 |
} |
| 13 |
|
| 14 |
$link = get_the_permalink(); |
| 15 |
if('publish' != $post->post_status){ |
| 16 |
$link = '#'; |
| 17 |
} |
| 18 |
|
| 19 |
?> |
| 20 |
<div class="col mb-4"> |
| 21 |
<div class="card h-100"> |
| 22 |
|
| 23 |
<div class="embed-responsive embed-responsive-16by9"> |
| 24 |
<img alt="" class="card-img-top embed-responsive-item mw-100" src="<?php echo esc_url_raw( $thumb_url ); ?>" /> |
| 25 |
</div> |
| 26 |
|
| 27 |
<div class="card-body"> |
| 28 |
<h3 class="card-title h5"> |
| 29 |
<?php |
| 30 |
|
| 31 |
echo aui()->button(array( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 32 |
'type' => 'a', |
| 33 |
'class' => '', |
| 34 |
'href' => esc_url( $link ), |
| 35 |
'content' => esc_html( get_the_title() ), |
| 36 |
)); |
| 37 |
?> |
| 38 |
</h3> |
| 39 |
<div class="uwp-profile-item-summary card-text"> |
| 40 |
<?php |
| 41 |
do_action( 'uwp_before_profile_summary', get_the_ID(), $post->post_author, $post->post_type ); |
| 42 |
echo $excerpt = esc_attr( strip_shortcodes( wp_trim_words( get_the_excerpt(), 25, '...' ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 43 |
do_action( 'uwp_after_profile_summary', get_the_ID(), $post->post_author, $post->post_type ); |
| 44 |
?> |
| 45 |
</div> |
| 46 |
</div> |
| 47 |
|
| 48 |
<div class="card-footer text-muted"> |
| 49 |
<?php |
| 50 |
$footer_html = '<div class="row">'; |
| 51 |
$footer_html .= '<div class="col">'; |
| 52 |
$footer_html .= apply_filters('uwp_tp_posts_post_footer_left', '<time class="uwp-profile-item-time published timeago" datetime="'.get_the_time( 'c' ).'">'.get_the_date().'</time>'); // time |
| 53 |
$footer_html .= '</div>'; |
| 54 |
|
| 55 |
$footer_html .= '<div class="col text-right">'; |
| 56 |
$footer_html .= apply_filters('uwp_tp_posts_post_footer_right', aui()->button( array( |
| 57 |
'href' => esc_url( get_the_permalink($post->ID) ), |
| 58 |
'class' => 'btn btn-outline-primary btn-sm', |
| 59 |
'content' => esc_html__('View', 'userswp'), |
| 60 |
) )); |
| 61 |
$footer_html .= '</div>'; |
| 62 |
$footer_html .= '</div>'; |
| 63 |
|
| 64 |
echo apply_filters('uwp_tp_posts_post_footer', $footer_html); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 65 |
?> |
| 66 |
</div> |
| 67 |
|
| 68 |
</div> |
| 69 |
</div> |
| 70 |
|