/** * Sets the recipient mode of the API call to either `single` or `all` based on the audience we want to send the * push notification to. * * Note: if the recipient mode is set to `single`, we require a device token to be set with `set_device_token`. * * @param string $mode * @return bool */ public static function set_recipient_mode($mode = 'all') { if ($mode !== 'all' && $mode !== 'single') { return false; } self::$_recipient_mode = $mode; return true; }
<?php /** * Plugin Name: PushUp Notifications * Plugin URI: http://pushupnotifications.com * Description: Desktop push notifications for your WordPress powered website, starting with OS X Mavericks. * Version: 1.2.2 * Author: 10up * Author URI: http://10up.com * License: GPLv2 or later */ // Exit if accessed directly if (!defined('ABSPATH')) { exit; } // Include classes require_once plugin_dir_path(__FILE__) . 'includes/class-core.php'; require_once plugin_dir_path(__FILE__) . 'includes/class-json-api.php'; require_once plugin_dir_path(__FILE__) . 'includes/class-authentication.php'; require_once plugin_dir_path(__FILE__) . 'includes/class-push-notifications.php'; // Instantiate objects PushUp_Notifications_Core::instance(); PushUp_Notifications_JSON_API::instance(); PushUp_Notifications_Authentication::instance(); PushUp_Notifications::instance();