/home/techb158/l2hypotheques.com/wp-content/plugins/breadcrumb-navxt
Edit: /home/techb158/l2hypotheques.com/wp-content/plugins/breadcrumb-navxt/class.bcn_rest_controller.php (9343B)
' . esc_html__('Your PHP version is too old, please upgrade to a newer version. Your version is %1$s, Breadcrumb NavXT requires %2$s', 'breadcrumb-navxt') . '
', esc_html(phpversion()), '7.0.0');
}
//If we are in the admin, let's print a warning then return
if(is_admin())
{
add_action('admin_notices', 'bcn_phpold');
}
return;
}
class bcn_rest_controller
{
const version = '1';
protected $unique_prefix = 'bcn';
protected $breadcrumb_trail = null;
protected $methods = array('GET', 'OPTIONS');
/**
* Default constructor
*
* @param bcn_breadcrumb_trail $breadcrumb_trail An instance of a bcn_breadcrumb_trail object to use for everything
* @param string $unique_prefix The unique prefix to use for the API endpoint
*/
public function __construct(bcn_breadcrumb_trail $breadcrumb_trail, $unique_prefix)
{
$this->breadcrumb_trail = $breadcrumb_trail;
$this->unique_prefix = $unique_prefix;
add_action('rest_api_init', array($this, 'register_routes'));
}
/**
* A quick wrapper for register_rest_route to add our inclusion filter
*
* @param string $endpoint The endpoint name passed into the bcn_register_rest_endpoint filter
* @param string $namespace The first URL segment after core prefix. Should be unique
* @param string $route The base URL for route being added
* @param array $args Optional. Either an array of options for the endpoint, or an array of arrays for
* multiple methods. Default empty array.
* @param bool $override Optional. If the route already exists, should we override it?
* @return boolean True on success, false on error.
*/
protected function register_rest_route($endpoint, $namespace, $route, $args = array(), $override = false)
{
if(apply_filters('bcn_register_rest_endpoint', false, $endpoint, $this::version, $this->methods))
{
return register_rest_route($namespace, $route, $args, $override);
}
return false;
}
public function register_routes()
{
$this->register_rest_route('post', $this->unique_prefix . '/v' . $this::version, '/post/(?P