| | |
| | | const JVB_LOCAL = 'northeh.test'; |
| | | |
| | | add_filter('show_admin_bar', '__return_false'); |
| | | const JVB_TESTING = false; |
| | | const JVB_TESTING = true; |
| | | |
| | | const JVB_DIR = WP_PLUGIN_DIR . '/jvb'; |
| | | define('JVB_URL', plugin_dir_url(__FILE__)); |
| | |
| | | require(JVB_DIR . '/activate.php'); |
| | | |
| | | require(JVB_DIR . '/inc/helpers/all.php'); |
| | | require(JVB_DIR . '/inc/meta/_setup.php'); |
| | | require(JVB_DIR . '/inc/managers/_setup.php'); |
| | | require(JVB_DIR . '/inc/integrations/_setup.php'); |
| | | require(JVB_DIR . '/inc/rest/_setup.php'); |
| | | require(JVB_DIR . '/inc/meta/_setup.php'); |
| | | |
| | | add_filter( 'cron_schedules', 'jvbCronSchedules'); |
| | | function jvbCronSchedules($schedules) |
| | |
| | | /** |
| | | * Scripts |
| | | */ |
| | | add_action('wp_enqueue_scripts', 'jvbScripts', 999); |
| | | add_action('wp_enqueue_scripts', 'jvbScripts', 10); |
| | | |
| | | function jvbScripts():void |
| | | { |
| | |
| | | ); |
| | | |
| | | wp_register_script( |
| | | 'jvb-settings', |
| | | JVB_URL.'assets/js/min/settings.min.js', |
| | | [ |
| | | // 'jvb-queue', |
| | | 'jvb-utility', |
| | | 'jvb-data-store' |
| | | ], |
| | | '1.0.0', |
| | | [ |
| | | 'strategy' => 'defer', |
| | | 'in_footer' => true, |
| | | ] |
| | | ); |
| | | |
| | | wp_register_script( |
| | | 'jvb-popup', |
| | | JVB_URL.'assets/js/min/popup.min.js', |
| | | [ |
| | |
| | | 'jvb-selector', |
| | | 'jvb-uploader', |
| | | 'sortable-js', |
| | | 'jvb-populate-form' |
| | | 'jvb-populate-form', |
| | | 'jvb-quill', |
| | | ], |
| | | '1.0.0', |
| | | [ |
| | |
| | | JVB_URL.'assets/js/min/crud.min.js', |
| | | [ |
| | | 'jvb-selector', |
| | | 'jvb-settings', |
| | | 'jvb-a11y', |
| | | 'jvb-error', |
| | | 'jvb-data-store', |
| | |
| | | 'jvb-view', |
| | | JVB_URL.'assets/js/min/view.min.js', |
| | | [ |
| | | 'jvb-settings', |
| | | 'jvb-a11y', |
| | | 'jvb-utility', |
| | | 'jvb-data-store', |
| | |
| | | |
| | | add_action('wp_head', 'jvbInlineNavStyles'); |
| | | |
| | | wp_enqueue_script('jvb-queue'); |
| | | if (Features::forSite()->has('dashboard')) { |
| | | wp_enqueue_script('jvb-queue'); |
| | | } |
| | | |
| | | wp_enqueue_script('jvb-settings'); |
| | | wp_enqueue_script('jvb-navigation'); |
| | | // wp_enqueue_script('jvb-ui'); |
| | | wp_enqueue_script('jvb-media'); |
| | | wp_enqueue_script('jvb-cache'); |
| | | wp_localize_script( |
| | | 'jvb-cache', |
| | | 'cacheJVB', |
| | | [ |
| | | 'cache' => json_encode(jvbGetCache()) |
| | | ] |
| | | ); |
| | | |
| | | |
| | | |
| | |
| | | 'labels' => jvbGetLabels(), |
| | | ]; |
| | | |
| | | wp_localize_script('jvb-queue', 'jvbSettings', $queue); |
| | | wp_localize_script('jvb-utility', 'jvbSettings', $queue); |
| | | |
| | | |
| | | |
| | | $initUserSettings = 'async function initUserItems() { |
| | | if (!jvbSettings.currentUser) return; |
| | |
| | | // '); |
| | | // } |
| | | } |
| | | if (is_user_logged_in()) { |
| | | if (is_user_logged_in() && Features::forSite()->has('notifications')) { |
| | | wp_enqueue_script('jvb-notifications'); |
| | | |
| | | wp_localize_script('jvb-notifications', 'notificationSettings', array( |
| | |
| | | //add_action('wp_head', 'jvbDumpIt'); |
| | | function jvbDumpIt() |
| | | { |
| | | |
| | | jvbDump(get_post_type_archive_link(BASE.'faq')); |
| | | } |
| | | |
| | | //add_filter('map_meta_cap', function($caps, $cap, $user_id, $args) { |
| | | // error_log('Caps: '.print_r($caps, true)); |
| | | // error_log('Cap: '.print_r($cap, true)); |
| | | // error_log('User ID: '.print_r($user_id, true)); |
| | | // error_log('Args: '.print_r($args, true)); |
| | | // return $caps; |
| | | //}, 10, 4); |
| | | |
| | | add_action( 'doing_it_wrong_run', function( $function, $message, $version ) { |
| | | if ( 'map_meta_cap' === $function ) { |
| | | error_log( "Map Meta Cap Wrong: $message" ); |
| | | error_log( print_r( wp_debug_backtrace_summary( null, 0, false ), true ) ); |
| | | } |
| | | }, 10, 3 ); |
| | | |