| | |
| | | Plugin URI: https://jakevan.ca |
| | | Description: The Base Plugin for JakeVan clients |
| | | Author: Jake Vanderwerf |
| | | Version: 1.0.0 |
| | | Version: 1.1.0 |
| | | Author URI: https://jakevan.ca/ |
| | | Textdomain: jvb |
| | | */ |
| | |
| | | exit; |
| | | } |
| | | |
| | | //add_action('admin_enqueue_scripts', function() { |
| | | // global $wp_scripts; |
| | | // add_action('admin_print_scripts', function() use ($wp_scripts) { |
| | | // $queue = $wp_scripts->queue ?? []; |
| | | // foreach ($queue as $handle) { |
| | | // $src = $wp_scripts->registered[$handle]->src ?? 'unknown'; |
| | | // error_log("Enqueued: $handle => $src"); |
| | | // } |
| | | // }, 999); |
| | | //}, 999); |
| | | |
| | | |
| | | /** |
| | | * Track REST API errors by wrapping request execution |
| | |
| | | }, 10, 3); |
| | | |
| | | |
| | | |
| | | function jvbIgnoredPostTypes():array |
| | | { |
| | | return [BASE.'directory', BASE.'dash', 'attachment', 'revision', 'nav_menu_item']; |
| | |
| | | require(JVB_DIR . '/inc/admin/_setup.php'); |
| | | |
| | | require(JVB_DIR . '/JVBase.php'); |
| | | |
| | | /** |
| | | * After moving to the Registrar::based registration, we need to carefully time |
| | | * when Site gets defined, as well as Registrar initial definitions, field definitions, |
| | | * and integration config |
| | | * These custom actions should simplify the timing for us. |
| | | */ |
| | | add_action('plugins_loaded', 'jvb_site_definitions',1); |
| | | add_action('plugins_loaded', 'jvb_registrar_definitions',2); |
| | | add_action('plugins_loaded', 'jvb_field_definitions', 3); |
| | | add_action('plugins_loaded', 'jvb_options_definitions',3); |
| | | add_action('init', 'jvbLoadBase', 1); |
| | | add_action('init', 'jvb_integration_definitions',3); |
| | | add_action('init', 'jvb_field_section_definitions', 5); |
| | | /** |
| | | * Can define the Site settings |
| | | * @return void |
| | | */ |
| | | function jvb_site_definitions():void |
| | | { |
| | | do_action('jvb_define_site'); |
| | | } |
| | | function jvb_registrar_definitions():void |
| | | { |
| | | do_action('jvb_define_registrar'); |
| | | } |
| | | function jvb_field_definitions():void |
| | | { |
| | | do_action('jvb_define_fields'); |
| | | } |
| | | |
| | | function jvb_options_definitions():void |
| | | { |
| | | do_action('jvb_define_options'); |
| | | } |
| | | |
| | | function jvbLoadBase():void |
| | | { |
| | | JVB::getInstance(); |
| | | } |
| | | |
| | | function jvb_integration_definitions():void |
| | | { |
| | | do_action('jvb_define_integrations'); |
| | | } |
| | | |
| | | function jvb_field_section_definitions():void |
| | | { |
| | | do_action('jvb_define_field_sections'); |
| | | Registrar::maybeBuildSections(); |
| | | } |
| | | |
| | | |
| | | function JVB(): JVB |
| | | { |
| | | return JVB::getInstance(); |
| | |
| | | if (Site::has('favourites')) { |
| | | $interactions[] = 'favourites'; |
| | | } |
| | | if (!empty(Registrar::getFeatured('karma'))) { |
| | | if (!empty(Registrar::withFeature('karma'))) { |
| | | $interactions[] = 'karma'; |
| | | } |
| | | if (Site::has('notifications')) { |
| | |
| | | } |
| | | |
| | | if (!empty($interactions)) { |
| | | wp_enqueue_script('jvb-interactions'); |
| | | foreach($interactions as $interaction) { |
| | | wp_enqueue_script('jvb-'.$interaction); |
| | | } |
| | |
| | | }'; |
| | | } |
| | | |
| | | if (!empty(Registrar::getFeatured('karma'))) { |
| | | if (!empty(Registrar::withFeature('karma'))) { |
| | | wp_enqueue_script('jvb-votes'); |
| | | $initUserSettings .= '// Fetch user votes |
| | | try { |
| | |
| | | )); |
| | | } |
| | | |
| | | jvbAddScriptDependency('jvb-feed-view-script', 'jvb-queue'); |
| | | // jvbAddScriptDependency('jvb-feed-view-script', 'jvb-queue'); |
| | | jvbAddScriptDependency('jvb-feed-view-script', 'jvb-selector'); |
| | | jvbAddScriptDependency('jvb-feed-view-script', 'jvb-data-store'); |
| | | jvbAddScriptDependency('jvb-feed-view-script', 'jvb-cache'); |
| | |
| | | jvbAddScriptDependency('jvb-forms-view-script', 'jvb-quill'); |
| | | jvbAddScriptDependency('jvb-forms-view-script', 'jvb-form'); |
| | | jvbAddScriptDependency('jvb-forms-view-script', 'jvb-tabs'); |
| | | |
| | | jvbAddScriptDependency('jvb-timeline-view-script', 'jvb-gallery'); |
| | | } |
| | | |
| | | function jvbAdminMap():void |
| | |
| | | debug_print_backtrace(); |
| | | } |
| | | } ); |
| | | |
| | | |
| | | add_filter('the_seo_framework_sitemap_exclude_ids', 'jvb_maybe_exclude_singles', 8, 1); |
| | | function jvb_maybe_exclude_singles(array $IDs):array |
| | | { |
| | | return Registrar::maybeExcludeSingles($IDs); |
| | | } |