Skip to content

Commit

Permalink
chore: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Nov 21, 2023
1 parent 3b73d91 commit 76563e0
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions inc/views/template_parts.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public function render_post() {

$args = array(
'post_id' => 'post-' . get_the_ID(),
'post_class' => $this->post_class( null, '' ),
'post_class' => $this->post_class(),
'content' => $this->get_article_inner_content(),
);

Expand All @@ -211,11 +211,9 @@ protected function post_class( $post_id = null, $additional = '' ) {
$class .= ' nv-non-grid-article';
}
}

$ordered_components = $this->get_ordered_components();


// Filter the Core classes for missing components.
$is_thumbnail_inactive = ! in_array( 'thumbnail', $ordered_components, true );
$is_thumbnail_inactive = ! in_array( 'thumbnail', $this->get_ordered_components(), true );
if ( $is_thumbnail_inactive ) {
$class = str_replace( 'has-post-thumbnail', '', $class );
}
Expand Down Expand Up @@ -457,18 +455,18 @@ public function link_excerpt_more( $moretag, $post_id = null ) {
* @return string
*/
private function get_ordered_content_parts( $exclude_thumbnail = false, $post_id = null ) {
$markup = '';
$order = $this->get_ordered_components( true );
$markup = '';
$ordered_components = $this->get_ordered_components( true );

if ( $post_id !== null && in_array( 'thumbnail', $order, true ) ) {
$key = array_search( 'thumbnail', $order );
if ( $post_id !== null && in_array( 'thumbnail', $ordered_components, true ) ) {
$key = array_search( 'thumbnail', $ordered_components );
if ( $key !== false ) {
unset( $order[ $key ] );
unset( $ordered_components[ $key ] );
}
array_unshift( $order, 'thumbnail' );
array_unshift( $ordered_components, 'thumbnail' );
}

foreach ( $order as $content_bit ) {
foreach ( $ordered_components as $content_bit ) {
switch ( $content_bit ) {
case 'thumbnail':
if ( $exclude_thumbnail ) {
Expand Down

0 comments on commit 76563e0

Please sign in to comment.