本文整理汇总了PHP中get_user_option函数的典型用法代码示例。如果您正苦于以下问题:PHP get_user_option函数的具体用法?PHP get_user_option怎么用?PHP get_user_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_user_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: register_tinymce_button
public function register_tinymce_button()
{
if ((current_user_can('edit_posts') || current_user_can('edit_pages')) && get_user_option('rich_editing') == 'true') {
add_filter("mce_external_plugins", array($this, "mce_external_plugins"));
add_filter("mce_buttons", array($this, "mce_buttons"));
}
}
示例2: run
public function run( $arguments ) {
$itsec_two_factor = new ITSEC_Two_Factor();
$two_factor_users = array();
$users = get_users();
foreach ( $users as $user ) {
$enabled = $itsec_two_factor->is_user_using_two_factor( $user->ID );
$override = intval( get_user_option( 'itsec_two_factor_override', $user->ID ) ) === 1 ? true : false;
$override_expires = intval( get_user_option( 'itsec_two_factor_override_expires', $user->ID ) );
if ( $enabled == 'on' ) {
$two_factor_users[$user->user_login] = array(
'ID' => $user->ID,
'user_login' => $user->user_login,
'override' => $override,
'override_expires' => $override_expires,
);
}
}
return $two_factor_users;
}
开发者ID:helloworld-digital,项目名称:insightvision,代码行数:27,代码来源:class-ithemes-sync-verb-itsec-get-two-factor-users.php
示例3: addTinyMCEButton
public function addTinyMCEButton()
{
if ((current_user_can('edit_posts') || current_user_can('edit_pages')) && get_user_option('rich_editing')) {
add_filter("mce_external_plugins", array($this, 'addTinyMCEPlugin'));
add_filter('mce_buttons', array($this, 'registerFormPicker'));
}
}
示例4: shortcodes_init
public function shortcodes_init()
{
if ((current_user_can('edit_posts') || current_user_can('edit_pages')) && get_user_option('rich_editing')) {
add_filter('mce_external_plugins', array(&$this, 'add_rich_plugins'));
add_filter('mce_buttons', array(&$this, 'register_rich_buttons'));
}
}
示例5: saasaparilla_load_admin_scripts
/**
* Load admin scripts
*
* @since 1.0.0
* @param string $hook The hook for the page we are viewing
* @global object $post The WordPress post object
* @global string $wp_version The WordPress version
* @return void
*/
function saasaparilla_load_admin_scripts($hook)
{
// Use minified libraries if SCRIPT_DEBUG is turned off
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
$js_dir = SAASAPARILLA_URL . 'assets/js/';
$css_dir = SAASAPARILLA_URL . 'assets/css/';
// Font must be loaded globally
wp_enqueue_style('saasaparilla-font', $css_dir . 'font' . $suffix . '.css', SAASAPARILLA_VER);
if (!apply_filters('saasaparilla_load_admin_scripts', saasaparilla_is_admin_page($hook), $hook)) {
return;
}
global $post, $wp_version;
wp_enqueue_script('saasaparilla', $js_dir . 'admin' . $suffix . '.js', array('jquery'), SAASAPARILLA_VER, false);
wp_localize_script('saasaparilla', 'saasaparilla_vars', array());
wp_enqueue_style('wp-color-picker');
wp_enqueue_script('wp-color-picker');
wp_enqueue_style('colorbox', $css_dir . 'colorbox' . $suffix . '.css', array(), '1.3.20');
wp_enqueue_script('colorbox', $js_dir . 'jquery.colorbox-min.js', array('jquery'), '1.3.20');
if (function_exists('wp_enqueue_media') && version_compare($wp_version, '3.5', '>=')) {
wp_enqueue_media();
}
wp_enqueue_script('jquery-ui-datepicker');
wp_enqueue_script('jquery-ui-dialog');
$ui_style = get_user_option('admin_color') == 'classic' ? 'classic' : 'fresh';
wp_enqueue_style('jquery-ui-css', $css_dir . 'jquery-ui-' . $ui_style . $suffix . '.css');
wp_enqueue_script('media-upload');
wp_enqueue_script('thickbox');
wp_enqueue_style('thickbox');
wp_enqueue_style('saasaparilla', $css_dir . 'saasaparilla' . $suffix . '.css', SAASAPARILLA_VER);
}
示例6: bogo_admin_enqueue_scripts
function bogo_admin_enqueue_scripts($hook_suffix)
{
if (false !== strpos($hook_suffix, 'bogo-tools') || 'widgets.php' == $hook_suffix || 'user-edit.php' == $hook_suffix) {
wp_enqueue_style('bogo-admin', plugins_url('admin/includes/css/admin.css', BOGO_PLUGIN_BASENAME), array(), BOGO_VERSION, 'all');
return;
}
if ('nav-menus.php' == $hook_suffix) {
$nav_menu_id = absint(get_user_option('nav_menu_recently_edited'));
$nav_menu_items = wp_get_nav_menu_items($nav_menu_id);
$locales = array();
foreach ((array) $nav_menu_items as $item) {
$locales[$item->db_id] = $item->bogo_locales;
}
$prefix = 'menu-item-bogo-locale';
wp_enqueue_script('bogo-admin', plugins_url('admin/includes/js/admin.js', BOGO_PLUGIN_BASENAME), array('jquery'), BOGO_VERSION, true);
wp_localize_script('bogo-admin', '_bogo', array('availableLanguages' => bogo_available_languages('orderby=value'), 'locales' => $locales, 'selectorLegend' => __('Displayed on pages in', 'bogo'), 'cbPrefix' => $prefix));
wp_enqueue_style('bogo-admin', plugins_url('admin/includes/css/admin.css', BOGO_PLUGIN_BASENAME), array(), BOGO_VERSION, 'all');
return;
}
if ('options-general.php' == $hook_suffix) {
wp_enqueue_script('bogo-admin', plugins_url('admin/includes/js/admin.js', BOGO_PLUGIN_BASENAME), array('jquery'), BOGO_VERSION, true);
wp_localize_script('bogo-admin', '_bogo', array('defaultLocale' => bogo_get_default_locale()));
return;
}
}
示例7: __construct
public function __construct(ContainerInterface $container)
{
parent::__construct($container);
if ($this instanceof WidgetInterface) {
add_action('widgets_init', array($this, 'registerWidgets'));
}
if ($this instanceof ShortcodeInterface) {
$this->registerShortcodes();
}
if ($this instanceof AjaxInterface) {
$this->registerAjaxHook();
}
if ($this instanceof TinyMceInterface) {
//add the tinyMce plugins for shortcode generator
//add_action('init', array($this, 'tinyMceInit'));
if (!current_user_can('edit_posts') && !current_user_can('edit_pages')) {
return;
}
if (get_user_option('rich_editing') == 'true') {
add_filter('mce_external_plugins', array($this, 'registerTinyMcePlugins'));
add_filter('mce_buttons', array($this, 'registerTinyMceButtons'));
}
}
return $this;
}
示例8: init
function init()
{
if (get_user_option('rich_editing') == 'true') {
add_filter('mce_buttons', array($this, 'register_buttons'), 1000);
add_filter('mce_external_plugins', array($this, 'add_buttons'));
}
}
示例9: get_customer
/**
* Get a Stripe customer object instance.
*
* @param integer $user_id If it's for an existing user; pass the user's ID (optional).
* @param string $email Customer's email address (optional).
* @param string $fname Customer's first name (optional).
* @param string $lname Customer's last name (optional).
* @param array $metadata Any metadata (optional).
*
* @return Stripe_Customer|string Customer object; else error message.
*/
public static function get_customer($user_id = 0, $email = '', $fname = '', $lname = '', $metadata = array())
{
$input_time = time();
// Initialize.
$input_vars = get_defined_vars();
// Arguments.
require_once dirname(__FILE__) . '/stripe-sdk/lib/Stripe.php';
Stripe::setApiKey($GLOBALS['WS_PLUGIN__']['optimizemember']['o']['pro_stripe_api_secret_key']);
try {
try {
if ($user_id && ($customer_id = get_user_option('optimizemember_subscr_cid', $user_id))) {
$customer = Stripe_Customer::retrieve($customer_id);
}
} catch (exception $exception) {
// Fail silently; create a new customer below in this case.
}
if (empty($customer) || !is_object($customer)) {
$customer = Stripe_Customer::create(array('email' => $email, 'description' => trim($fname . ' ' . $lname), 'metadata' => $metadata));
}
self::log_entry(__FUNCTION__, $input_time, $input_vars, time(), $customer);
return $customer;
// Stripe customer object.
} catch (exception $exception) {
self::log_entry(__FUNCTION__, $input_time, $input_vars, time(), $exception);
return self::error_message($exception);
}
}
示例10: blocks
/**
* put your comment there...
*
*/
public function blocks()
{
$defaultOrder = array();
// Upgrade all blocks.
foreach ($this->blocks as $index => $block) {
// In case the user is never re-ordered the blocks then
// the blocks order is not saved in the meta table
// however use the blocks order instead!
$defaultOrder[] = 'cjtoolbox-' . ($index + 1);
// No customization neede, just upgrade!
$this->blocks->upgrade();
}
// Process DB Driver queue!
$this->blocks->model->save();
// Version 0.2 and 0.3 use wrong algorithm for saving blocks order!
// Every version has its owen blocks order however the orders is not used to output the blocks!
// Version 1.0 still has argument about this but for simplification sake and for time save
// We just get orders from current runnign user! This is not 100% correct but we just need to advice
// to install the Plugin using the same author you need to inherits the order from!
$blocksPageSlug = CJTPlugin::PLUGIN_REQUEST_ID;
// Get current logged-in user order!
$order = get_user_option("meta-box-order_settings_page_{$blocksPageSlug}");
// Save it into GLOBAL/SHARED option to centralized all users!
if (!$order && !empty($defaultOrder)) {
$order = array('normal' => implode(',', $defaultOrder));
}
$this->blocks->model->setOrder($order);
// Sync closed block metaboxes!
$closedBlocks = get_user_meta(get_current_user_id(), "closedpostboxes_settings_page_{$blocksPageSlug}", true);
update_user_meta(get_current_user_id(), "closedpostboxes_{$blocksPageSlug}", $closedBlocks);
return true;
}
示例11: button_hooks
/**
* Load the plugin and register the buttons
*/
public function button_hooks()
{
if ((current_user_can('edit_posts') || current_user_can('edit_pages')) && get_user_option('rich_editing')) {
add_filter('mce_external_plugins', array($this, 'add_tinymce_plugin'));
add_filter('mce_buttons', array($this, 'register_buttons'));
}
}
示例12: add_mce_external_plugins
function add_mce_external_plugins()
{
// ビジュアルリッチエディタの場合
if (get_user_option('rich_editing') == 'true') {
add_filter("mce_external_plugins", array($this, "mce_external_plugins"));
}
}
示例13: eventorganiser_register_scripts
/**
*Register jQuery scripts and CSS files for admin
*
* @since 1.0.0
* @ignore
* @access private
*/
function eventorganiser_register_scripts()
{
$version = defined('EVENT_ORGANISER_VER') ? EVENT_ORGANISER_VER : false;
$ext = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
/* Venue scripts for venue & event edit */
wp_register_script('eo_venue', EVENT_ORGANISER_URL . "js/venues{$ext}.js", array('jquery', 'eo_GoogleMap'), $version, true);
/* Script for event edit page */
wp_register_script('eo-time-picker', EVENT_ORGANISER_URL . "js/time-picker{$ext}.js", array('jquery', 'jquery-ui-datepicker'), $version, true);
wp_register_script('eo_event', EVENT_ORGANISER_URL . "js/event{$ext}.js", array('jquery', 'jquery-ui-datepicker', 'eo-time-picker', 'jquery-ui-autocomplete', 'jquery-ui-widget', 'jquery-ui-position'), $version, true);
wp_register_script('eo-edit-event-controller', EVENT_ORGANISER_URL . "js/edit-event-controller{$ext}.js", array('jquery', 'eo_event'), $version, true);
/* Script for admin calendar */
wp_register_script('eo_calendar', EVENT_ORGANISER_URL . "js/admin-calendar{$ext}.js", array('eo_fullcalendar', 'jquery-ui-datepicker', 'jquery-ui-autocomplete', 'jquery-ui-widget', 'jquery-ui-dialog', 'jquery-ui-tabs', 'jquery-ui-position'), $version, true);
/* Pick and register jQuery UI style */
$style = 'classic' == get_user_option('admin_color') ? 'classic' : 'fresh';
wp_register_style('eventorganiser-jquery-ui-style', EVENT_ORGANISER_URL . "css/eventorganiser-admin-{$style}.css", array(), $version);
/* Admin styling */
wp_register_style('eventorganiser-3.8+', EVENT_ORGANISER_URL . 'css/eventorganiser-admin-3.8+.css', array(), $version);
$deps = array('eventorganiser-jquery-ui-style');
if (defined('MP6') && MP6 || version_compare('3.8-beta-1', get_bloginfo('version')) <= 0) {
$deps[] = 'eventorganiser-3.8+';
}
wp_register_style('eventorganiser-style', EVENT_ORGANISER_URL . 'css/eventorganiser-admin-style.css', $deps, $version);
/* Inline Help */
wp_register_script('eo-inline-help', EVENT_ORGANISER_URL . 'js/inline-help.js', array('jquery', 'eo_qtip2'), $version, true);
}
示例14: step
public function step()
{
$exported_subs = get_user_option(get_current_user_id(), 'nf_download_all_subs_ids');
if (!is_array($exported_subs)) {
$exported_subs = array();
}
$previous_name = get_user_option(get_current_user_id(), 'nf_download_all_subs_filename');
if ($previous_name) {
$this->args['filename'] = $previous_name;
}
$args = array('posts_per_page' => 250, 'paged' => $this->step, 'post_type' => 'nf_sub', 'meta_query' => array(array('key' => '_form_id', 'value' => $this->args['form_id'])));
$subs_results = get_posts($args);
if (is_array($subs_results) && !empty($subs_results)) {
$upload_dir = wp_upload_dir();
$file_path = trailingslashit($upload_dir['path']) . $this->args['filename'] . '.csv';
$myfile = fopen($file_path, 'a') or die('Unable to open file!');
$x = 0;
$export = '';
foreach ($subs_results as $sub) {
$sub_export = Ninja_Forms()->sub($sub->ID)->export(true);
if ($x > 0 || $this->step > 1) {
$sub_export = substr($sub_export, strpos($sub_export, "\n") + 1);
}
if (!in_array($sub->ID, $exported_subs)) {
$export .= $sub_export;
$exported_subs[] = $sub->ID;
}
$x++;
}
fwrite($myfile, $export);
fclose($myfile);
}
update_user_option(get_current_user_id(), 'nf_download_all_subs_ids', $exported_subs);
}
示例15: init
/**
* Register button filters and actions
*/
function init()
{
global $pagenow;
// we need to test that we are in the admin section bewfore we add the button to tinyMCE
if ($pagenow != 'index.php') {
// Don't bother adding the button if the current user lacks permissions
$user_level_for_editor = apply_filters('aa_user_level_for_editor', 'edit_posts');
if (current_user_can($user_level_for_editor) || current_user_can($user_level_for_editor)) {
// Add only in Rich Editor mode
if (get_user_option('rich_editing') == 'true') {
add_filter('mce_external_plugins', array(&$this, 'add_tinymce_plugin'));
add_filter('mce_buttons', array(&$this, 'add_tinymce_button'));
}
// In wordpress < 2.7 only the POST parameter "action" is used in admin-ajax.php
// but we're using the GET parameter for the tinymce popup iframe, therefore manually
// set the POST parameter for the popup calls.
if (defined('DOING_AJAX') && DOING_AJAX == true) {
$p = 'author-avatars-editor-popup';
$action = isset($_GET['action']) ? $_GET['action'] : null;
if ($action == $p && !isset($_POST['action'])) {
$_POST['action'] = $action;
}
}
}
}
}