Skip to content

Commit

Permalink
fix: apply default layout when pro addon is inactive
Browse files Browse the repository at this point in the history
  • Loading branch information
girishpanchal30 committed Sep 3, 2024
1 parent ae7dee9 commit 98233f1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 1 addition & 4 deletions inc/customizer/defaults/single_post.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,7 @@ public function get_cpt_context( $allowed = [ 'post', 'page' ] ) {
*/
$allowed_context = apply_filters( 'neve_allowed_custom_post_types', $allowed, 10, 1 );
$context = get_post_type();
if ( ! has_filter( 'neve_context_filter' ) && ! in_array( get_post_type(), $allowed_context, true ) ) {
$context = 'post';
}
$context = apply_filters( 'neve_context_filter', $context, 10, 1 );
$context = apply_filters( 'neve_context_filter', $context, 10, 1 );

return [ $context, $allowed_context ];
}
Expand Down
2 changes: 1 addition & 1 deletion inc/customizer/options/layout_single_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ public function add_controls() {
* @return bool
*/
public static function is_cover_layout() {
return get_theme_mod( 'neve_page_header_layout' ) === 'cover';
return class_exists( '\Neve_Pro\Admin\Custom_Layouts_Cpt' ) && get_theme_mod( 'neve_page_header_layout' ) === 'cover';
}
}
2 changes: 1 addition & 1 deletion inc/customizer/options/layout_single_post.php
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ public function sanitize_post_elements_ordering( $value ) {
* @return bool
*/
public static function is_cover_layout() {
return get_theme_mod( 'neve_post_header_layout' ) === 'cover';
return class_exists( '\Neve_Pro\Admin\Custom_Layouts_Cpt' ) && get_theme_mod( 'neve_post_header_layout' ) === 'cover';
}

/**
Expand Down
4 changes: 4 additions & 0 deletions inc/views/post_layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ private function get_content_order() {
}
}

if ( ! class_exists( '\Neve_Pro\Admin\Custom_Layouts_Cpt' ) ) {
$content_order = array_unique( array_merge( array( 'title-meta' ), $content_order ) );
}

return apply_filters( 'neve_layout_single_post_elements_order', $content_order );
}
}

0 comments on commit 98233f1

Please sign in to comment.