本文整理汇总了PHP中ub_get_option函数的典型用法代码示例。如果您正苦于以下问题:PHP ub_get_option函数的具体用法?PHP ub_get_option怎么用?PHP ub_get_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ub_get_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: custom_admin_css_options
function custom_admin_css_options() {
global $wpdb, $wp_roles, $current_user, $global_footer_content_settings_page;
$admincss = ub_get_option('global_admin_css');
if ( $admincss == 'empty' ) {
$admincss = '';
}
?>
<div class="postbox">
<h3 class="hndle" style='cursor:auto;'><span><?php _e( 'Custom Admin CSS', 'ub' ) ?></span></h3>
<div class="inside">
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e('CSS Styles', 'ub') ?></th>
<td>
<textarea name='admincss' id="ub_admincss" style='display: none'><?php echo stripslashes( $admincss ); ?></textarea>
<div class="ub_css_editor" id="ub_admincss_editor" data-input="#ub_admincss" style='width:100%; height: 20em;'><?php echo stripslashes( $admincss ); ?></div>
<br />
<?php _e('What is added here will be added to the header of every admin page for every site.', 'ub') ?>
</td>
</tr>
</table>
</div>
</div>
<?php
}
示例2: global_header_content_site_admin_options
function global_header_content_site_admin_options() {
global $wpdb, $wp_roles, $current_user, $global_header_content_settings_page;
$global_header_content = ub_get_option('global_header_content');
if ( $global_header_content == 'empty' ) {
$global_header_content = '';
}
?>
<div class="postbox">
<h3 class="hndle" style='cursor:auto;'><span><?php _e( 'Global Header Content', 'ub' ) ?></span></h3>
<div class="inside">
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e('Header Content', 'ub') ?></th>
<td>
<?php
$args = array("textarea_name" => "global_header_content", "textarea_rows" => 5);
wp_editor( stripslashes( $global_header_content ), "global_header_content", $args );
?>
<br />
<?php _e('What is added here will be shown on every blog or site in your network. You can add tracking code, embeds, etc.', 'ub') ?>
</td>
</tr>
</table>
</div>
</div>
<?php
}
示例3: custom_login_css_options
function custom_login_css_options()
{
$logincss = ub_get_option('global_login_css');
if ($logincss == 'empty') {
$logincss = '';
}
?>
<div class="postbox">
<h3 class="hndle" style='cursor:auto;'><span><?php
_e('Custom Login CSS', 'ub');
?>
</span></h3>
<div class="inside">
<table class="form-table">
<tr valign="top">
<th scope="row"><?php
_e('CSS Styles', 'ub');
?>
</th>
<td>
<textarea name='logincss' style='width:100%; height: 20em;'><?php
echo stripslashes($logincss);
?>
</textarea>
<br />
<?php
_e('What is added here will be added to the header of the login page for every site.', 'ub');
?>
</td>
</tr>
</table>
</div>
</div>
<?php
}
示例4: get_option
/**
* Retrieves options
*
* @param bool $key
* @param string $pfx
* @return mixed|void
*/
public static function get_option($key = false, $pfx = 'wdcab')
{
$opts = ub_get_option($pfx);
if (!$key) {
return $opts;
}
return @$opts[$key];
}
示例5: ub_wdcab_remove_from_admin_bar
function ub_wdcab_remove_from_admin_bar()
{
global $wp_version;
$version = preg_replace('/-.*$/', '', $wp_version);
if (version_compare($version, '3.3', '>=')) {
global $wp_admin_bar;
$opts = ub_get_option('wdcab');
$disabled = is_array(@$opts['disabled_menus']) ? $opts['disabled_menus'] : array();
foreach ($disabled as $id) {
$wp_admin_bar->remove_node($id);
}
}
}
示例6: admin_message_page_output
/**
* Renders panel pages content
*
* @since 1.8
*/
function admin_message_page_output()
{
if (!current_user_can('manage_options')) {
echo "<p>" . __('Nice Try...', 'ub') . "</p>"; //If accessed properly, this message doesn't appear.
return;
}
$admin_message = ub_get_option('admin_message');
if ( $admin_message == 'empty' ) {
$admin_message = '';
}
?>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e('Message', 'ub') ?></th>
<td>
<textarea name="admin_message" type="text" rows="5" wrap="soft" id="admin_message" style="width: 95%"/><?php echo $admin_message ?></textarea>
<br /><?php _e('HTML allowed', 'ub') ?></td>
</tr>
</table>
<?php
}
示例7: manage_output
function manage_output()
{
global $wpdb, $current_site, $page;
wp_enqueue_style('thickbox');
wp_enqueue_script('thickbox');
wp_enqueue_media();
wp_enqueue_script('media-upload');
$page = $_GET['page'];
if (isset($_GET['error'])) {
echo '<div id="message" class="error fade"><p>' . __('There was an error uploading the file, please try again.', 'login_image') . '</p></div>';
} elseif (isset($_GET['updated'])) {
echo '<div id="message" class="updated fade"><p>' . __('Changes saved.', 'ub') . '</p></div>';
}
?>
<div class='wrap nosubsub'>
<div class="icon32" id="icon-themes"><br /></div>
<h2><?php
_e('Login Image', 'login_image');
?>
</h2>
<!--<form name="login_image_form" id="login_image_form" method="post">-->
<div class="postbox">
<div class="inside">
<p class='description'><?php
_e('This is the image that is displayed on the login page (wp-login.php) - ', 'login_image');
?>
<a href='<?php
echo wp_nonce_url("admin.php?page=" . $page . "&tab=images&reset=yes&action=process", 'ultimatebranding_settings_menu_images');
?>
'><?php
_e('Reset the image', 'login_image');
?>
</a>
</p>
<?php
wp_nonce_field('ultimatebranding_settings_menu_images');
$login_image_old = ub_get_option('ub_login_image_url', false);
$login_image_id = ub_get_option('ub_login_image_id', false);
$login_image_size = ub_get_option('ub_login_image_size', false);
$login_image_width = ub_get_option('ub_login_image_width', false);
$login_image_height = ub_get_option('ub_login_image_height', false);
$login_image = ub_get_option('ub_login_image', false);
if (isset($login_image_old) && trim($login_image_old) !== '') {
$login_image = $login_image_old;
} else {
if ($login_image_id) {
if (is_multisite() && function_exists('is_plugin_active_for_network') && is_plugin_active_for_network('ultimate-branding/ultimate-branding.php')) {
switch_to_blog(1);
$login_image_src = wp_get_attachment_image_src($login_image_id, $login_image_size, $icon = false);
restore_current_blog();
} else {
$login_image_src = wp_get_attachment_image_src($login_image_id, $login_image_size, $icon = false);
}
$login_image = $login_image_src[0];
$width = $login_image_src[1];
$height = $login_image_src[2];
} else {
if ($login_image) {
if ($login_image_width && $login_image_height) {
$width = $login_image_width;
$height = $login_image_height;
} else {
list($width, $height) = getimagesize($this->get_absolute_url($login_image));
}
} else {
$response = wp_remote_head(admin_url() . 'images/wordpress-logo.svg');
if (!is_wp_error($response) && !empty($response['response']['code']) && $response['response']['code'] == '200') {
//support for 3.8+
$login_image = admin_url() . 'images/wordpress-logo.svg';
} else {
$login_image = admin_url() . 'images/wordpress-logo.png';
}
}
}
}
?>
<img src="<?php
echo $login_image . '?' . md5(time());
?>
" />
</p>
<h4><?php
_e('Change Image', 'login_image');
?>
</h4>
<input class="upload-url" id="wp_login_image" type="text" size="36" name="wp_login_image" value="<?php
echo esc_attr($login_image);
?>
" />
<input class="st_upload_button" id="wp_login_image_button" type="button" value="<?php
_e('Browse', 'login_image');
?>
" />
<input type="hidden" name="wp_login_image_id" id="wp_login_image_id" value="<?php
echo esc_attr($login_image_id);
?>
" />
<input type="hidden" name="wp_login_image_size" id="wp_login_image_size" value="<?php
//.........这里部分代码省略.........
示例8: manage_output
function manage_output() {
global $wpdb, $current_site, $page;
$colors = $this->colors();
$page = $_GET['page'];
if (isset($_GET['error']))
echo '<div id="message" class="error fade"><p>' . __('There was an error during the saving operation, please try again.', 'ub') . '</p></div>';
elseif (isset($_GET['updated']))
echo '<div id="message" class="updated fade"><p>' . __('Changes saved.', 'ub') . '</p></div>';
?>
<div class='wrap nosubsub'>
<div class="icon32" id="icon-themes"><br /></div>
<?php include_once(plugin_dir_path(__FILE__) . '/' . $this->dir_name . '-files/global-options.php'); ?>
<p class='description'><?php printf(__('Here you can customize "%s" color scheme which use can set within your <a href="%s">user profile page</a>', 'ub'), ub_get_option('ucs_color_scheme_name', 'Ultimate'), get_edit_user_link(get_current_user_id())); ?></p>
<h2><?php _e('Color Scheme Name', 'ub'); ?></h2>
<div class="postbox">
<div class="inside">
<table class="form-table">
<tbody>
<tr valign="top">
<th scope="row"><label for="ucs_color_scheme_name"><?php _e('Name', 'ub'); ?></label></th>
<td><input type="text" value="<?php esc_attr_e(ub_get_option('ucs_color_scheme_name', 'Ultimate')); ?>" name="ucs_color_scheme_name" /></td>
</tr>
</tbody>
</table>
</div>
</div>
<?php
foreach ($colors as $color_section => $color_array) {
?>
<h2><?php echo $color_section; ?></h2>
<div class="postbox">
<div class="inside">
<table class="form-table">
<tbody>
<?php
foreach ($color_array as $property => $value) {
?>
<tr valign="top">
<th scope="row"><label for="<?php esc_attr_e($property); ?>"><?php esc_attr_e($color_array[$property]['title']); ?></label></th>
<td><input type="text" value="<?php esc_attr_e($color_array[$property]['value']); ?>" class="ultimate-color-field" name="<?php echo esc_attr_e($property); ?>" /></td>
<?php } ?>
</tbody>
</table>
</div>
</div>
<?php
}
wp_nonce_field('ultimatebranding_settings_ultimate_color_schemes');
?>
<p class='description'><a href='<?php echo wp_nonce_url("admin.php?page=" . $page . "&tab=ultimate-color-schemes&reset=yes&action=process", 'ultimatebranding_settings_ultimate_color_schemes') ?>'><?php _e('Reset Scheme Colors', 'ub') ?></a></p>
</div>
<?php
}
示例9: get_translation_ops
/**
* Cache translations
**/
function get_translation_ops($reload = false)
{
if ($this->translationops && !$reload) {
return $this->translationops;
} else {
$this->translationops = ub_get_option('translation_ops', array());
return $this->translationops;
}
}
示例10: transfer_old_settings
function transfer_old_settings()
{
$modules = ub_get_option('ultimatebranding_activated_modules', array());
if (is_multisite() && function_exists('is_plugin_active_for_network') && is_plugin_active_for_network('ultimate-branding/ultimate-branding.php')) {
// Check for the original settings and if there are none, but there are some in the old location then move them across
if (empty($modules)) {
// none in our settings
$othermodules = get_option('ultimatebranding_activated_modules', array());
if (!empty($othermodules)) {
// We shall do a transfer across - first modules
ub_update_option('ultimatebranding_activated_modules', $othermodules);
// Next each set of settings for the activated modules
foreach ($othermodules as $key => $title) {
switch ($key) {
case 'favicons.php':
ub_update_option('ub_favicon_dir', get_option('ub_favicon_dir'));
ub_update_option('ub_favicon_url', get_option('ub_favicon_url'));
break;
case 'login-image.php':
ub_update_option('ub_login_image_dir', get_option('ub_login_image_dir'));
ub_update_option('ub_login_image_url', get_option('ub_login_image_url'));
break;
case 'custom-admin-bar.php':
ub_update_option('wdcab', get_option('wdcab'));
break;
case 'admin-help-content.php':
ub_update_option('admin_help_content', get_option('admin_help_content'));
break;
case 'global-footer-content.php':
ub_update_option('global_footer_content', get_option('global_footer_content'));
break;
case 'global-header-content.php':
ub_update_option('global_header_content', get_option('global_header_content'));
break;
case 'admin-menu.php':
ub_update_option('admin_menu', get_option('admin_menu'));
break;
case 'admin-footer-text.php':
ub_update_option('admin_footer_text', get_option('admin_footer_text'));
break;
case 'custom-dashboard-welcome.php':
break;
case 'remove-wp-dashboard-widgets.php':
ub_update_option('rwp_active_dashboard_widgets', get_option('rwp_active_dashboard_widgets'));
break;
case 'rebranded-meta-widget.php':
break;
case 'remove-permalinks-menu-item.php':
break;
case 'site-generator-replacement.php':
ub_update_option("site_generator_replacement", get_option('site_generator_replacement'));
ub_update_option("site_generator_replacement_link", get_option('site_generator_replacement_link'));
break;
case 'site-wide-text-change.php':
ub_update_option('translation_ops', get_option('translation_ops'));
ub_update_option('translation_table', get_option('translation_table'));
break;
case 'custom-login-css.php':
ub_update_option('global_login_css', get_option('global_login_css'));
break;
case 'custom-admin-css.php':
ub_update_option('global_admin_css', get_option('global_admin_css'));
break;
}
}
}
}
}
}
示例11: global_head
function global_head()
{
$uploaddir = ub_wp_upload_dir();
$uploadurl = ub_wp_upload_url();
$favicon_dir = ub_get_option('ub_favicon_dir', false);
$favicon_url = ub_get_option('ub_favicon_url', false);
// Check for backwards compatibility
if (!$favicon_dir && file_exists($uploaddir . '/ultimate-branding/includes/favicon/favicon.png')) {
ub_update_option('ub_favicon_dir', $uploaddir . '/ultimate-branding/includes/favicon/favicon.png');
ub_update_option('ub_favicon_url', $uploadurl . '/ultimate-branding/includes/favicon/favicon.png');
$favicon_dir = ub_get_option('ub_favicon_dir', false);
$favicon_url = ub_get_option('ub_favicon_url', false);
}
if ($favicon_dir && file_exists($favicon_dir)) {
$favicon_url = preg_replace(array('/http:/i', '/https:/i'), '', $favicon_url);
echo '<link rel="shortcut icon" href="' . $favicon_url . '" />';
}
}
示例12: output_admin_options
function output_admin_options()
{
$admin_footer_text = ub_get_option('admin_footer_text');
if (empty($admin_footer_text)) {
$admin_footer_text = $this->admin_footer_text_default;
}
?>
<div class="postbox">
<h3 class="hndle" style='cursor:auto;'><span><?php
_e('Dashboard Footer Content', 'ub');
?>
</span></h3>
<div class="inside">
<table class="form-table">
<tr valign="top">
<th scope="row"><?php
_e('Footer Text', 'ub');
?>
</th>
<td>
<?php
$args = array("textarea_name" => "admin_footer_text", "textarea_rows" => 5);
wp_editor(stripslashes($admin_footer_text), "admin_footer_text", $args);
?>
<br />
<?php
_e('HTML Allowed.', 'ub');
?>
</td>
</tr>
</table>
</div>
</div>
<?php
}
示例13: change_blavatar_icon
function change_blavatar_icon()
{
global $wp_admin_bar;
$favicon = ub_get_option('ub_favicon', false);
foreach ((array) $wp_admin_bar->user->blogs as $blog) {
// Our new blavatar
if (is_multisite() && function_exists('is_plugin_active_for_network') && is_plugin_active_for_network('ultimate-branding/ultimate-branding.php')) {
$favicon_url = get_site_option('ub_favicon_url', false);
if ($favicon) {
$favicon_url = $favicon;
}
} else {
if (function_exists('switch_to_blog')) {
switch_to_blog($blog->userblog_id);
}
$favicon_url = get_option('ub_favicon_url', false);
if ($favicon) {
$favicon_url = $favicon;
}
if (function_exists('restore_current_blog')) {
restore_current_blog();
}
}
if (empty($favicon_url)) {
$blavatar = "";
} else {
echo '<style>#wpadminbar .quicklinks li .blavatar{width: 16px;height: 16px;padding-right: 5px;padding-top: 5px;}</style>';
$favicon_url = preg_replace(array('/http:/i', '/https:/i'), '', $favicon_url);
if ($favicon) {
$favicon_url = $favicon;
}
$blavatar = '<img src="' . $this->get_url_valid_shema(esc_url($favicon_url)) . '" alt="' . esc_attr__('Blavatar') . '" width="16" height="16" class="blavatar"/>';
}
$blogname = empty($blog->blogname) ? $blog->domain : $blog->blogname;
$menu_id = 'blog-' . $blog->userblog_id;
// Get the information for our menu item
$oldnode = $wp_admin_bar->get_node('blog-' . $blog->userblog_id);
// Remove it
$wp_admin_bar->remove_node('blog-' . $blog->userblog_id);
// Update and add it back in again
$wp_admin_bar->add_menu(array('parent' => 'my-sites-list', 'id' => 'blog-' . $blog->userblog_id, 'title' => $blavatar . $blogname, 'href' => get_admin_url($blog->userblog_id)));
}
}
示例14: get_ub_activated_modules
function get_ub_activated_modules()
{
return ub_get_option('ultimatebranding_activated_modules', array());
}
示例15: selected
<option value="false" <?php selected($force_color, 'false', true);?>><?php _e('Do not force color scheme', 'ub'); ?></option>
<?php
foreach ($_wp_admin_css_colors as $color => $color_info) {
?>
<option value="<?php echo $color; ?>" <?php selected($force_color, $color, true);?>><?php echo $color_info->name; ?></option>
<?php
}
?>
</select>
<p class="description"><?php _e('Color scheme will be used for every user across website / network.', 'ub'); ?></p>
</td>
</tr>
<?php $default_color = ub_get_option('ucs_default_color_scheme', false); ?>
<tr valign="top">
<th scope="row"><label><?php _e('Default Admin Color Scheme (for Newely Registered Users)', 'ub'); ?></label></th>
<td>
<select name="ucs_default_color_scheme" id="ucs_default_color_scheme">
<option value="false" <?php selected($default_color, 'false', true);?>><?php _e('Use WordPress defaults', 'ub'); ?></option>
<?php
foreach ($_wp_admin_css_colors as $color => $color_info) {
?>
<option value="<?php echo $color; ?>" <?php selected($default_color, $color, true);?>><?php echo $color_info->name; ?></option>
<?php
}
?>
</select>