| @@ -1,12 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | + | |
| 2 | 3 | namespace WPDeveloper\BetterDocs\FrontEnd; |
| 3 | 4 | |
| 4 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 5 | - exit; | |
| 6 | -} | |
| 7 | - | |
| 8 | - | |
| 9 | 5 | use WPDeveloper\BetterDocs\Utils\Base; |
| 10 | 6 | use WPDeveloper\BetterDocs\Utils\Helper; |
| 11 | 7 | use WPDeveloper\BetterDocs\Core\Settings; |
| 12 | 8 | use WPDeveloper\BetterDocs\Utils\Enqueue; |
| @@ -72,13 +68,9 @@ | ||
| 72 | 68 | $post_type = get_query_var( 'post_type' ) != null ? get_query_var( 'post_type' ) : ''; |
| 73 | 69 | $author_id = get_query_var( 'author' ) != null ? get_query_var( 'author' ) : 0; |
| 74 | 70 | $author_docs_count = count_user_posts( $author_id, 'docs' ); |
| 75 | 71 | |
| 76 | - // Only override on an actual author archive — otherwise this also fires on | |
| 77 | - // the main docs archive (where $author_id falls back to 0) whenever any doc | |
| 78 | - // has post_author 0, hijacking the docs/MKB archive (and its FSE template) | |
| 79 | - // with the author template. | |
| 80 | - if ( is_author() && $post_type == 'docs' && $author_docs_count > 0 ) { | |
| 72 | + if ( $post_type == 'docs' && $author_docs_count > 0 ) { | |
| 81 | 73 | wp_enqueue_style('betterdocs-breadcrumb'); |
| 82 | 74 | $template_path = BETTERDOCS_ABSPATH . 'views/templates/authors/author.php'; |
| 83 | 75 | } |
| 84 | 76 | |
| @@ -244,9 +236,9 @@ | ||
| 244 | 236 | $attr .= sprintf( ' %s="%s"', esc_attr( $key ), esc_attr( $value ) ); |
| 245 | 237 | } |
| 246 | 238 | |
| 247 | 239 | // Render the shortcode based on layout and reactions availability |
| 248 | - if ( ( $single_layout == 'layout-8' || $single_layout == 'layout-10' ) && $reactions ) { | |
| 240 | + if ( $single_layout == 'layout-8' || $single_layout == 'layout-10' && $reactions ) { | |
| 249 | 241 | echo do_shortcode( '[betterdocs_article_reactions text_tag="' . esc_attr( $text_tag ) . '" layout="layout-2"' . $attr . ']' ); |
| 250 | 242 | } elseif ( $single_layout == 'layout-9' && $reactions ) { |
| 251 | 243 | echo ''; |
| 252 | 244 | } elseif ( $reactions ) { |
| @@ -322,9 +314,8 @@ | ||
| 322 | 314 | 'betterdocs-reactions', |
| 323 | 315 | 'betterdocsReactionsConfig', |
| 324 | 316 | [ |
| 325 | 317 | 'post_id' => get_the_ID(), |
| 326 | - 'nonce' => wp_create_nonce( 'wp_rest' ), | |
| 327 | 318 | 'FEEDBACK' => [ |
| 328 | 319 | 'DISPLAY' => true, |
| 329 | 320 | 'TEXT' => esc_html__( 'How did you feel?', 'betterdocs' ), |
| 330 | 321 | 'SUCCESS' => betterdocs()->settings->get( 'reaction_feedback_text', __( 'Thanks for your feedback', 'betterdocs' ) ), |