Fix single column layout for Pro Plugins, Hosting, and Tools tabs with inline CSS
This commit is contained in:
@ -15,7 +15,7 @@ class WP_Allstars_Hosting_Manager {
|
|||||||
* Initialize the class
|
* Initialize the class
|
||||||
*/
|
*/
|
||||||
public static function init() {
|
public static function init() {
|
||||||
// No specific initialization needed currently
|
add_action('admin_enqueue_scripts', array(__CLASS__, 'enqueue_styles'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -80,4 +80,55 @@ class WP_Allstars_Hosting_Manager {
|
|||||||
|
|
||||||
return wp_allstars_get_hosting_providers();
|
return wp_allstars_get_hosting_providers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enqueue styles for the hosting tab
|
||||||
|
*
|
||||||
|
* @param string $hook Current admin page hook
|
||||||
|
*/
|
||||||
|
public static function enqueue_styles($hook) {
|
||||||
|
if ('settings_page_wp-allstars' !== $hook) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
wp_enqueue_style(
|
||||||
|
'wp-allstars-admin',
|
||||||
|
plugins_url('css/wp-allstars-admin.css', dirname(__FILE__)),
|
||||||
|
array(),
|
||||||
|
WP_ALLSTARS_VERSION
|
||||||
|
);
|
||||||
|
|
||||||
|
// Add inline CSS for hosting to match the single column layout
|
||||||
|
$custom_css = '
|
||||||
|
#hosting .wpa-pro-plugins {
|
||||||
|
padding: 15px 20px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
max-width: 700px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
#hosting .wpa-pro-plugin {
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
padding: 24px;
|
||||||
|
border-radius: 8px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
#hosting .wpa-pro-plugin:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
#hosting .wpa-pro-plugin .button-group {
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
';
|
||||||
|
|
||||||
|
wp_add_inline_style('wp-allstars-admin', $custom_css);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -139,11 +139,11 @@ class WP_Allstars_Pro_Plugins_Manager {
|
|||||||
// Add inline CSS for pro plugins
|
// Add inline CSS for pro plugins
|
||||||
$custom_css = '
|
$custom_css = '
|
||||||
.wpa-pro-plugins {
|
.wpa-pro-plugins {
|
||||||
padding: 0;
|
padding: 15px 20px;
|
||||||
display: grid;
|
display: flex;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
|
flex-direction: column;
|
||||||
gap: 24px;
|
align-items: center;
|
||||||
max-width: 1920px;
|
max-width: 700px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
.wpa-pro-plugin {
|
.wpa-pro-plugin {
|
||||||
@ -155,6 +155,12 @@ class WP_Allstars_Pro_Plugins_Manager {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
.wpa-pro-plugin:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
.wpa-pro-plugin:hover {
|
.wpa-pro-plugin:hover {
|
||||||
border-color: #2271b1;
|
border-color: #2271b1;
|
||||||
@ -178,6 +184,7 @@ class WP_Allstars_Pro_Plugins_Manager {
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
margin-top: auto;
|
margin-top: auto;
|
||||||
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
.wpa-pro-plugin .button {
|
.wpa-pro-plugin .button {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
@ -35,6 +35,39 @@ class WP_Allstars_Tools_Manager {
|
|||||||
array(),
|
array(),
|
||||||
WP_ALLSTARS_VERSION
|
WP_ALLSTARS_VERSION
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Add inline CSS for tools to match the single column layout
|
||||||
|
$custom_css = '
|
||||||
|
#tools .wpa-pro-plugins {
|
||||||
|
padding: 15px 20px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
max-width: 700px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
#tools .wpa-pro-plugin {
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
padding: 24px;
|
||||||
|
border-radius: 8px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
#tools .wpa-pro-plugin:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
#tools .wpa-pro-plugin .button-group {
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
';
|
||||||
|
|
||||||
|
wp_add_inline_style('wp-allstars-admin', $custom_css);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user