Fix: Add proper tab content padding and fix Theme tab loading issues
This commit is contained in:
@ -137,6 +137,11 @@ input:checked + .wp-toggle-slider:before {
|
|||||||
transform: translateX(16px);
|
transform: translateX(16px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Tab Content Area */
|
||||||
|
.wp-allstars-tab-content {
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Base Setting Styles (Shared between simple and expandable) */
|
/* Base Setting Styles (Shared between simple and expandable) */
|
||||||
.wp-setting-base,
|
.wp-setting-base,
|
||||||
.wp-setting-row,
|
.wp-setting-row,
|
||||||
|
@ -70,16 +70,13 @@ class WP_Allstars_Theme_Manager {
|
|||||||
private static function get_theme_scripts() {
|
private static function get_theme_scripts() {
|
||||||
return '
|
return '
|
||||||
jQuery(document).ready(function($) {
|
jQuery(document).ready(function($) {
|
||||||
if ($("#wpa-theme-list").length && $("#wpa-theme-list").is(":empty")) {
|
if ($("#wpa-theme-list").length) {
|
||||||
var $container = $("#wpa-theme-list");
|
var $container = $("#wpa-theme-list");
|
||||||
var $loadingOverlay = $("<div class=\"wp-allstars-loading-overlay\"><span class=\"spinner is-active\"></span></div>");
|
var $loadingOverlay = $container.find(".wp-allstars-loading-overlay");
|
||||||
|
|
||||||
// Show loading overlay
|
|
||||||
$container.css("position", "relative").append($loadingOverlay);
|
|
||||||
|
|
||||||
// AJAX request to get themes
|
// AJAX request to get themes
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: ajaxurl,
|
url: wpAllstars.ajaxurl,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
data: {
|
data: {
|
||||||
action: "wp_allstars_get_themes",
|
action: "wp_allstars_get_themes",
|
||||||
@ -153,6 +150,7 @@ class WP_Allstars_Theme_Manager {
|
|||||||
*/
|
*/
|
||||||
public static function display_tab_content() {
|
public static function display_tab_content() {
|
||||||
?>
|
?>
|
||||||
|
<div class="wp-allstars-settings-content tab-content" id="theme">
|
||||||
<div id="wpa-theme-list" class="wpa-theme-container">
|
<div id="wpa-theme-list" class="wpa-theme-container">
|
||||||
<!-- Theme content will be loaded via AJAX -->
|
<!-- Theme content will be loaded via AJAX -->
|
||||||
<div class="wp-allstars-loading-overlay">
|
<div class="wp-allstars-loading-overlay">
|
||||||
@ -160,6 +158,7 @@ class WP_Allstars_Theme_Manager {
|
|||||||
<p>Loading theme data...</p>
|
<p>Loading theme data...</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,7 +198,8 @@ class WP_Allstars_Theme_Manager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!check_ajax_referer('wp-allstars-nonce', '_wpnonce', false)) {
|
// Use verify_nonce instead of check_ajax_referer for more reliable verification
|
||||||
|
if (!wp_verify_nonce($_POST['_wpnonce'], 'wp-allstars-nonce')) {
|
||||||
error_log('WP ALLSTARS: Invalid nonce: ' . sanitize_text_field($_POST['_wpnonce']));
|
error_log('WP ALLSTARS: Invalid nonce: ' . sanitize_text_field($_POST['_wpnonce']));
|
||||||
wp_send_json_error('Invalid security token sent.');
|
wp_send_json_error('Invalid security token sent.');
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user