PluginProbe
Panorama – Turn Photos into Immersive Virtual Tours / trunk
Panorama – Turn Photos into Immersive Virtual Tours vtrunk
1.8.0 1.7.4 1.7.3 1.7.2 1.7.1 1.7.0 1.6.1 trunk 1.0.0 1.0.1 1.0.10 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.1.3 1.1.4 1.1.5 1.1.6 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 All 38 releases
panorama / admin / ads / submenu.php

submenu.php in Panorama – Turn Photos into Immersive Virtual Tours trunk, at admin/ads/submenu.php

75 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit;
4 }
5
6 add_action( 'admin_enqueue_scripts', 'bppiv_custom_admin_style' );
7 add_action('admin_menu', 'bppiv_add_submenu_page');
8 add_action( 'admin_enqueue_scripts', 'bppiv_adminEnqueueScripts' );
9
10 function bppiv_custom_admin_style() {
11 $current = function_exists('get_current_screen') ? get_current_screen() : null;
12 $post_type = $current && isset($current->post_type) ? $current->post_type : '';
13 $screen_id = $current && isset($current->id) ? $current->id : '';
14
15 $is_bppiv_screen = ( strpos( $screen_id, 'bppiv-image-viewer' ) !== false ) || in_array( $post_type, ['bppiv-image-viewer', 'virtual_tour', 'product_spot'], true );
16
17 if ( $is_bppiv_screen ) {
18 wp_register_style( 'bppiv_admin_custom_css', plugin_dir_url(__FILE__) . 'style.css', false, BPPIV_VERSION );
19 wp_enqueue_style( 'bppiv_admin_custom_css' );
20 }
21 }
22
23 function bppiv_add_submenu_page(){
24 add_submenu_page(
25 'edit.php?post_type=bppiv-image-viewer',
26 'Help & Demos',
27 '<span style="color: #f18500; font-weight: 600;">Help & Demos</span>',
28 'manage_options',
29 'bppiv-support',
30 'bppiv_dashboard_page'
31 );
32 }
33
34 function bppiv_dashboard_page(){ ?>
35 <div
36 id='bppivCurrentDashboard'
37 data-info='<?php echo esc_attr( wp_json_encode( [
38 'version' => BPPIV_VERSION,
39 'isPremium' => false,
40 'hasPro' => false,
41 'adminUrl' => admin_url(),
42 'deleteDataOnUninstall' => (bool) get_option( 'bppiv_delete_data_on_uninstall', false ),
43 'uninstallNonce' => wp_create_nonce( 'bppiv_uninstall_nonce' ),
44 ] ) ); ?>'
45 ></div>
46 <?php }
47
48 function bppiv_adminEnqueueScripts( $screen ) {
49
50 if( $screen == 'bppiv-image-viewer_page_bppiv-support'){
51 wp_enqueue_style( 'current-admin-dashboard-style', BPPIV_PLUGIN_DIR . 'build/style-admin-dashboard.css', [], BPPIV_VERSION );
52 wp_enqueue_style( 'current-admin-dashboard', BPPIV_PLUGIN_DIR . 'build/admin-dashboard.css', [], BPPIV_VERSION );
53 wp_enqueue_script( 'current-admin-dashboard', BPPIV_PLUGIN_DIR . 'build/admin-dashboard.js', [ 'react', 'react-dom', 'wp-util' ], BPPIV_VERSION, true );
54 }
55
56 $current = function_exists('get_current_screen') ? get_current_screen() : null;
57 $post_type = $current && isset($current->post_type) ? $current->post_type : '';
58
59 if ( in_array( $post_type, ['bppiv-image-viewer', 'virtual_tour', 'product_spot', 'product'], true ) ) {
60 wp_enqueue_script('current-admin-post', BPPIV_PLUGIN_DIR . 'build/admin-post.js', [], BPPIV_VERSION, true);
61 wp_enqueue_style('current-admin-post', BPPIV_PLUGIN_DIR . 'build/admin-post.css', [], BPPIV_VERSION);
62 }
63 }
64
65
66
67
68
69
70
71
72
73
74
75