Skip to content

Commit

Permalink
Disable fopen warnings (#897)
Browse files Browse the repository at this point in the history
It's pretty common for servers (e.g. VVV) to be configured to show these
inline, so they are probably more annoying than useful.
  • Loading branch information
nylen committed May 24, 2017
1 parent 9ed20a3 commit a33329c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,12 @@ function gutenberg_register_vendor_script( $handle, $src, $deps = array() ) {
if ( $needs_fetch ) {
// Determine whether we can write to this file. If not, don't waste
// time doing a network request.
$f = fopen( $full_path, 'a' );
// @codingStandardsIgnoreStart
$f = @fopen( $full_path, 'a' );
// @codingStandardsIgnoreEnd
if ( ! $f ) {
// Failed to open the file for writing, probably due to server
// permissions. Enqueue the script directly from the URL instead.
// Note: the `fopen` call above will have generated a warning.
wp_register_script( $handle, $src, $deps );
return;
}
Expand Down

0 comments on commit a33329c

Please sign in to comment.