Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

## Changelog ##

### 0.6.4 ###
* Add support for custom attributes in initializer

### 0.6.3 ###
* Fixed notice in widget helper

Expand Down
12 changes: 11 additions & 1 deletion includes/class-lipscore-initializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,19 @@ public function add_script() {
$api_key = Lipscore_Settings::api_key();
$assetsUrl = lipscore()->config->assets_url();
$locale = Lipscore_Settings::locale();
$script_attributes = apply_filters('lipscore_script_attributes', array(
'data-cfasync' => 'false',
'type' => 'text/javascript'
));

$attrs_string = '';
foreach ($script_attributes as $key => $value) {
$attrs_string .= sprintf('%s="%s" ', esc_attr($key), esc_attr($value));
}
$attrs_string = trim ( $attrs_string );

echo "
<script data-cfasync=\"false\" type=\"text/javascript\">
<script {$attrs_string}>
//<![CDATA[
window.lipscoreInit = function() {
lipscore.init({
Expand Down
4 changes: 2 additions & 2 deletions lipscore.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Plugin Name: Lipscore Ratings and Reviews
* Plugin URI: http://lipscore.com/
* Description: Collecting reviews is difficult. Let the most efficient and flexible plugin in the world do it for you.
* Version: 0.6.3
* Version: 0.6.4
* Author: Lipscore
* Author URI: http://lipscore.com/
* Donate link: http://lipscore.com/
Expand Down Expand Up @@ -80,7 +80,7 @@ final class Lipscore {
* @var string
* @since 0.1.0
*/
const VERSION = '0.6.2';
const VERSION = '0.6.4';

/**
* URL of plugin directory
Expand Down