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 }
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 }
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 }
/** * 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]; }
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); } } }
/** * 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 }
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 echo esc_attr($login_image_size); ?> " /> <input type="hidden" name="wp_login_image_width" id="wp_login_image_width" value="<?php echo esc_attr($login_image_width); ?> " /> <input type="hidden" name="wp_login_image_height" id="wp_login_image_height" value="<?php echo esc_attr($login_image_height); ?> " /> </div> </div> </div> <?php }
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 }
/** * 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; } }
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; } } } } } }
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 . '" />'; } }
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 }
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))); } }
function get_ub_activated_modules() { return ub_get_option('ultimatebranding_activated_modules', array()); }
<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>
function global_footer_content_site_admin_options() { // footer content $global_footer_content = ub_get_option('global_footer_content'); if ( $global_footer_content == 'empty' ) { $global_footer_content = ''; } // footer background color $global_footer_bgcolor = ub_get_option('global_footer_bgcolor', ""); // fixed height $global_footer_fixedheight = ub_get_option('global_footer_fixedheight', ""); ?> <div class="postbox"> <h3 class="hndle" style='cursor:auto;'><span><?php echo is_multisite() ? __( 'Global Footer Content For Subsites', 'ub' ) : __( 'Global Footer Content', 'ub' ) ?></span></h3> <div class="inside"> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Footer Content', 'ub') ?></th> <td> <?php $args = array("textarea_name" => "ub_global_footer[content]", "textarea_rows" => 5); wp_editor( stripslashes( $global_footer_content ), "global_footer_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, terms of service links, etc.', 'ub') ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Background Color', 'ub') ?></th> <td> <input name="ub_global_footer[bgcolor]" class="ub_color_picker" id="ub_footer_background_color" type="text" value="<?php echo $global_footer_bgcolor; ?>"/> <br /> <?php _e("Click on 'clear' button to make background transparent", 'ub') ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Fixed Height', 'ub') ?></th> <td> <input class="text-60" name="ub_global_footer[fixedheight]" id="ub_footer_fixedheight" type="number" step="1" value="<?php echo $global_footer_fixedheight; ?>"/> px <br /> <?php _e('Choose height of footer. Leave blank to fit height to content', 'ub') ?> </td> </tr> </table> </div> </div> <?php if( ( is_multisite() && is_super_admin() )): $global_footer_main_content = ub_get_option('global_footer_main_content', ""); $global_footer_main_bgcolor = ub_get_option('global_footer_main_bgcolor', ""); $global_footer_main_fixedheight = ub_get_option('global_footer_main_fixedheight', ""); if ( $global_footer_main_content == 'empty' ) { $global_footer_main_content = ''; } ?> <div class="postbox"> <h3 class="hndle" style='cursor:auto;'><span><?php _e( 'Global Footer Content For Main Site', 'ub' ) ?></span></h3> <div class="inside"> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Footer Content', 'ub') ?></th> <td> <?php $args = array("textarea_name" => "ub_global_footer_main[content]", "textarea_rows" => 5); wp_editor( stripslashes( $global_footer_main_content ), "global_footer_main_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, terms of service links, etc.', 'ub') ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Background Color', 'ub') ?></th> <td> <input name="ub_global_footer_main[bgcolor]" class="ub_color_picker" id="ub_footer_main_background_color" type="text" value="<?php echo $global_footer_main_bgcolor; ?>"/> <br /> <?php _e("Click on 'clear' button to make background transparent", 'ub') ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Fixed Height', 'ub') ?></th> <td> <input class="text-60" name="ub_global_footer_main[fixedheight]" id="ub_footer_main_fixedheight" type="number" step="1" value="<?php echo $global_footer_main_fixedheight; ?>"/> px <br /> <?php _e('Choose height of footer. Leave blank to fit height to content', 'ub') ?> </td> </tr> </table> </div> </div> <?php endif; ?> <?php }
function ub_remove_wp_dashboard_widgets() { global $wp_meta_boxes; $active = ub_get_option('rwp_active_dashboard_widgets', array()); foreach ($active as $key => $value) { switch ($key) { case 'dashboard_browser_nag': case 'dashboard_right_now': case 'dashboard_recent_comments': case 'dashboard_incoming_links': case 'dashboard_plugins': remove_meta_box($key, 'dashboard', 'normal'); break; case 'dashboard_quick_press': case 'dashboard_recent_drafts': case 'dashboard_primary': case 'dashboard_secondary': remove_meta_box($key, 'dashboard', 'side'); break; } } }
function ub_get_option_value($key) { $ub_admin_menu_options = ub_get_option('ub_admin_menu'); if (isset($ub_admin_menu_options[$key])) { return ( $ub_admin_menu_options[$key] ); } }
/** * Gets appropriate options. * If the old options are still around, attempt to convert them to new format. */ private function _get_options () { $opts = ub_get_option('admin_help_content'); $opts = is_array($opts) ? $opts : array( 'tabs' => array( array( 'title' => __('Admin Help', 'ub'), 'content' => ($opts ? $opts : __($this->_default_text, 'ub') ), ), ), 'sidebar' => '', 'prevent_network' => false, 'merge_panels' => false, ); return $opts; }
function manage_output() { global $wpdb, $current_site, $page; if (isset($_GET['error'])) { echo '<div id="message" class="error fade"><p>' . __('There was an error uploading the file, please try again.', 'ub') . '</p></div>'; } elseif (isset($_GET['updated'])) { echo '<div id="message" class="updated fade"><p>' . __('Changes saved.', 'ub') . '</p></div>'; } $uploaddir = ub_wp_upload_dir(); $uploadurl = ub_wp_upload_url(); $login_image_dir = ub_get_option('ub_login_image_dir', false); $login_image_url = ub_get_option('ub_login_image_url', false); // Check for backwards compatibility if (!$login_image_dir && file_exists($uploaddir . '/ultimate-branding/includes/login-image/login-form-image.png')) { ub_update_option('ub_login_image_dir', $uploaddir . '/ultimate-branding/includes/login-image/login-form-image.png'); ub_update_option('ub_login_image_url', $uploadurl . '/ultimate-branding/includes/login-image/login-form-image.png'); $login_image_dir = ub_get_option('ub_login_image_dir', false); $login_image_url = ub_get_option('ub_login_image_url', false); } ?> <div class="postbox"> <h3 class="hndle" style='cursor:auto;'><span><?php _e('Login Image', 'ub'); ?> </span></h3> <div class="inside"> <p class='description'><?php _e('This is the image that is displayed on the login page (wp-login.php) - ', 'ub'); ?> <a href='<?php echo wp_nonce_url("?page=" . $page . "&tab=images&reset=yes&action=process", 'ultimatebranding_settings_menu_images'); ?> '><?php _e('Reset the image', 'ub'); ?> </a> </p> <?php if ($login_image_dir && file_exists($login_image_dir)) { $login_image_url = preg_replace(array('/http:/i', '/https:/i'), '', $login_image_url); echo '<img src="' . $login_image_url . '?' . md5(time()) . '" />'; } else { echo '<img src="' . site_url('wp-admin/images/wordpress-logo.png') . '" />'; } ?> </p> <h4><?php _e('Change Image', 'login_image'); ?> </h4> <p class='description'> <input type="hidden" name="MAX_FILE_SIZE" value="500000" /> <input name="login_form_image_file" id="login_form_image_file" size="20" type="file"> </p> <p class='description'><?php _e('Image must be 500KB maximum. It will be cropped to 310px wide and 70px tall. For best results use an image of this size. Allowed Formats: jpeg, gif, and png', 'ub'); ?> </p> <p class='description'><?php _e('Note that gif animations will not be preserved.', 'ub'); ?> </p> </div> </div> <?php }
function from_email_name($email) { return ub_get_option('ub_from_name', ub_get_option('blogname', ub_get_option('site_name'))); }
background: <?php echo ub_get_option('ucs_admin_active_theme_details_background_color', '#45B29D'); ?> ; text-shadow: none; } /* Thickbox: Plugin information */ #sidemenu a.current { background: <?php echo ub_get_option('ucs_background_color', '#f1f1f1'); ?> ; border-bottom-color: <?php echo ub_get_option('ucs_background_color', '#f1f1f1'); ?> ; } #plugin-information .action-button { background: <?php echo ub_get_option('ucs_admin_menu_background_color', '#45B29D'); ?> ; } .plugins .active th.check-column{ border-left: 4px solid <?php echo ub_get_option('ucs_admin_active_plugin_border_color', '#EFC94C'); ?> ; }
/** * Returns use as default option * If it's true it means that the main image is being used as default favicon for all sub-sites * * @since 1.8.1 * * @return bool */ private static function _use_as_default(){ return (bool) ub_get_option("ub_favicons_use_as_default", false); }
function site_generator_replacement_site_admin_options() { global $wpdb, $wp_roles, $current_user; $global_site_generator = ub_get_option("site_generator_replacement"); $global_site_link = ub_get_option("site_generator_replacement_link"); if (is_multisite()) { $current_site = get_current_site(); }else{ $current_site = new stdClass(); $current_site->site_name = get_bloginfo('name'); $current_site->domain = get_bloginfo('url'); $current_site->path = ''; } if (empty($global_site_generator)) { $global_site_generator = $current_site->site_name; } if (empty($global_site_link)) { $global_site_link = "http://" . $current_site->domain . $current_site->path; } ?> <div class="postbox"> <h3 class="hndle" style='cursor:auto;'><span><?php _e('Site Generator Options', 'ub') ?></span></h3> <div class="inside"> <table class="form-table"> <tr valign="top"> <th scope="row"> <?php _e('Generator Text', 'ub') ?> </th> <td> <input type="text" name="site_generator_replacement" id="site_generator_replacement" style="width: 95%" value="<?php echo stripslashes($global_site_generator); ?>" /> <?php _e('<br /><small>Change the "generator" information from WordPress to something you prefer.</small>', 'ub'); ?> </td> </tr> <tr valign="top"> <th scope="row"> <?php _e('Generator Link', 'ub') ?> </th> <td> <input type="text" name="site_generator_replacement_link" id="site_generator_replacement_link" style="width: 95%" value="<?php echo stripslashes($global_site_link); ?>" /> <?php _e('<br /><small>Change the "generator link" from WordPress to something you prefer.</small>', 'ub'); ?> </td> </tr> </table> </div> </div> <?php }
function ub_remove_wp_dashboard_widgets() { global $wp_meta_boxes, $wp_registered_widgets, $wp_registered_widget_controls, $wp_dashboard_control_callbacks; /* Detect active widgets and save the array (only possible from the dashboard page) */ $detected_widgets = array(); if (isset($wp_meta_boxes['dashboard']['normal']['core']) && is_array($wp_meta_boxes['dashboard']['normal']['core'])) { foreach (array_keys($wp_meta_boxes['dashboard']['normal']['core']) as $name) { $detected_widgets[$name] = $wp_meta_boxes['dashboard']['normal']['core'][$name]['title']; } } if (isset($wp_meta_boxes['dashboard']['normal']['low']) && is_array($wp_meta_boxes['dashboard']['normal']['low'])) { foreach (array_keys($wp_meta_boxes['dashboard']['normal']['low']) as $name) { $detected_widgets[$name] = $wp_meta_boxes['dashboard']['normal']['low'][$name]['title']; } } if (isset($wp_meta_boxes['dashboard']['normal']['high']) && is_array($wp_meta_boxes['dashboard']['normal']['high'])) { foreach (array_keys($wp_meta_boxes['dashboard']['normal']['high']) as $name) { $detected_widgets[$name] = $wp_meta_boxes['dashboard']['normal']['high'][$name]['title']; } } if (isset($wp_meta_boxes['dashboard']['side']['core']) && is_array($wp_meta_boxes['dashboard']['side']['core'])) { foreach (array_keys($wp_meta_boxes['dashboard']['side']['core']) as $name) { $detected_widgets[$name] = $wp_meta_boxes['dashboard']['side']['core'][$name]['title']; } } if (isset($wp_meta_boxes['dashboard']['side']['low']) && is_array($wp_meta_boxes['dashboard']['side']['low'])) { foreach (array_keys($wp_meta_boxes['dashboard']['side']['low']) as $name) { $detected_widgets[$name] = $wp_meta_boxes['dashboard']['side']['low'][$name]['title']; } } if (isset($wp_meta_boxes['dashboard']['side']['high']) && is_array($wp_meta_boxes['dashboard']['side']['high'])) { foreach (array_keys($wp_meta_boxes['dashboard']['side']['high']) as $name) { $detected_widgets[$name] = $wp_meta_boxes['dashboard']['side']['high'][$name]['title']; } } ub_update_option('ub_rwp_all_active_dashboard_widgets', $detected_widgets); $active = ub_get_option('rwp_active_dashboard_widgets', array()); foreach ($active as $key => $value) { remove_meta_box($key, 'dashboard', 'normal'); remove_meta_box($key, 'dashboard', 'side'); } }
.theme-browser .theme.active .theme-name, .theme-browser .theme.add-new-theme:hover:after { background: <?php echo ub_get_option('ucs_admin_active_theme_background_color', '#334D5C');?>; } .theme-browser .theme.add-new-theme:hover span:after { color: <?php echo ub_get_option('ucs_admin_active_theme_background_color', '#334D5C');?>; } .theme-overlay .theme-header .close:hover, .theme-overlay .theme-header .right:hover, .theme-overlay .theme-header .left:hover { background: <?php echo ub_get_option('ucs_admin_active_theme_background_color', '#334D5C');?>; } .theme-browser .theme.active .theme-actions{ background: <?php echo ub_get_option('ucs_admin_active_theme_actions_background_color', '#45B29D');?>; } .theme-browser .theme .more-details{ background: <?php echo ub_get_option('ucs_admin_active_theme_details_background_color', '#45B29D');?>; text-shadow: none; } /* Thickbox: Plugin information */ #sidemenu a.current { background: <?php echo ub_get_option('ucs_background_color', '#f1f1f1'); ?>; border-bottom-color: <?php echo ub_get_option('ucs_background_color', '#f1f1f1'); ?>; } #plugin-information .action-button { background: <?php echo ub_get_option('ucs_admin_menu_background_color', '#45B29D'); ?>; } .plugins .active th.check-column{ border-left: 4px solid <?php echo ub_get_option('ucs_admin_active_plugin_border_color', '#EFC94C'); ?>; }
/** * Removes selected default menus from admin bar * * @since 1.0 * @access public * * @return void */ function remove_menus_from_admin_bar() { global $wp_version, $current_user; $version = preg_replace('/-.*$/', '', $wp_version); if (version_compare($version, '3.3', '>=')) { global $wp_admin_bar; $wproles = ub_get_option("wdcab"); if( !is_user_logged_in() || !isset( $wproles['wp_menu_roles'] ) || ( isset( $wproles['wp_menu_roles'], $current_user ) && is_array( $wproles['wp_menu_roles'] ) && count( array_intersect( $wproles['wp_menu_roles'], (array) $current_user->roles) ) ) ) { $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); } } } }
/** * Renders settings page * * @since 1.0 */ function render_settings() { ?> <div class="postbox"> <h3 class="hndle" style='cursor:auto;'><span><?php _e('Custom Dashboard Welcome','ub'); ?></span></h3> <div class="inside"> <h2><?php _e( 'Custom message: ', 'ub' ); ?></h2> <?php echo wp_nonce_field("ub_save_custom_welcome_message", "custom_welcome_message") ?> <?php $args = array("textarea_name" => "custom_admin_welcome_message", "textarea_rows" => 9, "teeny" => true); wp_editor( stripslashes( ub_get_option("ub_custom_welcome_message") ) , "custom_admin_welcome_content", $args); ?> <p class='description'><?php _e( 'Leave empty to remove custom welcome widget', 'ub' ); ?></p> </div> </div> <?php }