| | |
| | | |
| | | use JVBase\JVB; |
| | | use JVBase\managers\IconsManager; |
| | | use JVBase\meta\Meta; |
| | | use JVBase\registrar\Registrar; |
| | | |
| | | use JVBase\utility\Features; |
| | | use JVBase\base\Site; |
| | | |
| | | //security |
| | | if (!defined('ABSPATH')) { |
| | |
| | | |
| | | define('JVB_TESTING', str_contains(get_home_url(),'.test')); |
| | | |
| | | if (JVB_TESTING) { |
| | | //if (!JVB_TESTING) { |
| | | add_filter('show_admin_bar', '__return_false'); |
| | | } |
| | | //} |
| | | |
| | | //if (JVB_TESTING) { |
| | | // error_log('In testing mode...'); |
| | | //} else { |
| | |
| | | { |
| | | add_action('wp_head', 'jvbInlineNavStyles'); |
| | | |
| | | if (Features::forSite()->has('dashboard')) { |
| | | if (Site::has('dashboard')) { |
| | | wp_enqueue_script('jvb-queue'); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | $interactions = []; |
| | | if (Features::forSite()->has('favourites')) { |
| | | if (Site::has('favourites')) { |
| | | $interactions[] = 'favourites'; |
| | | } |
| | | if (!empty(Registrar::getFeatured('karma'))) { |
| | | $interactions[] = 'karma'; |
| | | } |
| | | if (Features::forSite()->has('notifications')) { |
| | | if (Site::has('notifications')) { |
| | | $interactions[] = 'notifications'; |
| | | } |
| | | |
| | |
| | | window.userFavourites = {}; |
| | | window.userVotes = {}; |
| | | '; |
| | | if (Features::forSite()->has('favourites')) { |
| | | if (Site::has('favourites')) { |
| | | wp_enqueue_script('jvb-favourites'); |
| | | $initUserSettings .= ' |
| | | //Fetch user favourites |
| | |
| | | // '); |
| | | // } |
| | | } |
| | | if (is_user_logged_in() && Features::forSite()->has('notifications')) { |
| | | if (is_user_logged_in() && Site::has('notifications')) { |
| | | wp_enqueue_script('jvb-notifications'); |
| | | |
| | | wp_localize_script('jvb-notifications', 'notificationSettings', array( |