: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Base class for all REST API controllers.
namespace StringLocator\Base;
use StringLocator\String_Locator;
class REST extends \WP_REST_Controller {
protected $namespace = 'string-locator/v1';
public function __construct() {
add_action( 'rest_api_init', array( $this, 'register_rest_route' ) );
* Generic helper function to check if the current user
* meets the minimum access requirements of the plugin.
public function permission_callback() {
return current_user_can( String_Locator::$default_capability );