Skip to content

Commit

Permalink
Move block server-side logic into same directory as client-side logic (
Browse files Browse the repository at this point in the history
…#2014)

* Move block server-side logic into same directory as client-side logic

* Update location for block php files in build-plugin-zip.sh

* Add ./blocks/library to phpcs-scanned files

* Restore comment for purpose of glob require loop
  • Loading branch information
westonruter committed Jul 31, 2017
1 parent 7ee9fbb commit 00d16a6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/build-plugin-zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ mv gutenberg.tmp.php gutenberg.php
zip -r gutenberg.zip \
gutenberg.php \
lib/*.php \
lib/blocks/*.php \
blocks/library/*/*.php \
post-content.js \
$vendor_scripts \
blocks/build/*.{js,map} \
Expand Down
File renamed without changes.
4 changes: 3 additions & 1 deletion gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@
require_once dirname( __FILE__ ) . '/lib/register.php';

// Register server-side code for individual blocks.
require_once dirname( __FILE__ ) . '/lib/blocks/latest-posts.php';
foreach ( glob( dirname( __FILE__ ) . '/blocks/library/*/index.php' ) as $block_logic ) {
require_once $block_logic;
}
}
1 change: 1 addition & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

<file>gutenberg.php</file>
<file>./lib</file>
<file>./blocks/library</file>
<exclude-pattern>./lib/parser.php</exclude-pattern>
<file>./phpunit</file>
<file>./bin</file>
Expand Down

0 comments on commit 00d16a6

Please sign in to comment.