Fix Workflow tab layout: - Remove WordPress settings table layout - Match exact HTML structure of other tabs - Remove unwanted left gap

This commit is contained in:
Marcus Quinn
2025-03-15 02:23:47 +00:00
parent fe8c1add01
commit 2c3b26480a

View File

@ -506,11 +506,28 @@ function wpa_superstar_settings_page() {
<div class="wpa-settings-content"> <div class="wpa-settings-content">
<?php if ($active_tab == 'workflow'): ?> <?php if ($active_tab == 'workflow'): ?>
<form action="options.php" method="post"> <form action="options.php" method="post">
<?php <?php settings_fields('wpa_superstar_workflow'); ?>
settings_fields('wpa_superstar_workflow'); <div class="wpa-superstar-toggle">
do_settings_sections('wpa_superstar_workflow'); <label for="wpa_superstar_auto_upload_images">
submit_button(); <div class="wpa-toggle-switch">
?> <input type="checkbox"
id="wpa_superstar_auto_upload_images"
name="wpa_superstar_workflow_options[auto_upload_images]"
value="1"
<?php
$options = get_option('wpa_superstar_workflow_options', array('auto_upload_images' => false));
checked($options['auto_upload_images'], true);
?>
/>
<span class="wpa-toggle-slider"></span>
</div>
<?php esc_html_e('Enable Auto Upload Images', 'wpa-superstar'); ?>
</label>
<p class="description">
<?php esc_html_e('Import images that have external URLs into your Media Library when saving. Consider disabling during large data imports with many external image URLs.', 'wpa-superstar'); ?>
</p>
</div>
<?php submit_button(); ?>
</form> </form>
<?php elseif ($active_tab == 'theme'): ?> <?php elseif ($active_tab == 'theme'): ?>
@ -830,54 +847,3 @@ function wpa_superstar_settings_page() {
</div> </div>
<?php <?php
} }
// Add Workflow section
function wpa_superstar_workflow_section() {
// Register Workflow settings
register_setting('wpa_superstar_workflow', 'wpa_superstar_workflow_options');
// Add Workflow section without title or description
add_settings_section(
'wpa_superstar_workflow_section',
'',
'__return_empty_string',
'wpa_superstar_workflow'
);
// Add Auto Upload Images setting
add_settings_field(
'auto_upload_images',
'',
'wpa_superstar_auto_upload_images_callback',
'wpa_superstar_workflow',
'wpa_superstar_workflow_section'
);
}
function wpa_superstar_auto_upload_images_callback() {
$options = get_option('wpa_superstar_workflow_options', array(
'auto_upload_images' => false
));
?>
<div class="wpa-superstar-toggle">
<label for="wpa_superstar_auto_upload_images">
<div class="wpa-toggle-switch">
<input type="checkbox"
id="wpa_superstar_auto_upload_images"
name="wpa_superstar_workflow_options[auto_upload_images]"
value="1"
<?php checked($options['auto_upload_images'], true); ?>
/>
<span class="wpa-toggle-slider"></span>
</div>
<?php esc_html_e('Enable Auto Upload Images', 'wpa-superstar'); ?>
</label>
<p class="description">
<?php esc_html_e('Import images that have external URLs into your Media Library when saving. Consider disabling during large data imports with many external image URLs.', 'wpa-superstar'); ?>
</p>
</div>
<?php
}
// Add Workflow section
add_action('admin_init', 'wpa_superstar_workflow_section');