Make it work with WPML
-
If you use WPML String with this pluggin, I propose two files change:
In quotes-collection-admin.php:
– Line 40, under $results = $wpdb->query( $insert );
//WPML if (function_exists('icl_register_string')) { $newid = $wpdb->insert_id; icl_register_string('Quotes Collection', 'Quote ID '.$newid, trim(stripslashes($quote), "'")); icl_register_string('Quotes Collection', 'Source ID '.$newid, trim(stripslashes($source), "'")); icl_register_string('Quotes Collection', 'Author ID '.$newid, trim(stripslashes($author), "'")); }– Line 89, under $results = $wpdb->query( $update );
// WPML if (function_exists('icl_register_string')) { icl_register_string('Quotes Collection', 'Quote ID '.$quote_id, trim(stripslashes($quote), "'")); icl_register_string('Quotes Collection', 'Source ID '.$quote_id, trim(stripslashes($source), "'")); icl_register_string('Quotes Collection', 'Author ID '.$quote_id, trim(stripslashes($author), "'")); }– Line 109, under ” WHERE quote_id = ” . $quote_id;
// WPML if (function_exists('icl_unregister_string')) { icl_unregister_string('Quotes Collection', 'Quote ID '.$quote_id); icl_unregister_string('Quotes Collection', 'Source ID '.$quote_id); icl_unregister_string('Quotes Collection', 'Author ID '.$quote_id); }In quotes-collection.php:
– Line 91, under $random_quote = $wpdb->get_row($sql, ARRAY_A);
// WPML if (function_exists('icl_t')) { $random_quote['quote'] = icl_t('Quotes Collection', 'Quote ID '.$random_quote['quote_id'], $random_quote['quote']); $random_quote['source'] = icl_t('Quotes Collection', 'Source ID '.$random_quote['quote_id'], $random_quote['source']); $random_quote['author'] = icl_t('Quotes Collection', 'Author ID '.$random_quote['quote_id'], $random_quote['author']); }Each time you add or edit a quote, it will add a new WPML string with Quote ID, Source and Author to translate.
Yours
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Make it work with WPML’ is closed to new replies.