• Hey,

    I built a function that prepares an SVG if it’s uploaded as the custom logo (enabled via add_theme_support('custom_logo')). It ads a title and some useful attributes to the SVG and safes it back to a file.

    The function is fired via add_action('customize_save_after', 'prepareMySVG'), because the SVG can only be edited after the custom logo setting is saved.

    By now my function is fired every time the customizer options are saved, but I thought there had to be a way to fire it only, when an actually related option (“blogname”, “blogdescription” and “custom_logo”) has been edited. This is an attempt to prevent unnecessarily long load times when working with the customizer.

    add_action('customize_save_after_blogname', 'prepareMySVG') and add_action('customize_save_after_blogdescription', 'prepareMySVG') work absolutely fine, but for some reason add_action('customize_save_after_custom_logo', 'prepareMySVG') doesn’t seem to fire at all.
    add_action('customize_save_custom_logo', 'prepareMySVG') is working, too, but I can’t use it, because it fires too early for my function to do its magic.

    Does anyone know a solution or workaround for this very niche problem? Thinking about it, there might not even be a solution at all, because the absence of the hook I’m looking for could be due to some WordPress logic that I’m not aware of.

    Anyways, thanks in advance for anything that could be helpful.

    BTW: If anyone is interested in the also very niche SVG preparation function I built, let me know. I’m happy to share it with you. 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘customize_safe_after Hook for Custom Logo’ is closed to new replies.