Fix some story comments issues
This commit is contained in:
parent
682e08fc40
commit
0aae80988c
@ -635,6 +635,10 @@ require_once __DIR__ . '/includes/functions/_oauth.php';
|
||||
require_once __DIR__ . '/includes/functions/comments/_comments_controller.php'; // Used in REST
|
||||
require_once __DIR__ . '/includes/functions/comments/_story_comments.php'; // Used in REST
|
||||
|
||||
if ( strpos( $_SERVER['REQUEST_URI'], 'wp-json/fictioneer/' ) !== false ) {
|
||||
require_once __DIR__ . '/includes/functions/comments/_comments_threads.php';
|
||||
}
|
||||
|
||||
if ( is_admin() ) {
|
||||
// Required for AJAX
|
||||
require_once __DIR__ . '/includes/functions/comments/_comments_ajax.php';
|
||||
|
@ -147,7 +147,7 @@ add_action( 'rest_api_init', 'fictioneer_register_endpoint_get_story_comments' )
|
||||
function fictioneer_rest_get_story_comments( WP_REST_Request $request ) {
|
||||
// Validations
|
||||
$story_id = $request->get_param( 'post_id' );
|
||||
$story_id = isset( $story_id ) ? fictioneer_validate_id( $_GET['post_id'], 'fcn_story' ) : false;
|
||||
$story_id = isset( $story_id ) ? fictioneer_validate_id( $story_id, 'fcn_story' ) : false;
|
||||
$default_error = array( 'error' => __( 'Comments could not be loaded.', 'fictioneer' ) );
|
||||
|
||||
// Abort if not a story
|
||||
|
Loading…
x
Reference in New Issue
Block a user