-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodals.php
More file actions
77 lines (63 loc) · 2.38 KB
/
Copy pathmodals.php
File metadata and controls
77 lines (63 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
* Plugin Name: Sceniber Modals
* Plugin URI: https://sjiassociates.com/
* Description: A lightweight Modal system built off of ACF.
* Author: Collin Berg
* Author URI: https://hirecollin.com
* Text Domain: sceniber-modals
* Domain Path: /languages
* Version: 1.0.0
*
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
require plugin_dir_path( __FILE__ ) .'includes/class-post-type.php';
require plugin_dir_path( __FILE__ ) .'includes/class-modal-post-type.php';
// Instantiate registration class, so we can add it as a dependency to main plugin class.
$post_type_registrations = new Modal_Post_Type_Registrations;
// Instantiate main plugin file, so activation callback does not need to be static.
$post_type = new Modal_Post_Type( $post_type_registrations );
// Register callback that is fired when the plugin is activated.
register_activation_hook( __FILE__, array( $post_type, 'activate' ) );
// Initialize registrations for post-activation requests.
$post_type_registrations->init();
if( function_exists('acf_add_local_field_group') ):
require plugin_dir_path( __FILE__ ) .'includes/class-modal-acf.php';
endif;
/**
* Adds styling to the dashboard
* to the "At a Glance" metabox.
*/
if ( is_admin() ) {
require(plugin_dir_path( __FILE__ ) . 'includes/class-post-type-admin.php');
$post_type_admin = new Modal_Post_Type_Admin( $post_type_registrations );
$post_type_admin->init();
}
/**
* Adds styling to the dashboard
* to the "At a Glance" metabox.
*/
function modal_files() {
//wp_enqueue_script( 'sceniber-modal', plugin_dir_url( __FILE__ ) . 'assets/js/Logic.js', array('jquery') );
wp_enqueue_script( 'jquery-cookie', 'https://cdn.jsdelivr.net/npm/js-cookie@rc/dist/js.cookie.min.js', array('jquery') );
wp_enqueue_style( 'sceniber-styles', plugin_dir_url( __FILE__ ) . 'assets/sce-modal.css');
}
add_action( 'wp_enqueue_scripts', 'modal_files' );
/**
* Adds styling to the dashboard
* to the "At a Glance" metabox.
*/
function sce_admin_styles() {
wp_enqueue_style( 'sceniber-admin_styles', plugin_dir_url( __FILE__ ) . 'assets/modal-admin.css');
}
add_action( 'admin_enqueue_scripts', 'sce_admin_styles' );
/**
* Modal Templates
*/
function sceniber_queue_modal() {
include( plugin_dir_path( __FILE__ ) . 'includes/modal-template.php');
}
add_action( 'wp_footer', 'sceniber_queue_modal' );