| @@ -245,11 +245,9 @@ | ||
| 245 | 245 | '/faq/posts/(?P<type>\S+)', |
| 246 | 246 | [ |
| 247 | 247 | 'methods' => [ 'GET' ], |
| 248 | 248 | 'callback' => [ $this, 'fetch_faq_posts' ], |
| 249 | - 'permission_callback' => function () { | |
| 250 | - return current_user_can( 'edit_others_posts' ); | |
| 251 | - } | |
| 249 | + 'permission_callback' => '__return_true' | |
| 252 | 250 | ] |
| 253 | 251 | ); |
| 254 | 252 | |
| 255 | 253 | register_rest_route( |
| @@ -365,11 +363,9 @@ | ||
| 365 | 363 | '/faq/uncategorised', |
| 366 | 364 | [ |
| 367 | 365 | 'methods' => [ 'GET' ], |
| 368 | 366 | 'callback' => [ $this, 'get_uncategorised_faq' ], |
| 369 | - 'permission_callback' => function () { | |
| 370 | - return current_user_can( 'edit_others_posts' ); | |
| 371 | - } | |
| 367 | + 'permission_callback' => '__return_true' | |
| 372 | 368 | ] |
| 373 | 369 | ); |
| 374 | 370 | |
| 375 | 371 | register_rest_route( |
| @@ -377,16 +373,13 @@ | ||
| 377 | 373 | '/faq/category_search', |
| 378 | 374 | [ |
| 379 | 375 | 'methods' => [ 'GET' ], |
| 380 | 376 | 'callback' => [ $this, 'category_search' ], |
| 381 | - 'permission_callback' => function () { | |
| 382 | - return current_user_can( 'edit_others_posts' ); | |
| 383 | - }, | |
| 377 | + 'permission_callback' => '__return_true', | |
| 384 | 378 | 'args' => [ |
| 385 | 379 | 'title' => [ |
| 386 | - 'type' => 'string', | |
| 387 | - 'required' => true, | |
| 388 | - 'sanitize_callback' => 'sanitize_text_field' | |
| 380 | + 'type' => 'string', | |
| 381 | + 'required' => true | |
| 389 | 382 | ] |
| 390 | 383 | ] |
| 391 | 384 | ] |
| 392 | 385 | ); |
| @@ -675,9 +668,9 @@ | ||
| 675 | 668 | |
| 676 | 669 | return get_posts( |
| 677 | 670 | [ |
| 678 | 671 | 'post_type' => 'betterdocs_faq', |
| 679 | - 'post_status' => current_user_can( 'edit_others_posts' ) ? [ 'publish', 'draft' ] : 'publish', | |
| 672 | + 'post_status' => [ 'publish', 'draft' ], | |
| 680 | 673 | 'posts_per_page' => -1, |
| 681 | 674 | 'tax_query' => [ |
| 682 | 675 | 'relation' => 'AND', |
| 683 | 676 | [ |