• Hi – i’ve added some custom flags via the hook:

    msls_options_get_flag_url

    Just a minor hint for msls_options_get_flag_url.

    /**
     * @param string $url
     * @return string
     */
    function my_msls_options_get_flag_url( $url ) {
        //the slash after images isn’t needed
        return get_stylesheet_directory_uri() . '/images/';
        //resulting url with two slashes after images//:
        //http://localhost/wp-content/themes/archiv/images//es.png
    
    
    }
    add_filter( 'msls_options_get_flag_url', 'my_msls_options_get_flag_url' );

    Now to my question. Inspecting the dom i see that the image dimensions aren’t present. And since the browser doesn’t know what dimension to hold, a lay-out-shift occurs on page load. To prevent that i hard coded width and height in MslsLinkImageOnly.php like so:

    protected $format_string = '<img width="30" height="18" src="{src}" alt="{alt}"/>';

    That’s far from ideal. Is there a filter for this operation? Thanks for a hint. To better understand this issue, i add the flags with your «my_custom_menu_item» function to a wordpress menu.

    regards theo

    • This topic was modified 3 years, 3 months ago by timholz.
    • This topic was modified 3 years, 3 months ago by timholz.

The topic ‘add image dimensions for flags’ is closed to new replies.