-
Notifications
You must be signed in to change notification settings - Fork 0
/
ionic-user-push.php
44 lines (33 loc) · 2.02 KB
/
ionic-user-push.php
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
<?php
/*
Plugin Name: Ionic User Push Notification
Plugin URI: https://github.com/rintynator/wp-ionic-user-push
Description: Send push notifications to ionic users
Version: 1.1
Author: Thorsten Rintelen
Author URI: http://www.clever-code.de
License: GPLv2
*/
/*
Copyright (C) 2016 Thorsten Rintelen (E-Mail: [email protected])
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
define( 'IUP_PLUGIN_DIR_PATH', plugin_dir_path( __FILE__ ) );
require_once IUP_PLUGIN_DIR_PATH . 'includes/class-iup.php';
require_once IUP_PLUGIN_DIR_PATH . 'includes/class-iup-send-push.php';
register_activation_hook( __FILE__, array( 'Ionic_User_Push', 'plugin_activation' ) );
if ( is_admin() ) {
require_once IUP_PLUGIN_DIR_PATH . 'includes/class-iup-admin.php';
add_action('admin_menu', array( 'Ionic_User_Push_Admin', 'admin_menu' ));
function load_custom_wp_admin_style() {
wp_register_style( 'custom_wp_admin_css', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', false, '1.0.0' );
wp_enqueue_style( 'custom_wp_admin_css' );
}
add_action( 'admin_enqueue_scripts', 'load_custom_wp_admin_style' );
add_action( 'transition_post_status', array( 'Ionic_User_Send_Push', 'send_push_for_new_post'), 2, 3);
} else {
require_once IUP_PLUGIN_DIR_PATH . 'includes/class-iup-userId-manager.php';
add_action( 'init', array( 'Ionic_User_Push', 'process_parameter') );
}