-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
- Loading branch information
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,22 @@ | ||
# Build files | ||
build | ||
vendor | ||
composer.lock | ||
node_modules | ||
|
||
# Log files | ||
*.log | ||
|
||
# Cache files | ||
.phpcs/*.json | ||
.phpunit.result.cache | ||
|
||
# Ignore temporary OS files | ||
.DS_Store | ||
.DS_Store? | ||
.Spotlight-V100 | ||
.Trashes | ||
ehthumbs.db | ||
Thumbs.db | ||
.thumbsdb | ||
|
||
# IDE files | ||
*.code-workspace | ||
.idea | ||
.vscode | ||
wp-cli.local.yml | ||
node_modules/ | ||
*.sql | ||
*.tar.gz | ||
*.zip | ||
.phpunit.result.cache | ||
Dockerfile | ||
output.log | ||
.github | ||
tests | ||
bin | ||
composer.lock | ||
.phpcs.xml | ||
phpunit.xml | ||
configure.php | ||
DOCKER_ENV | ||
phpunit.xml | ||
tests | ||
.phpcs | ||
Makefile |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"$schema": "https://schemas.wp.org/trunk/block.json", | ||
"apiVersion": 2, | ||
"name": "wp-curate/post", | ||
"version": "0.1.0", | ||
"title": "Post", | ||
"category": "theme", | ||
"icon": "admin-post", | ||
"description": "Container block to allow setting a post inline", | ||
"textdomain": "wp-curate", | ||
"editorScript": "file:index.js", | ||
"editorStyle": "file:index.css", | ||
"style": [ | ||
"file:style-index.css" | ||
], | ||
"usesContext": [ | ||
"postId", | ||
"query" | ||
], | ||
"render": "file:render.php", | ||
"supports": { | ||
"inserter": false | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-data', 'wp-i18n'), 'version' => 'd59edb5fd0a5554349c2'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
/** | ||
* Block Name: Post. | ||
* | ||
* @package wp-curate | ||
*/ | ||
|
||
use Alley\WP\WP_Curate\Supported_Post_Types; | ||
|
||
/** | ||
* Registers the wp-curate/post block using the metadata loaded from the `block.json` file. | ||
*/ | ||
function wp_curate_post_block_init(): void { | ||
$supported_post_types = new Supported_Post_Types(); | ||
if ( ! $supported_post_types->should_register_block() ) { | ||
return; | ||
} | ||
|
||
// Register the block by passing the location of block.json. | ||
register_block_type( | ||
__DIR__ | ||
); | ||
} | ||
add_action( 'init', 'wp_curate_post_block_init' ); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
/** | ||
* The render callback for the wp-curate/post block. | ||
* | ||
* All of the parameters passed to the function where this file is being required are accessible in this scope: | ||
* | ||
* @phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- File doesn't load in global scope, just appears to to PHPCS. | ||
* | ||
* @var string $content Rendered block output. ie. <InnerBlocks.Content />. | ||
* @var WP_Block $block The instance of the WP_Block class that represents the block being rendered. | ||
* | ||
* @package wp-curate | ||
*/ | ||
|
||
echo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Rendered by Gutenberg. |