WordPress.org

Ready to get started?Download WordPress

Forums

Polylang
pll_default_language function bug (4 posts)

  1. l.tamburo
    Member
    Posted 1 year ago #

    Hi,
    there is a bug into function pll_default_language into file include/api.php on line 27.

    $options = get_options('polylang')
    get_options() not exist, correct function is get_option()

    APACHE LOG ERROR:
    PHP Fatal error: Call to undefined function get_options() in [cut]/wp-content/plugins/polylang/include/api.php on line 27

    Plugin version 1.0.1

    http://wordpress.org/extend/plugins/polylang/

  2. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks! It's the proof that I did not test it :(
    There is also $arg to be replaced by $args at line 25.

  3. l.tamburo
    Member
    Posted 1 year ago #

    other error is default-lang when in option is saved as default_lang

    my fix
    /*
    * returns the default language
    */
    function pll_default_language($args = 'slug') {
    global $polylang;
    return !(isset($polylang) && ($options = get_option('polylang')) && isset($options['default_lang']) && $lang = $polylang->get_language($options['default_lang'])) ? false :
    ($args == 'name' ? $lang->name :
    ($args == 'locale' ? $lang->description :
    $lang->slug));
    }

    Have a nice day : )

  4. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    I should have been very tired when I wrote this :(

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags