'', 'post_identifier' => 0, ] ); $is_xpost = false; // Used for initial PHP templates if ( 'underscore' !== $args['engine'] ) { // Temporarily hide password protected posts until we handle them properly. if ( post_password_required( $args['post_identifier'] ) ) { return; } $is_xpost = ! empty( get_post_meta( $args['post_identifier'], '_xpost_original_permalink', true ) ); } else { // Override xposts used to register underscore xpost template. if ( isset( $args['xpost'] ) ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable $is_xpost = $args['xpost']; } } switch ( true ) { case \Automattic\P2\Themes\P2020\Compact_View::should_show_compact_view(): get_template_part( 'partials/post-types/compact-post', $args['engine'] ); break; case $is_xpost: get_template_part( 'partials/post-types/default-xpost', $args['engine'] ); break; case is_page(): get_template_part( 'partials/post-types/default-page', $args['engine'] ); break; case is_search(): get_template_part( 'partials/post-types/search-post', $args['engine'] ); break; default: $default_template = 'partials/post-types/default-post'; $template = apply_filters( 'p2020_post_template', $default_template, $args['post_identifier'] ); get_template_part( $template, $args['engine'] ); break; }