Plugin Directory

Changeset 3465655


Ignore:
Timestamp:
02/20/2026 10:10:33 AM (6 weeks ago)
Author:
consulinfolm
Message:

v1.0.9 - add generic settings tab hooks (domilocus_settings_tabs filter, domilocus_render_settings_tab_{tab} action)

Location:
domilocus
Files:
4 edited
15 copied

Legend:

Unmodified
Added
Removed
  • domilocus/tags/1.0.9/domilocus.php

    r3464318 r3465655  
    44 * Plugin URI: https://domilocus.consulinfo.it
    55 * Description: Complete booking and property management solution for vacation rentals, apartments, and accommodations with backend administration.
    6  * Version: 1.0.8
     6 * Version: 1.0.9
    77 * Author: ConsulInfo
    88 * Author URI: https://domilocus.consulinfo.it
     
    2323
    2424// Define plugin constants
    25 define('DOMILOCUS_VERSION', '1.0.8');
     25define('DOMILOCUS_VERSION', '1.0.9');
    2626define('DOMILOCUS_PLUGIN_FILE', __FILE__);
    2727define('DOMILOCUS_PLUGIN_DIR', plugin_dir_path(__FILE__));
  • domilocus/tags/1.0.9/includes/admin/class-domilocus-admin-settings.php

    r3406872 r3465655  
    153153            'advanced' => __('Advanced', 'domilocus'),
    154154        );
     155
     156        $tabs = apply_filters('domilocus_settings_tabs', $tabs);
     157
     158        if (!isset($tabs[$current_tab])) {
     159            $current_tab = 'general';
     160        }
    155161        ?>
    156162        <div class="wrap domilocus-settings">
     
    168174            </h2>
    169175
    170             <form method="post" action="<?php echo esc_url(admin_url('admin-post.php')); ?>">
    171                 <input type="hidden" name="action" value="domilocus_save_settings" />
    172                 <input type="hidden" name="tab" value="<?php echo esc_attr($current_tab); ?>" />
    173                 <?php wp_nonce_field('domilocus_settings_' . $current_tab); ?>
    174 
    175                 <?php
    176                 switch ($current_tab) {
    177                     case 'general':
    178                         self::render_general_settings();
    179                         break;
    180                     case 'payments':
    181                         self::render_payment_settings();
    182                         break;
    183                     case 'emails':
    184                         self::render_email_settings();
    185                         break;
    186                     case 'advanced':
    187                         self::render_advanced_settings();
    188                         break;
    189                 }
    190                 ?>
    191 
    192                 <?php submit_button(__('Save Settings', 'domilocus')); ?>
    193             </form>
     176            <?php
     177            $core_tabs = array('general', 'payments', 'emails', 'advanced');
     178            if (in_array($current_tab, $core_tabs, true)) :
     179            ?>
     180                <form method="post" action="<?php echo esc_url(admin_url('admin-post.php')); ?>">
     181                    <input type="hidden" name="action" value="domilocus_save_settings" />
     182                    <input type="hidden" name="tab" value="<?php echo esc_attr($current_tab); ?>" />
     183                    <?php wp_nonce_field('domilocus_settings_' . $current_tab); ?>
     184
     185                    <?php
     186                    switch ($current_tab) {
     187                        case 'general':
     188                            self::render_general_settings();
     189                            break;
     190                        case 'payments':
     191                            self::render_payment_settings();
     192                            break;
     193                        case 'emails':
     194                            self::render_email_settings();
     195                            break;
     196                        case 'advanced':
     197                            self::render_advanced_settings();
     198                            break;
     199                    }
     200                    ?>
     201
     202                    <?php submit_button(__('Save Settings', 'domilocus')); ?>
     203                </form>
     204            <?php else : ?>
     205                <?php do_action('domilocus_render_settings_tab_' . $current_tab); ?>
     206            <?php endif; ?>
    194207
    195208            <?php
  • domilocus/tags/1.0.9/readme.txt

    r3464318 r3465655  
    55Tested up to: 6.9
    66Requires PHP: 8.0
    7 Stable tag: 1.0.8
     7Stable tag: 1.0.9
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • domilocus/trunk/domilocus.php

    r3464318 r3465655  
    44 * Plugin URI: https://domilocus.consulinfo.it
    55 * Description: Complete booking and property management solution for vacation rentals, apartments, and accommodations with backend administration.
    6  * Version: 1.0.8
     6 * Version: 1.0.9
    77 * Author: ConsulInfo
    88 * Author URI: https://domilocus.consulinfo.it
     
    2323
    2424// Define plugin constants
    25 define('DOMILOCUS_VERSION', '1.0.8');
     25define('DOMILOCUS_VERSION', '1.0.9');
    2626define('DOMILOCUS_PLUGIN_FILE', __FILE__);
    2727define('DOMILOCUS_PLUGIN_DIR', plugin_dir_path(__FILE__));
  • domilocus/trunk/includes/admin/class-domilocus-admin-settings.php

    r3406872 r3465655  
    153153            'advanced' => __('Advanced', 'domilocus'),
    154154        );
     155
     156        $tabs = apply_filters('domilocus_settings_tabs', $tabs);
     157
     158        if (!isset($tabs[$current_tab])) {
     159            $current_tab = 'general';
     160        }
    155161        ?>
    156162        <div class="wrap domilocus-settings">
     
    168174            </h2>
    169175
    170             <form method="post" action="<?php echo esc_url(admin_url('admin-post.php')); ?>">
    171                 <input type="hidden" name="action" value="domilocus_save_settings" />
    172                 <input type="hidden" name="tab" value="<?php echo esc_attr($current_tab); ?>" />
    173                 <?php wp_nonce_field('domilocus_settings_' . $current_tab); ?>
    174 
    175                 <?php
    176                 switch ($current_tab) {
    177                     case 'general':
    178                         self::render_general_settings();
    179                         break;
    180                     case 'payments':
    181                         self::render_payment_settings();
    182                         break;
    183                     case 'emails':
    184                         self::render_email_settings();
    185                         break;
    186                     case 'advanced':
    187                         self::render_advanced_settings();
    188                         break;
    189                 }
    190                 ?>
    191 
    192                 <?php submit_button(__('Save Settings', 'domilocus')); ?>
    193             </form>
     176            <?php
     177            $core_tabs = array('general', 'payments', 'emails', 'advanced');
     178            if (in_array($current_tab, $core_tabs, true)) :
     179            ?>
     180                <form method="post" action="<?php echo esc_url(admin_url('admin-post.php')); ?>">
     181                    <input type="hidden" name="action" value="domilocus_save_settings" />
     182                    <input type="hidden" name="tab" value="<?php echo esc_attr($current_tab); ?>" />
     183                    <?php wp_nonce_field('domilocus_settings_' . $current_tab); ?>
     184
     185                    <?php
     186                    switch ($current_tab) {
     187                        case 'general':
     188                            self::render_general_settings();
     189                            break;
     190                        case 'payments':
     191                            self::render_payment_settings();
     192                            break;
     193                        case 'emails':
     194                            self::render_email_settings();
     195                            break;
     196                        case 'advanced':
     197                            self::render_advanced_settings();
     198                            break;
     199                    }
     200                    ?>
     201
     202                    <?php submit_button(__('Save Settings', 'domilocus')); ?>
     203                </form>
     204            <?php else : ?>
     205                <?php do_action('domilocus_render_settings_tab_' . $current_tab); ?>
     206            <?php endif; ?>
    194207
    195208            <?php
  • domilocus/trunk/readme.txt

    r3464318 r3465655  
    55Tested up to: 6.9
    66Requires PHP: 8.0
    7 Stable tag: 1.0.8
     7Stable tag: 1.0.9
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.