Easy Random Quotes
Allow for multilingual quotes (1 post)

  1. pander
    Posted 5 years ago #

    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.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Easy Random Quotes
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic