Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move REST API endpoints to controllers #3650

Merged
merged 19 commits into from
Oct 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Delete unused endpoint.
  • Loading branch information
JakePT committed Sep 22, 2023
commit 50b4f9f61e523e289b54a661444e04500b336002
16 changes: 0 additions & 16 deletions includes/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ function setup() {
add_action( 'ep_add_query_log', __NAMESPACE__ . '\log_version_query_error' );
add_filter( 'ep_analyzer_language', __NAMESPACE__ . '\use_language_in_setting', 10, 2 );
add_filter( 'wp_kses_allowed_html', __NAMESPACE__ . '\filter_allowed_html', 10, 2 );
add_action( 'rest_api_init', __NAMESPACE__ . '\setup_endpoint' );
add_action( 'enqueue_block_editor_assets', __NAMESPACE__ . '\block_assets' );

if ( version_compare( get_bloginfo( 'version' ), '5.8', '>=' ) ) {
Expand Down Expand Up @@ -969,21 +968,6 @@ function action_wp_ajax_ep_site_admin() {
return wp_send_json_success( $data );
}

/**
* Registers the API endpoint
*/
function setup_endpoint() {
register_rest_route(
'elasticpress/v1',
'indexing_status',
[
'methods' => 'GET',
'callback' => __NAMESPACE__ . '\handle_indexing_status',
'permission_callback' => '__return_true',
]
);
}

/**
* Handle the fetch for indexing status
*/
Expand Down