-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from WebDevStudios/fix/101-pinterest-incompat…
…ibility Version 1.5.0 Pinterest incompatibility
- Loading branch information
Showing
10 changed files
with
240 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php | ||
/** | ||
* Algolia_Scripts class file. | ||
* | ||
* @author WebDevStudios <contact@webdevstudios.com> | ||
* @since 1.5.0 | ||
* | ||
* @package WebDevStudios\WPSWA | ||
*/ | ||
|
||
/** | ||
* Class Algolia_Scripts | ||
* | ||
* @since 1.5.0 | ||
*/ | ||
class Algolia_Scripts { | ||
|
||
/** | ||
* Algolia_Scripts constructor. | ||
* | ||
* @author WebDevStudios <contact@webdevstudios.com> | ||
* @since 1.5.0 | ||
*/ | ||
public function __construct() { | ||
add_action( 'wp_enqueue_scripts', [ $this, 'register_scripts' ] ); | ||
} | ||
|
||
/** | ||
* Register scripts. | ||
* | ||
* @author WebDevStudios <contact@webdevstudios.com> | ||
* @since 1.5.0 | ||
*/ | ||
public function register_scripts() { | ||
|
||
$in_footer = Algolia_Utils::get_scripts_in_footer_argument(); | ||
|
||
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; | ||
|
||
wp_register_script( | ||
'algolia-search', | ||
ALGOLIA_PLUGIN_URL . 'js/algoliasearch/dist/algoliasearch.jquery' . $suffix . '.js', | ||
[ | ||
'jquery', | ||
'underscore', | ||
'wp-util', | ||
], | ||
ALGOLIA_VERSION, | ||
$in_footer | ||
); | ||
|
||
wp_register_script( | ||
'algolia-autocomplete', | ||
ALGOLIA_PLUGIN_URL . 'js/autocomplete.js/dist/autocomplete' . $suffix . '.js', | ||
[ | ||
'jquery', | ||
'underscore', | ||
'wp-util', | ||
], | ||
ALGOLIA_VERSION, | ||
$in_footer | ||
); | ||
|
||
wp_register_script( | ||
'algolia-autocomplete-noconflict', | ||
ALGOLIA_PLUGIN_URL . 'js/autocomplete-noconflict.js', | ||
[ | ||
'algolia-autocomplete', | ||
], | ||
ALGOLIA_VERSION, | ||
$in_footer | ||
); | ||
|
||
wp_register_script( | ||
'algolia-instantsearch', | ||
ALGOLIA_PLUGIN_URL . 'js/instantsearch.js/dist/instantsearch-preact' . $suffix . '.js', | ||
[ | ||
'jquery', | ||
'underscore', | ||
'wp-util', | ||
], | ||
ALGOLIA_VERSION, | ||
$in_footer | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
/** | ||
* Algolia_Styles class file. | ||
* | ||
* @author WebDevStudios <contact@webdevstudios.com> | ||
* @since 1.5.0 | ||
* | ||
* @package WebDevStudios\WPSWA | ||
*/ | ||
|
||
/** | ||
* Class Algolia_Styles | ||
* | ||
* @since 1.5.0 | ||
*/ | ||
class Algolia_Styles { | ||
|
||
/** | ||
* Algolia_Styles constructor. | ||
* | ||
* @author WebDevStudios <contact@webdevstudios.com> | ||
* @since 1.5.0 | ||
*/ | ||
public function __construct() { | ||
add_action( 'wp_enqueue_scripts', [ $this, 'register_styles' ] ); | ||
} | ||
|
||
/** | ||
* Register styles. | ||
* | ||
* @author WebDevStudios <contact@webdevstudios.com> | ||
* @since 1.5.0 | ||
*/ | ||
public function register_styles() { | ||
|
||
wp_register_style( | ||
'algolia-autocomplete', | ||
ALGOLIA_PLUGIN_URL . 'css/algolia-autocomplete.css', | ||
[], | ||
ALGOLIA_VERSION, | ||
'screen' | ||
); | ||
|
||
wp_register_style( | ||
'algolia-instantsearch', | ||
ALGOLIA_PLUGIN_URL . 'css/algolia-instantsearch.css', | ||
[], | ||
ALGOLIA_VERSION, | ||
'screen' | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.