-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautoloader-sample.php
55 lines (47 loc) · 1.5 KB
/
autoloader-sample.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
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* Plugin Name: NYCO Send Me NYC for WordPress
* Description: A developer plugin for WordPress that enables sharing website links via SMS or Email.
* Author: Blue State Digital, maintained by NYC Opportunity
* Text Domain: smnyc
*/
require plugin_dir_path(__FILE__) . '/wp-send-me-nyc/SendMeNYC.php';
/**
* Initialize plugin
*
* @author NYC Opportunity
*/
$contact = new SMNYC\ContactMe();
$sms = new SMNYC\SmsMe();
$email = new SMNYC\EmailMe();
/**
* New objects and their properties could be customized here. These
* would be passed along similarly to the 'init' and 'admin_init' actions.
*
* @author NYC Opportunity
*/
// $newSms = new SMNYC\SmsMe();
// $newSms->action = 'a_new_action_name';
// $newSms->prefix = 'a_new_options_prefix';
// $newSms->post_type = 'a-new-post-type';
/**
* Register post types for the email and SMS templates.
*
* @author NYC Opportunity
*/
add_action('init', function() use ($email, $sms) {
$email->registerPostType()->createEndpoints();
$sms->registerPostType()->createEndpoints();
});
/**
* SmsMe and EmailMe extend ContactMe. Each have settings that inherit some
* settings from ContactMe. ContactMe was created for any generic email client
* but EmailMe extends it for use with Amazon SES and adds additional settings.
* SmsMe creates the configuration and api for Twilio.
*
* @author NYC Opportunity
*/
add_action('admin_init', function() use ($contact, $sms, $email) {
$sms->createSettingsSection();
$email->createSettingsSection();
});