Skip to content
Open
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
9 changes: 9 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Local site hostname (without protocol or trailing slash).
# LocalWP: elementary.local, Lando: yoursite.lndo.site, wp-env: localhost, WP Studio: localhost
WP_HOST=yoursite.local

# SSL cert paths — only needed when your local site runs on HTTPS.
# LocalWP stores certs at:
# macOS: ~/Library/Application Support/Local/run/router/nginx/certs/<domain>.key / .crt
WP_SSL_KEY=/path/to/yoursite.local.key
WP_SSL_CERT=/path/to/yoursite.local.crt
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

# Enviroment
.env
.env.local
.wp-env.override.json

# Build
Expand Down
7 changes: 7 additions & 0 deletions inc/classes/class-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,12 @@
*/
public function enqueue_assets() {
wp_enqueue_style( 'elementary-theme-styles' );

if ( 'local' === wp_get_environment_type() ) {
$scheme = is_ssl() ? 'https' : 'http';
$host = wp_parse_url( home_url(), PHP_URL_HOST );
$host = $host ? $host : 'localhost';
wp_enqueue_script( 'browser-sync', "{$scheme}://{$host}:3000/browser-sync/browser-sync-client.js", [], false, true );

Check failure on line 176 in inc/classes/class-assets.php

View workflow job for this annotation

GitHub Actions / Lint PHP

Version parameter is not explicitly set or has been set to an equivalent of "false" for wp_enqueue_script; This means that the WordPress core version will be used which is not recommended for plugin or theme development.
}
}
}
Loading
Loading