本文整理汇总了PHP中NewsletterModule::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP NewsletterModule::__construct方法的具体用法?PHP NewsletterModule::__construct怎么用?PHP NewsletterModule::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NewsletterModule
的用法示例。
在下文中一共展示了NewsletterModule::__construct方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function __construct()
{
parent::__construct('subscription', '1.1.1');
add_action('wp_login', array($this, 'hook_wp_login'));
// Must be called after the Newsletter::hook_init, since some constants are defined
// there.
add_action('init', array($this, 'hook_init'), 90);
}
示例2: isset
function __construct()
{
// Grab it before a plugin decides to remove it.
$this->action = isset($_REQUEST['na']) ? $_REQUEST['na'] : '';
parent::__construct('subscription', '1.1.5');
add_action('wp_login', array($this, 'hook_wp_login'));
// Must be called after the Newsletter::hook_init, since some constants are defined
// there.
add_action('init', array($this, 'hook_init'), 90);
}
示例3: isset
function __construct()
{
// Grab it before a (stupid) plugin removes it.
$this->action = isset($_REQUEST['na']) ? $_REQUEST['na'] : '';
$this->themes = new NewsletterThemes('emails');
parent::__construct('emails', '1.1.1');
if (!is_admin() && !empty($this->action)) {
add_action('wp_loaded', array($this, 'hook_wp_loaded'));
}
}
示例4: list
function __construct()
{
global $wpdb;
parent::__construct('statistics', '1.1.0');
// Link tracking redirect
if (isset($_GET['nltr'])) {
list($email_id, $user_id, $url, $anchor) = explode(';', base64_decode($_GET['nltr']), 4);
$wpdb->insert(NEWSLETTER_STATS_TABLE, array('email_id' => $email_id, 'user_id' => $user_id, 'url' => $url, 'anchor' => $anchor, 'ip' => $_SERVER['REMOTE_ADDR']));
header('Location: ' . $url);
die;
}
// Open tracking image
if (isset($_GET['noti'])) {
list($email_id, $user_id) = explode(';', base64_decode($_GET['noti']), 2);
$wpdb->insert(NEWSLETTER_STATS_TABLE, array('email_id' => $email_id, 'user_id' => $user_id, 'ip' => $_SERVER['REMOTE_ADDR']));
header('Content-Type: image/gif');
echo base64_decode('_R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');
die;
}
}
示例5: time
function __construct()
{
$this->time_start = time();
// Here because the upgrade is called by the parent constructor and uses the scheduler
add_filter('cron_schedules', array($this, 'hook_cron_schedules'), 1000);
parent::__construct('main', '1.2.2');
$max = $this->options['scheduler_max'];
if (!is_numeric($max)) {
$max = 100;
}
$this->max_emails = max(floor($max / 12), 1);
add_action('init', array($this, 'hook_init'));
add_action('newsletter', array($this, 'hook_newsletter'), 1);
add_action('newsletter_extension_versions', array($this, 'hook_newsletter_extension_versions'), 1);
// This specific event is created by "Feed by mail" panel on configuration
add_action('shutdown', array($this, 'hook_shutdown'));
if (defined('DOING_CRON') && DOING_CRON) {
$calls = get_option('newsletter_diagnostic_cron_calls', array());
if (empty($calls)) {
add_option('newsletter_diagnostic_cron_calls', $calls, null, 'no');
}
$calls[] = time();
if (count($calls) > self::MAX_CRON_SAMPLES) {
array_shift($calls);
}
update_option('newsletter_diagnostic_cron_calls', $calls);
return;
}
// TODO: Meditation on how to use those ones...
register_activation_hook(__FILE__, array($this, 'hook_activate'));
//register_deactivation_hook(__FILE__, array(&$this, 'hook_deactivate'));
add_action('admin_init', array($this, 'hook_admin_init'));
add_action('wp_head', array($this, 'hook_wp_head'));
add_shortcode('newsletter_lock', array($this, 'shortcode_newsletter_lock'));
add_filter('the_content', array($this, 'hook_the_content'), 99);
//add_shortcode('newsletter_profile', array($this, 'shortcode_newsletter_profile'));
if (is_admin()) {
add_action('admin_head', array($this, 'hook_admin_head'));
// Protection against strange schedule removal on some installations
if (!wp_next_scheduled('newsletter') && !defined('WP_INSTALLING')) {
wp_schedule_event(time() + 30, 'newsletter', 'newsletter');
}
}
}
示例6: NewsletterThemes
function __construct()
{
$this->themes = new NewsletterThemes('emails');
parent::__construct('emails', '1.1.2');
add_action('wp_loaded', array($this, 'hook_wp_loaded'));
}
示例7:
function __construct()
{
parent::__construct('users', '1.0.4');
}
示例8: array
function __construct()
{
global $wpdb;
parent::__construct('statistics', '1.1.4');
add_action('wp_loaded', array($this, 'hook_wp_loaded'));
}
示例9: array
function __construct()
{
parent::__construct('wp', '1.0.1');
add_action('init', array($this, 'hook_init'), 90);
}
示例10: NewsletterThemes
function __construct()
{
$this->themes = new NewsletterThemes('emails');
parent::__construct('emails', '1.1.1');
}