| 1 |
<?php |
| 2 |
|
| 3 |
$wp_adminify = new WP_Adminify(); |
| 4 |
define('WP_ADMINIFY', $wp_adminify->plugin_name); |
| 5 |
define('WP_ADMINIFY_VERSION', $wp_adminify->version); |
| 6 |
define('WP_ADMINIFY_PLUGIN_URL', $wp_adminify->wp_adminify_plugin_url()); |
| 7 |
define('WP_ADMINIFY_PLUGIN_DIR', $wp_adminify->wp_adminify_plugin_path()); |
| 8 |
define('WP_ADMINIFY_PLUGIN_DIR_URL', $wp_adminify->wp_adminify_plugin_dir_url()); |
| 9 |
define('WP_ADMINIFY_IMAGE_DIR', $wp_adminify->wp_adminify_plugin_dir_url() . '/assets/images/'); |
| 10 |
define('WP_ADMINIFY_TD', $wp_adminify->wp_adminify_load_textdomain()); // WP Adminify Text Domain |
| 11 |
define('WP_ADMINIFY_FILE', __FILE__); |
| 12 |
define('WP_ADMINIFY_DIR', dirname(__FILE__)); |
| 13 |
|
| 14 |
|
| 15 |
class WP_Adminify |
| 16 |
{ |
| 17 |
|
| 18 |
|
| 19 |
/* Variables */ |
| 20 |
public $version = '1.0.0'; |
| 21 |
public $author = "Liton Arefin"; |
| 22 |
private $plugin_path; |
| 23 |
private $plugin_url; |
| 24 |
private $plugin_slug; |
| 25 |
public $plugin_dir_url; |
| 26 |
public $plugin_name = 'WP Adminify'; |
| 27 |
|
| 28 |
private static $instance; |
| 29 |
|
| 30 |
/* Initialize */ |
| 31 |
public static function init() |
| 32 |
{ |
| 33 |
if (null === self::$instance) { |
| 34 |
self::$instance = new WP_Adminify(); |
| 35 |
} |
| 36 |
} |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
/* Construction Function */ |
| 41 |
public function __construct() |
| 42 |
{ |
| 43 |
|
| 44 |
$this->plugin_slug = 'wp-adminify'; |
| 45 |
$this->plugin_path = untrailingslashit(plugin_dir_path('/', __FILE__)); |
| 46 |
$this->plugin_url = untrailingslashit(plugins_url('/', __FILE__)); |
| 47 |
|
| 48 |
$this->wp_adminify_include_files(); |
| 49 |
$this->wp_adminify_define_admin_hooks(); |
| 50 |
} |
| 51 |
|
| 52 |
/* Load Text Domain */ |
| 53 |
public function wp_adminify_load_textdomain() |
| 54 |
{ |
| 55 |
load_plugin_textdomain('wp-adminify', false, dirname(plugin_basename(__FILE__)) . '/languages/'); |
| 56 |
} |
| 57 |
|
| 58 |
|
| 59 |
// Require/Include files |
| 60 |
public function wp_adminify_include_files() |
| 61 |
{ |
| 62 |
|
| 63 |
include_once('inc/class.settings-api.php'); |
| 64 |
include_once('inc/wp_adminify_settings.php'); |
| 65 |
} |
| 66 |
|
| 67 |
// Hooks |
| 68 |
public function wp_adminify_define_admin_hooks() |
| 69 |
{ |
| 70 |
|
| 71 |
// Custom Fonts |
| 72 |
// add_action('admin_head', array( $this, 'wp_adminify_custom_fonts') ); |
| 73 |
|
| 74 |
// Login Customization |
| 75 |
add_action('login_enqueue_scripts', array($this, 'wp_adminify_login_theme_style')); |
| 76 |
add_filter('login_headerurl', array($this, 'wp_adminify_url_login_logo')); |
| 77 |
|
| 78 |
//* Login Screen: Change login logo hover text |
| 79 |
add_filter('login_headertext', array($this, 'wp_adminify_login_logo_url_title')); |
| 80 |
|
| 81 |
//* Login Screen: Don't inform user which piece of credential was incorrect |
| 82 |
add_filter('login_errors', array($this, 'wp_adminify_failed_login')); |
| 83 |
|
| 84 |
|
| 85 |
//* Login Screen: Set 'remember me' to be checked |
| 86 |
add_action('init', array($this, 'wp_adminify_login_checked_remember_me')); |
| 87 |
|
| 88 |
add_action('admin_enqueue_scripts', array($this, 'wp_adminify_admin_bar_theme_style')); |
| 89 |
add_action('admin_enqueue_scripts', array($this, 'wp_adminify_admin_theme_style')); |
| 90 |
|
| 91 |
|
| 92 |
add_theme_support('admin-bar', array('callback' => 'wp_adminify_admin_bar_style')); |
| 93 |
add_filter('admin_footer_text', array($this, 'wp_adminify_swap_footer_admin')); |
| 94 |
|
| 95 |
|
| 96 |
//Customization's |
| 97 |
|
| 98 |
//hook to admin |
| 99 |
// add_action( 'admin_menu', array( $this, 'wp_adminify_removemenu_admin' ) ); |
| 100 |
|
| 101 |
//remove dashboard widgets |
| 102 |
// add_action('wp_dashboard_setup', array( $this, 'wp_adminify_remove_dashboard_widgets' ) ); |
| 103 |
|
| 104 |
//remove default widgets |
| 105 |
// add_action('widgets_init', array( $this, 'wp_adminify_remove_default_wp_widgets', 1)); |
| 106 |
|
| 107 |
// Remove Menu Items |
| 108 |
// add_action('admin_menu', array( $this, 'wp_adminify_remove_menu_items')); |
| 109 |
|
| 110 |
//remove sub menu's |
| 111 |
// add_action('admin_menu', array( $this, 'wp_adminify_remove_submenus')); |
| 112 |
|
| 113 |
// remove editor menu |
| 114 |
// add_action('_admin_menu', array( $this, 'wp_adminify_remove_editor_menu', 1) ); |
| 115 |
|
| 116 |
//Disable Meta Boxes in the Editing Pages |
| 117 |
// add_action('admin_init', array( $this, 'wp_adminify_customize_meta_boxes') ); |
| 118 |
|
| 119 |
// Remove Post/Pages Comments Columns Count |
| 120 |
// add_filter('manage_posts_columns', array( $this, 'wp_adminify_custom_post_columns')); |
| 121 |
// add_filter('manage_pages_columns', array( $this, 'wp_adminify_custom_pages_columns')); |
| 122 |
|
| 123 |
//Hide the Upgrade Notice to Recent Version |
| 124 |
// add_filter( 'pre_site_transient_update_core', create_function( '$a', "return null;" ) ); |
| 125 |
|
| 126 |
|
| 127 |
//Change Howdy Text |
| 128 |
add_filter('gettext', array($this, 'wp_adminify_change_howdy'), 10, 3); |
| 129 |
|
| 130 |
// Add Plugin Info Dashboard Info |
| 131 |
add_action('wp_dashboard_setup', array($this, 'wp_adminify_add_dashboard_widgets')); |
| 132 |
|
| 133 |
// Personalize Admin Loggein message |
| 134 |
add_action('wp_head', array($this, 'wp_adminify_personal_message_when_logged_in')); |
| 135 |
|
| 136 |
|
| 137 |
//Remove Frontend Admin ToolBar |
| 138 |
// add_filter( 'show_admin_bar', array( $this, 'wp_adminify_remove_toolbar_frontend' ) ); |
| 139 |
|
| 140 |
//Remove Backend Admin ToolBar |
| 141 |
// add_action('admin_head', array( $this, 'wp_adminify_remove_admin_from_dashboard' ) ); |
| 142 |
} |
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
public function wp_adminify_remove_admin_from_dashboard() |
| 147 |
{ |
| 148 |
echo '<style type="text/css"> #wpadminbar {display:none} </style>'; |
| 149 |
} |
| 150 |
|
| 151 |
public function wp_adminify_remove_toolbar_frontend() |
| 152 |
{ |
| 153 |
return false; |
| 154 |
} |
| 155 |
|
| 156 |
public function wp_adminify_personal_message_when_logged_in() |
| 157 |
{ |
| 158 |
if (is_user_logged_in()) : |
| 159 |
$current_user = wp_get_current_user(); |
| 160 |
echo '<div class="entry-title">'; |
| 161 |
echo 'Hi there ' . $current_user->user_firstname . '!'; |
| 162 |
echo '</div>'; |
| 163 |
else : |
| 164 |
echo 'Hello, new visitor!'; |
| 165 |
endif; |
| 166 |
} |
| 167 |
|
| 168 |
public function wp_adminify_failed_login() |
| 169 |
{ |
| 170 |
return 'The login information you have entered is incorrect. Please try again.'; |
| 171 |
} |
| 172 |
|
| 173 |
public function wp_adminify_login_checked_remember_me() |
| 174 |
{ |
| 175 |
add_filter('login_footer', array($this, 'wp_adminify_rememberme_checked')); |
| 176 |
} |
| 177 |
|
| 178 |
public function wp_adminify_rememberme_checked() |
| 179 |
{ |
| 180 |
|
| 181 |
echo "<script>document.getElementById('rememberme').checked = true;</script>"; |
| 182 |
} |
| 183 |
|
| 184 |
public function wp_adminify_login_logo_url_title() |
| 185 |
{ |
| 186 |
return 'REPLACE THIS WITH YOUR TEXT'; |
| 187 |
} |
| 188 |
|
| 189 |
|
| 190 |
//* Add theme info box into WordPress Dashboard |
| 191 |
public function wp_adminify_add_dashboard_widgets() |
| 192 |
{ |
| 193 |
wp_add_dashboard_widget('wp_dashboard_widget', 'Theme Details', array($this, 'wp_adminify_plugin_info')); |
| 194 |
} |
| 195 |
|
| 196 |
public function wp_adminify_plugin_info() |
| 197 |
{ |
| 198 |
|
| 199 |
echo "<ul> |
| 200 |
<li><strong>Developed By:</strong> Liton Arefin, LLC</li> |
| 201 |
<li><strong>Website:</strong> <a href='https://jeweltheme.com'>Jewel Theme</a></li> |
| 202 |
<li><strong>E-Mail:</strong> <a href='mailto:litonice09@gmail.com'>litonice09@gmail.com</a></li> |
| 203 |
<li><strong>Facebook:</strong> <a href='https://www.facebook.com/litonice09' target='_blank'>https://www.facebook.com/litonice09</a></li> |
| 204 |
<li><strong>Twitter:</strong> <a href='https://twitter.com/Litonice11' target='_blank'>https://twitter.com/Litonice11</a></li> |
| 205 |
</ul>"; |
| 206 |
} |
| 207 |
|
| 208 |
|
| 209 |
public function wp_adminify_change_howdy($translated, $text, $domain) |
| 210 |
{ |
| 211 |
|
| 212 |
if (!is_admin() || 'default' != $domain) |
| 213 |
return $translated; |
| 214 |
|
| 215 |
if (false !== strpos($translated, 'Howdy')) |
| 216 |
return str_replace('Howdy', 'Welcome', $translated); |
| 217 |
|
| 218 |
return $translated; |
| 219 |
} |
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
public function wp_adminify_url_login_logo() |
| 224 |
{ |
| 225 |
return site_url('/'); |
| 226 |
} |
| 227 |
|
| 228 |
public function wp_adminify_custom_post_columns($defaults) |
| 229 |
{ |
| 230 |
unset($defaults['comments']); |
| 231 |
return $defaults; |
| 232 |
} |
| 233 |
|
| 234 |
public function wp_adminify_custom_pages_columns($defaults) |
| 235 |
{ |
| 236 |
unset($defaults['comments']); |
| 237 |
return $defaults; |
| 238 |
} |
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
public function wp_adminify_customize_meta_boxes() |
| 243 |
{ |
| 244 |
|
| 245 |
/* Removes meta boxes from Posts */ |
| 246 |
remove_meta_box('postcustom', 'post', 'normal'); |
| 247 |
remove_meta_box('trackbacksdiv', 'post', 'normal'); |
| 248 |
remove_meta_box('commentstatusdiv', 'post', 'normal'); |
| 249 |
remove_meta_box('commentsdiv', 'post', 'normal'); |
| 250 |
remove_meta_box('tagsdiv-post_tag', 'post', 'normal'); |
| 251 |
remove_meta_box('postexcerpt', 'post', 'normal'); |
| 252 |
|
| 253 |
/* Removes meta boxes from pages */ |
| 254 |
remove_meta_box('postcustom', 'page', 'normal'); |
| 255 |
remove_meta_box('trackbacksdiv', 'page', 'normal'); |
| 256 |
remove_meta_box('commentstatusdiv', 'page', 'normal'); |
| 257 |
remove_meta_box('commentsdiv', 'page', 'normal'); |
| 258 |
} |
| 259 |
|
| 260 |
|
| 261 |
public function wp_adminify_remove_editor_menu() |
| 262 |
{ |
| 263 |
remove_action('admin_menu', '_add_themes_utility_last', 101); |
| 264 |
} |
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
public function wp_adminify_remove_submenus() |
| 269 |
{ |
| 270 |
global $submenu; |
| 271 |
unset($submenu['index.php'][10]); // Removes 'Updates'. |
| 272 |
unset($submenu['themes.php'][5]); // Removes 'Themes'. |
| 273 |
unset($submenu['options-general.php'][15]); // Removes 'Writing'. |
| 274 |
unset($submenu['options-general.php'][25]); // Removes 'Discussion'. |
| 275 |
unset($submenu['edit.php'][16]); // Removes 'Tags'. |
| 276 |
} |
| 277 |
|
| 278 |
|
| 279 |
public function wp_adminify_remove_menu_items() |
| 280 |
{ |
| 281 |
global $menu; |
| 282 |
$restricted = array( |
| 283 |
__('Links'), __('Comments'), __('Media'), |
| 284 |
__('Plugins'), __('Tools'), __('Users') |
| 285 |
); |
| 286 |
end($menu); |
| 287 |
while (prev($menu)) { |
| 288 |
$value = explode(' ', $menu[key($menu)][0]); |
| 289 |
if (in_array($value[0] != NULL ? $value[0] : "", $restricted)) { |
| 290 |
unset($menu[key($menu)]); |
| 291 |
} |
| 292 |
} |
| 293 |
} |
| 294 |
|
| 295 |
|
| 296 |
public function wp_adminify_remove_default_wp_widgets() |
| 297 |
{ |
| 298 |
unregister_widget('WP_Widget_Calendar'); |
| 299 |
unregister_widget('WP_Widget_Search'); |
| 300 |
unregister_widget('WP_Widget_Recent_Comments'); |
| 301 |
} |
| 302 |
|
| 303 |
public function wp_adminify_removemenu_admin() |
| 304 |
{ |
| 305 |
remove_menu_page('edit.php?post_type=Books'); // to remove access to the custom post type books |
| 306 |
// say we want to remove only the add new option for books then write the following |
| 307 |
remove_submenu_page('edit.php?post_type=Books', 'post-new.php?post_type=Books'); |
| 308 |
} |
| 309 |
|
| 310 |
function wp_adminify_remove_dashboard_widgets() |
| 311 |
{ |
| 312 |
global $wp_meta_boxes; |
| 313 |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); |
| 314 |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); |
| 315 |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); |
| 316 |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); |
| 317 |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); |
| 318 |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); |
| 319 |
} |
| 320 |
/* |
| 321 |
* Plugin URL |
| 322 |
*/ |
| 323 |
public function wp_adminify_plugin_url() |
| 324 |
{ |
| 325 |
if ($this->plugin_url) return $this->plugin_url; |
| 326 |
|
| 327 |
return $this->plugin_url = untrailingslashit(plugins_url('/', __FILE__)); |
| 328 |
} |
| 329 |
|
| 330 |
/* |
| 331 |
* Plugin Directory Path |
| 332 |
*/ |
| 333 |
public function wp_adminify_plugin_path() |
| 334 |
{ |
| 335 |
if ($this->plugin_path) return $this->plugin_path; |
| 336 |
|
| 337 |
return $this->plugin_path = untrailingslashit(plugin_dir_path(__FILE__)); |
| 338 |
} |
| 339 |
|
| 340 |
/* |
| 341 |
* Plugin Directory URL |
| 342 |
*/ |
| 343 |
public function wp_adminify_plugin_dir_url() |
| 344 |
{ |
| 345 |
if ($this->plugin_dir_url) return $this->plugin_dir_url; |
| 346 |
|
| 347 |
return $this->plugin_dir_url = untrailingslashit(plugin_dir_url(__FILE__)); |
| 348 |
} |
| 349 |
|
| 350 |
|
| 351 |
|
| 352 |
public function wp_adminify_custom_fonts() |
| 353 |
{ |
| 354 |
echo '<style> |
| 355 |
body, td, textarea, input, select { |
| 356 |
font-family: "Lucida Grande"; |
| 357 |
font-size: 12px; |
| 358 |
} |
| 359 |
</style>'; |
| 360 |
} |
| 361 |
|
| 362 |
|
| 363 |
|
| 364 |
|
| 365 |
|
| 366 |
// Jewel Theme Basix Admin UI Options |
| 367 |
public function jt_option($option, $section, $default = '') |
| 368 |
{ |
| 369 |
|
| 370 |
$options = get_option($section); |
| 371 |
|
| 372 |
if (isset($options[$option])) { |
| 373 |
return $options[$option]; |
| 374 |
} |
| 375 |
|
| 376 |
return $default; |
| 377 |
} |
| 378 |
|
| 379 |
|
| 380 |
|
| 381 |
public function wp_adminify_login_theme_style() |
| 382 |
{ |
| 383 |
|
| 384 |
$wp_adminify_primary_color = $this->jt_option('wp_adminify_primary_color', 'wp_adminify_colors', '#8641c0'); |
| 385 |
$wp_adminify_secondary_color = $this->jt_option('wp_adminify_secondary_color', 'wp_adminify_colors', '#2581bf'); |
| 386 |
|
| 387 |
if ($wp_adminify_primary_color != "") : |
| 388 |
$wp_adminify_primary = $wp_adminify_primary_color; |
| 389 |
else : |
| 390 |
$wp_adminify_primary = "#8641c0"; |
| 391 |
endif; |
| 392 |
if ($wp_adminify_secondary_color != "") : |
| 393 |
$wp_adminify_secondary = $wp_adminify_secondary_color; |
| 394 |
else : |
| 395 |
$wp_adminify_secondary = "#2581bf"; |
| 396 |
endif; |
| 397 |
|
| 398 |
wp_enqueue_style('wp_adminify-login-style', plugins_url() . '/wp-adminify/css/wp_adminify_styles_login.css'); |
| 399 |
|
| 400 |
$login_css = " |
| 401 |
body, html { |
| 402 |
background: {$wp_adminify_primary}; |
| 403 |
} |
| 404 |
"; |
| 405 |
wp_add_inline_style('wp_adminify-login-style', $login_css); |
| 406 |
|
| 407 |
|
| 408 |
?> |
| 409 |
<style type="text/css"> |
| 410 |
.login #login h1 a { |
| 411 |
background-image: url(‘URL TO YOUR LOGO’); |
| 412 |
?>); |
| 413 |
width: 200px; |
| 414 |
height: 80px; |
| 415 |
} |
| 416 |
|
| 417 |
.login #nav a, |
| 418 |
.login #backtoblog a { |
| 419 |
color: #fefefe !important; |
| 420 |
} |
| 421 |
|
| 422 |
.login #nav a:hover, |
| 423 |
.login #backtoblog a:hover { |
| 424 |
color: #d1d3d3 !important; |
| 425 |
} |
| 426 |
|
| 427 |
.login .button-primary { |
| 428 |
/* login button styles here */ |
| 429 |
} |
| 430 |
|
| 431 |
.login .button-primary:hover { |
| 432 |
/* hover styles written here */ |
| 433 |
|
| 434 |
} |
| 435 |
</style> |
| 436 |
<?php |
| 437 |
} |
| 438 |
|
| 439 |
|
| 440 |
|
| 441 |
public function wp_adminify_admin_bar_theme_style() |
| 442 |
{ |
| 443 |
|
| 444 |
$wp_adminify_primary_color = $this->jt_option('wp_adminify_primary_color', 'wp_adminify_colors', '#8641c0'); |
| 445 |
$wp_adminify_secondary_color = $this->jt_option('wp_adminify_secondary_color', 'wp_adminify_colors', '#2581bf'); |
| 446 |
|
| 447 |
if ($wp_adminify_primary_color != "") : |
| 448 |
$wp_adminify_primary = $wp_adminify_primary_color; |
| 449 |
else : |
| 450 |
$wp_adminify_primary = "#8641c0"; |
| 451 |
endif; |
| 452 |
if ($wp_adminify_secondary_color != "") : |
| 453 |
$wp_adminify_secondary = $wp_adminify_secondary_color; |
| 454 |
else : |
| 455 |
$wp_adminify_secondary = "#2581bf"; |
| 456 |
endif; |
| 457 |
|
| 458 |
wp_enqueue_style('wp_adminify-admin-bar-style', plugins_url() . '/wp-adminify/css/wp_adminify_styles_adminbar.css'); |
| 459 |
|
| 460 |
$admin_bar_css = " |
| 461 |
|
| 462 |
#wpadminbar { |
| 463 |
background: {$wp_adminify_primary}; |
| 464 |
} |
| 465 |
|
| 466 |
#wpadminbar .menupop .ab-sub-wrapper,#wpadminbar .shortlink-input { |
| 467 |
background: {$wp_adminify_primary}; |
| 468 |
} |
| 469 |
|
| 470 |
"; |
| 471 |
wp_add_inline_style('wp_adminify-admin-bar-style', $admin_bar_css); |
| 472 |
} |
| 473 |
|
| 474 |
|
| 475 |
|
| 476 |
public function wp_adminify_admin_theme_style() |
| 477 |
{ |
| 478 |
$wp_adminify_primary_color = $this->jt_option('wp_adminify_primary_color', 'wp_adminify_colors', '#8641c0'); |
| 479 |
$wp_adminify_secondary_color = $this->jt_option('wp_adminify_secondary_color', 'wp_adminify_colors', '#2581bf'); |
| 480 |
$wp_adminify_menu_bg_color = $this->jt_option('wp_adminify_menu_bg_color', 'wp_adminify_colors', '#2581bf'); |
| 481 |
$wp_adminify_menu_text_color = $this->jt_option('wp_adminify_menu_text_color', 'wp_adminify_colors', '#666'); |
| 482 |
|
| 483 |
|
| 484 |
|
| 485 |
if ($wp_adminify_primary_color != "") : |
| 486 |
$wp_adminify_primary = $wp_adminify_primary_color; |
| 487 |
else : |
| 488 |
$wp_adminify_primary = "#8641c0"; |
| 489 |
endif; |
| 490 |
if ($wp_adminify_secondary_color != "") : |
| 491 |
$wp_adminify_secondary = $wp_adminify_secondary_color; |
| 492 |
else : |
| 493 |
$wp_adminify_secondary = "#2581bf"; |
| 494 |
endif; |
| 495 |
|
| 496 |
wp_enqueue_style('wp_adminify-admin-style', plugins_url() . '/wp-adminify/css/wp_adminify_styles_admin.css'); |
| 497 |
|
| 498 |
$admin_css = " |
| 499 |
|
| 500 |
a, |
| 501 |
input[type=checkbox]:checked:before, |
| 502 |
.view-switch a.current:before { |
| 503 |
color: {$wp_adminify_primary} |
| 504 |
} |
| 505 |
|
| 506 |
a:hover { |
| 507 |
color: {$wp_adminify_secondary} |
| 508 |
} |
| 509 |
#adminmenu{ |
| 510 |
background: {$wp_adminify_menu_bg_color}; |
| 511 |
} |
| 512 |
#adminmenu div.wp-menu-name, #adminmenu div.wp-menu-image:before{ |
| 513 |
color: {$wp_adminify_menu_text_color}; |
| 514 |
} |
| 515 |
|
| 516 |
#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before { |
| 517 |
color: {$wp_adminify_primary}!important; |
| 518 |
} |
| 519 |
|
| 520 |
#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu .wp-menu-arrow,#adminmenu .wp-menu-arrow div,#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top,.folded #adminmenu li.wp-has-current-submenu,/* Hover actions */ |
| 521 |
#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus { |
| 522 |
background: {$wp_adminify_primary}; |
| 523 |
background:#FFF |
| 524 |
} |
| 525 |
|
| 526 |
#adminmenu .opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a,#adminmenu .wp-submenu .wp-submenu-head,/* Dashicons */ |
| 527 |
#adminmenu .current div.wp-menu-image:before,#adminmenu .wp-has-current-submenu div.wp-menu-image:before,#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu a.wp-has-current-submenu:hover div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu:hover div.wp-menu-image:before, #adminmenu li:hover div.wp-menu-image:before { |
| 528 |
color: {$wp_adminify_primary} |
| 529 |
} |
| 530 |
|
| 531 |
#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu div.wp-menu-name { |
| 532 |
color: {$wp_adminify_primary} |
| 533 |
} |
| 534 |
|
| 535 |
.wrap .add-new-h2,.wrap .add-new-h2:active { |
| 536 |
background: {$wp_adminify_primary}; |
| 537 |
} |
| 538 |
|
| 539 |
.wrap .add-new-h2:hover { |
| 540 |
background: {$wp_adminify_secondary} |
| 541 |
} |
| 542 |
|
| 543 |
div.updated { |
| 544 |
border-left: 5px solid {$wp_adminify_primary}; |
| 545 |
} |
| 546 |
|
| 547 |
#adminmenu li a.wp-has-current-submenu .update-plugins, |
| 548 |
#adminmenu li.current a .awaiting-mod { |
| 549 |
background-color: {$wp_adminify_primary}; |
| 550 |
} |
| 551 |
|
| 552 |
.wp-core-ui .button:hover,.wp-core-ui .button-secondary:hover,.wp-core-ui .button-primary { |
| 553 |
background: {$wp_adminify_primary}; |
| 554 |
} |
| 555 |
|
| 556 |
.wp-core-ui .button-primary.focus, .wp-core-ui .button-primary.hover, .wp-core-ui .button-primary:focus, .wp-core-ui .button-primary:hover { |
| 557 |
background: {$wp_adminify_secondary}; |
| 558 |
} |
| 559 |
|
| 560 |
.composer-switch a,.composer-switch a:visited,.composer-switch a.wpb_switch-to-front-composer,.composer-switch a:visited.wpb_switch-to-front-composer,.composer-switch .logo-icon { |
| 561 |
background-color: {$wp_adminify_primary}!important |
| 562 |
} |
| 563 |
|
| 564 |
.composer-switch .vc-spacer, .composer-switch a.wpb_switch-to-composer:hover, .composer-switch a:visited.wpb_switch-to-composer:hover, .composer-switch a.wpb_switch-to-front-composer:hover, .composer-switch a:visited.wpb_switch-to-front-composer:hover { |
| 565 |
background-color: {$wp_adminify_secondary}!important |
| 566 |
} |
| 567 |
|
| 568 |
"; |
| 569 |
wp_add_inline_style('wp_adminify-admin-style', $admin_css); |
| 570 |
} |
| 571 |
|
| 572 |
|
| 573 |
|
| 574 |
|
| 575 |
|
| 576 |
|
| 577 |
|
| 578 |
// Update Admin Footer |
| 579 |
public function wp_adminify_swap_footer_admin() |
| 580 |
{ |
| 581 |
echo WP_ADMINIFY . ' by <a href="https://wpadminify.com" target="_blank">Liton Arefin</a> | Powered by <a href="http://wordpress.org" target="_blank">Wordpress</a></p>'; |
| 582 |
} |
| 583 |
|
| 584 |
|
| 585 |
// Remove default HTML height on the admin bar callback |
| 586 |
public function wp_adminify_admin_bar_style() |
| 587 |
{ |
| 588 |
if (is_admin_bar_showing()) { |
| 589 |
?> |
| 590 |
<style type="text/css" media="screen"> |
| 591 |
html { |
| 592 |
margin-top: 46px !important; |
| 593 |
} |
| 594 |
|
| 595 |
* html body { |
| 596 |
margin-top: 46px !important; |
| 597 |
} |
| 598 |
</style> |
| 599 |
<?php } |
| 600 |
} |
| 601 |
} |
| 602 |
|