• Resolved ph1170

    (@ph1170)


    Hi guys, I noticed that using the_msls( $args ) did not work, meaning that the before and after values were not used at all. After some digging in the code I saw that the function set_tags() in MslsOutput.php calls wp_parse_args( $this->get_tags(), $arr ), which always returned an empty array. Switching the arguments of wp_parse_args to wp_parse_args( $arr, $this->get_tags() ) seemed to fix the problem.

    In short, replace line 145 and further in MslsOutput.php by the following:

    /**
     * Sets tags for the output
     *
     * @param array $arr
     * @return MslsOutput
     */
    public function set_tags( array $arr = array() ) {
       $this->tags = wp_parse_args( $arr, $this->get_tags() );
       return $this;
    }

    https://wordpress.org/plugins/multisite-language-switcher/

Viewing 1 replies (of 1 total)
  • Plugin Author Dennis Ploetner

    (@realloc)

    Hi,

    you’ll get nothing from $this->get_tags() if there is nothing set in the plugin options for these fields. This part works for sure … the question is just which var should be the default. And that can depend on the use-case.

    Feel free to make a pull request at GitHub but explain your use-case please: https://github.com/lloc/Multisite-Language-Switcher

    Cheers,
    Dennis.

Viewing 1 replies (of 1 total)
  • The topic ‘Bug report using before and after items in the_msls’ is closed to new replies.