• You’re calling wmpci_get_settings() so soon no theme or plugin can even hook into the “option_wmpci_options” filter and manipulate its data.

    In my case, I was trying to make it WPML compatible by adding this into wpml.xml:

    <wpml-config>
        <admin-texts>
            <key name="wmpci_options">
                <key name="wmpci_mainheading" />
                <key name="wmpci_subheading" />
                <key name="wmpci_popup_cnt" />
                <key name="enable_popup" /></key>
        </admin-texts>
    </wpml-config>

    This is working just fine as you can see: https://snipboard.io/Lw4Bpy.jpg

    But because you’re not using any action to call $wmpci_options = wmpci_get_settings(); on your main plugin file, the WPML translation doesn’t work at all. (or any other integration that would want to hook into your options, for all that matters)

    You should do it at least on after_setup_theme like this:
    add_action( 'after_setup_theme', function(){ $wmpci_options = wmpci_get_settings(); } );

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wmpci_get_settings() called too soon’ is closed to new replies.