本文整理汇总了PHP中get_user_option函数的典型用法代码示例。如果您正苦于以下问题:PHP get_user_option函数的具体用法?PHP get_user_option怎么用?PHP get_user_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_user_option函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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"));
}
}
开发者ID:Nguyenkain,项目名称:strida.vn,代码行数:7,代码来源:tinymice.php
示例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'));
}
}
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:7,代码来源:jotform-wp-embed.php
示例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'));
}
}
开发者ID:codecookies,项目名称:cc-essentials,代码行数:7,代码来源:cce-shortcodes.php
示例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);
}
开发者ID:saivarunk,项目名称:SaaSaparilla,代码行数:39,代码来源:scripts.php
示例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;
}
}
开发者ID:karthikakamalanathan,项目名称:wp-cookieLawInfo,代码行数:25,代码来源:admin.php
示例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;
}
开发者ID:pop-code,项目名称:wordpresspluginframework,代码行数:25,代码来源:Controller.php
示例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'));
}
}
开发者ID:de190909,项目名称:WPTest,代码行数:7,代码来源:class-shortcodes.php
示例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);
}
}
开发者ID:JalpMi,项目名称:v2contact,代码行数:38,代码来源:stripe-utilities.inc.php
示例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;
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:36,代码来源:upgrade.class.php
示例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'));
}
}
开发者ID:diductio,项目名称:D,代码行数:10,代码来源:tinymce.php
示例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"));
}
}
开发者ID:kurozumi,项目名称:wp-do-shortcode,代码行数:7,代码来源:wp-do-shortcode.php
示例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);
}
开发者ID:windyjonas,项目名称:fredrika,代码行数:32,代码来源:event-organiser-register.php
示例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);
}
开发者ID:umairakhtar123,项目名称:hova,代码行数:34,代码来源:download-all-subs.php
示例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;
}
}
}
}
}
开发者ID:kosir,项目名称:thatcamp-org,代码行数:29,代码来源:AuthorAvatarsEditorButton.class.php
示例16: clear_user_note_lines
/**
* 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());
}
开发者ID:adnandot,项目名称:intenseburn,代码行数:35,代码来源:user-notes.inc.php
示例17: dt_init
/**
* 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'));
}
}
开发者ID:enlacee,项目名称:anb.platicom.com.pe,代码行数:30,代码来源:register-shortcodes.php
示例18: md_tiny
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');
}
}
开发者ID:Beutiste,项目名称:wordpress,代码行数:7,代码来源:tinymce-class.php
示例19: calibrefx_do_meta_sections
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);
}
开发者ID:alispx,项目名称:calibrefx,代码行数:30,代码来源:metabox-helper.php
示例20: ui_register
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'));
}
开发者ID:kristinakarnitskaya,项目名称:larkyonline,代码行数:32,代码来源:class-admin.php
注:本文中的get_user_option函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论