Support » Plugin: Easy Random Quotes » [Plugin: Easy Random Quotes] Allow for multilingual quotes

  • Hi trepmal,

    I have made a quick hack to allow for multilingual qoutes. The quotes need to be entered according to the following format (for this hack):

    en@The apple is green.#nl@De appel is groen.

    The code needs to be altered to:

    function erq_shortcode( $atts = array( 'id' => 'rand' ) ) {
            $use = ( 'rand' == $id ) ? array_rand( $theQuotes ) : $id;
            $all = explode("#", stripslashes( $theQuotes[ $use ] ));
            $quote = "";
            foreach($all as $each) {
                    $kv = explode("@", $each);
                    if ($kv[0] == ICL_LANGUAGE_CODE) {
                            $quote = $kv[1];
            return $quote;

    and it works. Please consider this feature request and provide a proper implementation. Perhaps a setting (default off) needs to be provded too to activatie this behaviour.

    Best regards,


    PS I am using WPML too.

  • The topic ‘[Plugin: Easy Random Quotes] Allow for multilingual quotes’ is closed to new replies.