wp-juggler-server/includes/class-wpjs-front-end.php
2024-08-14 18:14:41 +02:00

82 lines
1.8 KiB
PHP

<?php
/**
* The dashboard-specific functionality of the plugin.
*
* Registers styles and scripts, adds the custom administration page,
* and processes user input on the "search/replace" form.
*
* @link https://wpjuggler.com
* @since 1.0.0
*
* @package WP_Juggler_Server
* @subpackage WP_Juggler_Server/includes
*/
// Prevent direct access.
if (! defined('WPJS_PATH')) exit;
class WPJS_Front_End
{
/**
* The ID of this plugin.
*
* @since 1.0.0
* @access private
* @var string $wp_juggler_server The ID of this plugin.
*/
private $wp_juggler_server;
/**
* The version of this plugin.
*
* @since 1.0.0
* @access private
* @var string $version The current version of this plugin.
*/
private $version;
/**
* Initialize the class and set its properties.
*
* @since 1.0.0
* @var string $wp_juggler_server The name of this plugin.
* @var string $version The version of this plugin.
*/
public function __construct($wp_juggler_server, $version)
{
$this->wp_juggler_server = $wp_juggler_server;
$this->version = $version;
}
/**
* Register any CSS and JS used by the plugin.
* @since 1.0.0
* @access public
* @param string $hook Used for determining which page(s) to load our scripts.
*/
public function enqueue_scripts($hook)
{
}
public function wpjs_empty_template()
{
if ($_SERVER['REQUEST_URI'] === '/wpjuggler/') {
if (! is_admin() || !current_user_can('administrator')) {
exit;
}
add_filter('template_include', function( $template ) {
//return WPJS_PATH . 'templates/wpjs-empty-template.php';
return $template;
});
/*add_filter('pre_handle_404', function($preempt, $wp_query) {
return true;
}, 5, 2);*/
}
}
}