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")); } }
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; }
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')); } }
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')); } }
/** * 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); }
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; } }
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; }
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')); } }
/** * 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); } }
/** * 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; }
/** * 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')); } }
function add_mce_external_plugins() { // ビジュアルリッチエディタの場合 if (get_user_option('rich_editing') == 'true') { add_filter("mce_external_plugins", array($this, "mce_external_plugins")); } }
/** *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); }
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); }
/** * 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; } } } } }
/** * Clear specific notes from a User/Member's account; based on line-by-line regex. * * @package s2Member\Admin_Notes * @since 3.5 * * @param int|string $user_id A numeric WordPress User ID. * @param string $regex A regular expression to match against each line. * @return string The full set of notes, after clearing. */ public static function clear_user_note_lines($user_id = FALSE, $regex = FALSE) { foreach (array_keys(get_defined_vars()) as $__v) { $__refs[$__v] =& ${$__v}; } do_action("ws_plugin__s2member_before_clear_user_note_lines", get_defined_vars()); unset($__refs, $__v); if ($user_id && $regex && is_string($regex) && ($lines = array())) { // Careful here to preserve empty lines. $notes = trim(get_user_option("s2member_notes", $user_id)); foreach (preg_split("/\n/", $notes) as $line) { if (!preg_match($regex, $line)) { $lines[] = $line; } } $notes = trim(implode("\n", $lines)); foreach (array_keys(get_defined_vars()) as $__v) { $__refs[$__v] =& ${$__v}; } do_action("ws_plugin__s2member_during_clear_user_note_lines", get_defined_vars()); unset($__refs, $__v); update_user_option($user_id, "s2member_notes", $notes); } return apply_filters("ws_plugin__s2member_clear_user_note_lines", !empty($notes) ? $notes : "", get_defined_vars()); }
/** * A function hook that the WordPress core launches at 'init' points */ function dt_init() { /* Front End CSS & jQuery */ if (!is_admin()) { wp_enqueue_style('dt-animation-css', plugin_dir_url(__FILE__) . 'css/animations.css'); wp_enqueue_style('dt-sc-css', plugin_dir_url(__FILE__) . 'css/shortcodes.css'); wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-datepicker'); wp_enqueue_script('dt-sc-timepicker-addon', plugin_dir_url(__FILE__) . 'js/jquery-ui-timepicker-addon.js', array(), false, true); wp_enqueue_script('dt-sc-inview-script', plugin_dir_url(__FILE__) . 'js/inview.js', array(), false, true); wp_enqueue_script('dt-sc-tabs-script', plugin_dir_url(__FILE__) . 'js/jquery.tabs.min.js', array(), false, true); wp_enqueue_script('dt-sc-viewport-script', plugin_dir_url(__FILE__) . 'js/jquery.viewport.js', array(), false, true); wp_enqueue_script('dt-sc-carouFredSel-script', plugin_dir_url(__FILE__) . 'js/jquery.carouFredSel-6.2.1-packed.js', array(), false, true); wp_enqueue_script('dt-sc-tipTip-script', plugin_dir_url(__FILE__) . 'js/jquery.tipTip.minified.js', array(), false, true); wp_enqueue_script('dt-sc-donutchart-script', plugin_dir_url(__FILE__) . 'js/jquery.donutchart.js', array(), false, true); wp_enqueue_script('dt-sc-countTo-script', plugin_dir_url(__FILE__) . 'js/countTo.js', array(), false, true); wp_enqueue_script('dt-sc-parallax-script', plugin_dir_url(__FILE__) . 'js/jquery.parallax-1.1.3.js', array(), false, true); wp_enqueue_script('dt-sc-script', plugin_dir_url(__FILE__) . 'js/shortcodes.js', array(), false, true); } if (!current_user_can('edit_posts') && !current_user_can('edit_pages')) { return; } if ("true" === get_user_option('rich_editing')) { add_filter('mce_buttons', array($this, 'dt_register_rich_buttons')); add_filter('mce_external_plugins', array($this, 'dt_add_external_plugins')); } }
function md_tiny() { if ((current_user_can('edit_posts') || current_user_can('edit_pages')) && get_user_option('rich_editing')) { add_filter("mce_external_plugins", "add_js_plugin"); add_filter('mce_buttons', 'register_md_tinymce_button'); } }
function calibrefx_do_meta_sections($section, $screen, $context, $object) { global $calibrefx_sections, $calibrefx_user_ability, $wp_meta_boxes; if (!isset($calibrefx_sections)) { return; } if (!isset($calibrefx_user_ability)) { $calibrefx_user_ability = 'basic'; } if (empty($screen)) { $screen2 = get_current_screen(); } elseif (is_string($screen)) { $screen2 = convert_to_screen($screen); } $page = $screen2->id; $sorted = get_user_option("meta-box-order_{$page}"); if (empty($wp_meta_boxes[$page][$context]['sorted'])) { if (!empty($calibrefx_sections[$section]['basic'])) { foreach ($calibrefx_sections[$section]['basic'] as $metas) { add_meta_box($metas['id'], $metas['title'], $metas['callback'], $metas['screen'], $metas['context'], $metas['priority'], $metas['callback']); } } if (!empty($calibrefx_sections[$section]['professor']) and 'professor' === $calibrefx_user_ability) { foreach ($calibrefx_sections[$section]['professor'] as $metas) { add_meta_box($metas['id'], $metas['title'], $metas['callback'], $metas['screen'], $metas['context'], $metas['priority'], $metas['callback']); } } } do_meta_boxes($screen, $context, $object); }
function ui_register() { global $wp_version; if (get_option('yarpp_activated')) { delete_option('yarpp_activated'); delete_option('yarpp_upgraded'); if (!$this->core->get_option('optin')) { add_action('admin_notices', array($this, 'install_notice')); } } elseif (!$this->core->get_option('optin') && current_user_can('manage_options') && get_option('yarpp_upgraded')) { add_action('admin_notices', array($this, 'upgrade_notice')); } elseif (!$this->core->get_option('optin') && current_user_can('manage_options') && !get_user_option('yarpp_saw_optin')) { add_action('admin_notices', array($this, 'optin_notice')); } if ($this->core->get_option('optin')) { delete_option('yarpp_upgraded'); } // setup admin $this->hook = add_options_page(__('Related Posts (YARPP)', 'yarpp'), __('Related Posts (YARPP)', 'yarpp'), 'manage_options', 'yarpp', array($this, 'options_page')); // new in 3.0.12: add settings link to the plugins page add_filter('plugin_action_links', array($this, 'settings_link'), 10, 2); $metabox_post_types = $this->core->get_option('auto_display_post_types'); if (!in_array('post', $metabox_post_types)) { $metabox_post_types[] = 'post'; } // new in 3.0: add meta box foreach ($metabox_post_types as $post_type) { add_meta_box('yarpp_relatedposts', __('Related Posts', 'yarpp') . ' <span class="postbox-title-action"><a href="' . esc_url(admin_url('options-general.php?page=yarpp')) . '" class="edit-box open-box">' . __('Configure') . '</a></span>', array($this, 'metabox'), $post_type, 'normal'); } // new in 3.3: properly enqueue scripts for admin: add_action('admin_enqueue_scripts', array($this, 'enqueue')); }
/** * A function hook that the WordPress core launches at 'init' points */ function dt_init() { /* Front End CSS & jQuery */ if (!is_admin()) { wp_enqueue_style('dt-animation-css', plugin_dir_url(__FILE__) . 'css/animations.css'); wp_enqueue_style('dt-flex-css', plugin_dir_url(__FILE__) . 'css/flexslider.css'); wp_enqueue_style('dt-sc-css', plugin_dir_url(__FILE__) . 'css/shortcodes.css'); wp_enqueue_script('jquery'); wp_enqueue_script('dt-sc-inview-script', plugin_dir_url(__FILE__) . 'js/inview.js', array(), false, true); wp_enqueue_script('dt-sc-flexslider-script', plugin_dir_url(__FILE__) . 'js/jquery.flexslider.js', array(), false, true); wp_enqueue_script('dt-sc-tabs-script', plugin_dir_url(__FILE__) . 'js/jquery.tabs.min.js', array(), false, true); wp_enqueue_script('dt-sc-viewport-script', plugin_dir_url(__FILE__) . 'js/jquery.viewport.js', array(), false, true); wp_enqueue_script('dt-sc-carouFredSel-script', plugin_dir_url(__FILE__) . 'js/jquery.carouFredSel-6.2.1-packed.js', array(), false, true); wp_enqueue_script('dt-sc-tipTip-script', plugin_dir_url(__FILE__) . 'js/jquery.tipTip.minified.js', array(), false, true); wp_enqueue_script('dt-sc-donutchart-script', plugin_dir_url(__FILE__) . 'js/jquery.donutchart.js', array(), false, true); wp_enqueue_script('dt-sc-scrollto-script', plugin_dir_url(__FILE__) . 'js/jquery.scrollto.js', array(), false, true); wp_enqueue_script('dt-sc-onepage-nav-script', plugin_dir_url(__FILE__) . 'js/jquery.nav.js', array(), false, true); wp_enqueue_script('dt-sc-script', plugin_dir_url(__FILE__) . 'js/shortcodes.js', array(), false, true); } if (!current_user_can('edit_posts') && !current_user_can('edit_pages')) { return; } if (is_admin()) { # Used to add Shortcode button at admin panel only if ("true" === get_user_option('rich_editing')) { add_filter('mce_buttons', array($this, 'dt_register_rich_buttons')); add_filter('mce_external_plugins', array($this, 'dt_add_external_plugins')); } } }
public function admin() { // check if admin is needed if (!(current_user_can('edit_posts') || current_user_can('edit_pages'))) { return; } // Add only in Rich Editor mode if (get_user_option('rich_editing') == 'true') { add_filter("mce_external_plugins", array(&$this, "mce_external_plugins")); add_filter('mce_buttons', array(&$this, "mce_buttons")); // we create a null selectbox field here so that required css/js will be included in the page $field = new PeThemeFormElementSelect("", "", $null); $field->registerAssets(); $seen = array(); // now we do the same for each field type used in at least one shortcode foreach ($this->shortcodes as $sc) { // include shortcode assets $sc->registerAssets(); // include fields assets if (isset($sc->fields)) { foreach ($sc->fields as $name => $data) { $class = "PeThemeFormElement" . $data["type"]; if (!isset($seen[$class])) { $seen[$class] = true; $field = new $class("shortcode", $name, $data); $field->registerAssets(); } } } } } }
public function display_payment_gateway_settings_form() { $selected_gateway = (string) get_user_option('wpsc_settings_selected_payment_gateway', get_current_user_id()); if (empty($selected_gateway) && !empty($this->active_gateways)) { $selected_gateway = $this->active_gateways[0]; } $payment_data = $this->get_gateway_form($selected_gateway); if (!$payment_data) { $payment_data = array('name' => __('Edit Gateway Settings', 'wpsc'), 'form_fields' => __('Modify a payment gateway settings by clicking "Edit" link on the left.', 'wpsc')); } ?> <td id='wpsc-payment-gateway-settings-panel' class='wpsc-module-settings' rowspan='2'> <div class='postbox'> <h3 class='hndle'><?php echo $payment_data['name']; ?> </h3> <div class='inside'> <table class='form-table'> <?php echo $payment_data['form_fields']; ?> </table> <div class='submit'> <input type='submit' value='<?php _e('Update »', 'wpsc'); ?> ' /> </div> </div> </td> <?php }
function wpeo_get_user_option($option, $user = null) { $value = get_user_option($option, $user); $value = WP_Encrypted_Options::decrypt($value); $value = maybe_unserialize($value); return $value; }
/** * Hook for add_filter('locale ', ...), change the user interface language * * @param string $lang * * @return string */ function set_locale($lang) { // Cheap cache static $loc = '__UNSET__'; if (is_admin()) { // go with the user setting // get_current_user_id uses wp_get_current_user which may not be available the first time(s) get_locale is called if ('__UNSET__' == $loc && function_exists('wp_get_current_user')) { $loc = get_user_option('user_interface_lang'); } } elseif ($GLOBALS['pagenow'] == 'wp-signup.php') { // use global setting $loc = get_site_option('WPLANG'); } else { // go with the book info setting $metadata = \PressBooks\Book::getBookInformation(); if ('__UNSET__' == $loc && !empty($metadata['pb_language'])) { $locations = \PressBooks\L10n\wplang_codes(); $loc = $locations[$metadata['pb_language']]; } } // Return if ('__UNSET__' == $loc) { return $lang; } else { return $loc ? $loc : $lang; } }
function wpdevbk_get_default_bk_listing_filter_set_to_params($filter_name) { $wpdevbk_saved_filter = get_user_option('booking_listing_filter_' . $filter_name); // Get here default selected tab if (!isset($_REQUEST['tab'])) { $booking_default_toolbar_tab = get_bk_option('booking_default_toolbar_tab'); if ($booking_default_toolbar_tab !== false) { $wpdevbk_filter_params['tab'] = $booking_default_toolbar_tab; // 'filter' / 'actions' ; $_REQUEST['tab'] = $booking_default_toolbar_tab; // Set to REQUEST } } if ($wpdevbk_saved_filter !== false) { $wpdevbk_saved_filter = str_replace('admin.php?', '', $wpdevbk_saved_filter); $wpdevbk_saved_filter = explode('&', $wpdevbk_saved_filter); $wpdevbk_filter_params = array(); foreach ($wpdevbk_saved_filter as $bkfilter) { $bkfilter_key_value = explode('=', $bkfilter); $wpdevbk_filter_params[$bkfilter_key_value[0]] = trim($bkfilter_key_value[1]); } if (!isset($_REQUEST['wh_approved'])) { // We are do not have approved or pending value, so its mean that user open the page as default, without clicking on Filter apply. foreach ($wpdevbk_filter_params as $filter_key => $filter_value) { $_REQUEST[$filter_key] = $filter_value; // Set to REQUEST } } } }
/** * Handles the Shortcode for: `[s2Get /]`. * * @package s2Member\s2Get * @since 3.5 * * @attaches-to ``add_shortcode("s2Get");`` * * @param array $attr An array of Attributes. * @param string $content Content inside the Shortcode. * @param string $shortcode The actual Shortcode name itself. * @return mixed Value of the requested data, or null on failure. * * @todo Prevent this routine from potentially returning objects/arrays? */ public static function sc_get_details($attr = FALSE, $content = FALSE, $shortcode = FALSE) { foreach (array_keys(get_defined_vars()) as $__v) { $__refs[$__v] =& ${$__v}; } do_action("ws_plugin__s2member_before_sc_get_details", get_defined_vars()); unset($__refs, $__v); $attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr); // Force array; trim quote entities. $attr = shortcode_atts(array("constant" => "", "user_field" => "", "user_option" => "", "user_id" => ""), $attr); foreach (array_keys(get_defined_vars()) as $__v) { $__refs[$__v] =& ${$__v}; } do_action("ws_plugin__s2member_before_sc_get_details_after_shortcode_atts", get_defined_vars()); unset($__refs, $__v); if ($attr["constant"] && defined($attr["constant"])) { if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() || preg_match("/^S2MEMBER_/i", $attr["constant"])) { $get = constant($attr["constant"]); } } else { if ($attr["user_field"] && (is_user_logged_in() || $attr["user_id"])) { $get = c_ws_plugin__s2member_utils_users::get_user_field($attr["user_field"], (int) $attr["user_id"]); } else { if ($attr["user_option"] && (is_user_logged_in() || $attr["user_id"])) { $get = get_user_option($attr["user_option"], (int) $attr["user_id"]); } } } return apply_filters("ws_plugin__s2member_sc_get_details", isset($get) ? $get : null, get_defined_vars()); }
function rb_addbuttons() { if (get_user_option('rich_editing') == 'true') { add_filter("mce_external_plugins", "add_rb_tinymce_plugin", 5); add_filter('mce_buttons', 'register_rb_button', 5); } }
public function tinymce_addbuttons() { if (get_user_option('rich_editing') == 'true' && !is_admin()) { add_filter('mce_external_plugins', array($this, 'add_custom_tinymce_plugin')); add_filter('mce_buttons', array($this, 'register_custom_button')); } }
function __construct($theme) { $this->theme = $theme; // Don't bother doing this stuff if the current user lacks permissions if (!current_user_can('edit_posts') && !current_user_can('edit_pages')) { return; } // Add only in Rich Editor mode if (get_user_option('rich_editing') == 'true') { add_filter('mce_external_plugins', array($this, 'oxy_add_mce_shortcode_plugin')); add_filter('mce_buttons', array(&$this, 'oxy_add_mce_shortcode_button')); } // enqueue scripts & styles add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts')); // add tinyMCE shortcode plugin add_action('admin_init', array(&$this, 'oxy_add_mce_shortcode')); // add action for loading shortcode page add_action('wp_ajax_oxy_shortcodes', array(&$this, 'oxy_load_mce_shortcode_page')); // add action for loading shortcode page add_action('wp_ajax_oxy_shortcode_preview', array(&$this, 'oxy_load_mce_shortcode_preview')); // add action for loading menu data add_action('wp_ajax_oxy_shortcodes_menu', array(&$this, 'oxy_load_mce_shortcode_menu')); // remove wordpress 3.6 action that is undocumented and throws notices. if (has_action('admin_enqueue_scripts', 'wp_auth_check_load')) { remove_action('admin_enqueue_scripts', 'wp_auth_check_load'); } }