PluginProbe
YayMail – WooCommerce Email Customizer / 4.4.5
YayMail – WooCommerce Email Customizer v4.4.5
4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 trunk 1.9.6 2.1.4 2.1.5 3.2.2 3.2.6 3.2.7.1 3.2.8.1 3.2.9 3.3 3.3.1 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4 3.4.1 All 57 releases
yaymail / src / Integrations / AdminAndSiteEnhancements / AdminAndSiteEnhancements.php

AdminAndSiteEnhancements.php in YayMail – WooCommerce Email Customizer 4.4.5, at src/Integrations/AdminAndSiteEnhancements/AdminAndSiteEnhancements.php

54 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace YayMail\Integrations\AdminAndSiteEnhancements;
4
5 use YayMail\Utils\SingletonTrait;
6
7 /**
8 * Admin and Site Enhancements (ASE)
9 * Link: https://wordpress.org/plugins/admin-site-enhancements/
10 *
11 * AdminAndSiteEnhancements
12 * * @method static AdminAndSiteEnhancements get_instance()
13 */
14 class AdminAndSiteEnhancements {
15 use SingletonTrait;
16
17 private function __construct() {
18 if ( self::is_3rd_party_installed() ) {
19 $this->initialize_hooks();
20 }
21 }
22
23 public static function is_3rd_party_installed() {
24 return class_exists( 'ASENHA\Classes\Activation' );
25 }
26
27 private function initialize_hooks() {
28 add_action( 'admin_head', [ $this, 'yaymail_custom_wp_content_width' ], 99 );
29 }
30
31 public function yaymail_custom_wp_content_width() {
32 $current_screen = get_current_screen();
33 $ase_options = get_option( ASENHA_SLUG_U, [] );
34
35 if ( $current_screen->id !== 'yaycommerce_page_yaymail-settings' || ! isset( $ase_options['wider_admin_menu'] ) || ! $ase_options['wider_admin_menu'] ) {
36 return;
37 }
38
39 $admin_menu_width = $ase_options['admin_menu_width'] ?? '160px';
40
41 ?>
42 <style>
43 #wpcontent {
44 margin-left: <?php echo esc_attr( $admin_menu_width ); ?> !important;
45 }
46
47 .yaymail-header__navbar, .yaymail-footer{
48 width: calc(100% - <?php echo esc_attr( $admin_menu_width ); ?>) !important;
49 }
50 </style>
51 <?php
52 }
53 }
54