Skip to content

Commit

Permalink
Merge pull request #416 from jeherve/update/enqueuing-conditions
Browse files Browse the repository at this point in the history
Performance: only enqueue CSS on pages with a comment form
  • Loading branch information
pfefferle authored Sep 18, 2023
2 parents 7dd4174 + 9626999 commit 71e7968
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ While not all display options can be settings, we are looking to provide some si

Project and support maintained on github at [pfefferle/wordpress-webmention](https://github.com/pfefferle/wordpress-webmention).

### Next ###

* Fixed: avoid enqueuing Webmention's CSS stylesheet when it is not needed.

### 5.1.3 ###

* Fix timezone issue causes exception
Expand Down
4 changes: 4 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ While not all display options can be settings, we are looking to provide some si

Project and support maintained on github at [pfefferle/wordpress-webmention](https://github.com/pfefferle/wordpress-webmention).

= Next =

* Fixed: avoid enqueuing Webmention's CSS stylesheet when it is not needed.

= 5.1.3 =

* Fix timezone issue causes exception
Expand Down
4 changes: 3 additions & 1 deletion webmention.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ function activation() {
* Add CSS and JavaScript
*/
function enqueue_scripts() {
wp_enqueue_style( 'webmention', plugin_dir_url( __FILE__ ) . 'assets/css/webmention.css', array(), version() );
if ( \is_singular() && \comments_open() ) {
wp_enqueue_style( 'webmention', plugin_dir_url( __FILE__ ) . 'assets/css/webmention.css', array(), version() );
}
}

/**
Expand Down

0 comments on commit 71e7968

Please sign in to comment.