Home Forums WoodMart support forum The problem described in ticket #663569 partially persists

The problem described in ticket #663569 partially persists

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #674585

    compras-informatica
    Participant

    Dear Support Team,

    Thank you for your previous response. The PHP snippet you provided has partially resolved the issue related to Preset values appearing in the general settings panel of the Woodmart theme. However, I have encountered a new, unexpected behavior that still risks compromising the integrity of the global configuration.

    Updated Issue Summary:

    Although the Preset values no longer appear automatically in Settings → Theme Settings → General, when making any changes on that screen —for example, disabling the Navbar labels— and clicking Save Changes, other unrelated settings are overwritten. A critical example is that the Header defined in the global configuration is silently replaced by the Header from the Preset intended for logged-in users.

    Steps to Reproduce:

    Add the provided PHP snippet to the child theme’s functions.php file.

    Create a Preset with user role-based conditions, e.g., User role = Administrator.

    In that Preset, configure a specific Header (e.g., “Header (logged in)”).

    In the global configuration (outside of any Preset), set a different Header (e.g., “Header (not logged)”).

    While logged in as an Administrator, go to Settings → Theme Settings → General.

    Make a small change —for example, disable the Navbar labels— and save.

    Upon saving, observe that the global Header setting has been changed to the Preset’s Header, even though it was not modified directly.

    This behavior still represents a serious risk of losing global customizations, even with the current fix applied. It would be advisable to completely prevent Preset values from loading or interfering with the general settings during edit and save actions.

    Could you please review this second part of the issue and advise whether there’s an additional filter or code update that would prevent Preset values from merging into the global configuration when saving?

    Thank you in advance for your continued assistance.

    #674675

    Artem Temos
    Keymaster

    Hello,

    Try to add the following code instead of the previous one

    add_action( 'xts_active_options_presets', function ( $active_presets ) {
    
    			if ( (isset($_SERVER['PHP_SELF']) && basename($_SERVER['PHP_SELF']) === 'options.php') || (isset( $_GET['page'] ) && 'xts_theme_settings' === $_GET['page']) ) { // phpcs:ignore
    				return array();
    			}
    
    			return $active_presets;
    		});

    Kind Regards

    #674763

    compras-informatica
    Participant

    Hello,

    Thank you very much for your prompt response and for the PHP snippet you provided. I’ve tested the solution and can confirm that it successfully resolves the issue I reported.

    I truly appreciate your support.

    Best regards.

    #674767

    Artem Temos
    Keymaster

    Great, thank you for the feedback. Feel free to contact us if you have any further questions.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘The problem described in ticket #663569 partially persists’ is closed to new replies.