-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New blocks: Add blocks for the pledge contributors & pledge teams lists
- Loading branch information
Showing
13 changed files
with
1,030 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"$schema": "https://schemas.wp.org/trunk/block.json", | ||
"apiVersion": 2, | ||
"name": "wporg/pledge-contributors", | ||
"version": "0.1.0", | ||
"title": "Pledge contributors", | ||
"category": "design", | ||
"icon": "", | ||
"description": "List out the contributors for this organization's pledge.", | ||
"textdomain": "wporg", | ||
"supports": { | ||
"html": false | ||
}, | ||
"usesContext": [ "postId", "postType" ], | ||
"editorScript": "file:./index.js", | ||
"style": "file:./style-index.css", | ||
"render": "file:./render.php" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { registerBlockType } from '@wordpress/blocks'; | ||
import { useBlockProps } from '@wordpress/block-editor'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import metadata from './block.json'; | ||
import './style.scss'; | ||
|
||
const Edit = ( { attributes, name } ) => { | ||
const blockProps = useBlockProps(); | ||
return ( | ||
<div { ...blockProps }> | ||
<ServerSideRender block={ name } attributes={ attributes } skipBlockSupportAttributes /> | ||
</div> | ||
); | ||
}; | ||
|
||
registerBlockType( metadata.name, { | ||
edit: Edit, | ||
save: () => null, | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/** | ||
* Block Name: Pledge contributors | ||
* Description: List out the contributors for this organization's pledge. | ||
* | ||
* @package wporg | ||
*/ | ||
|
||
namespace WordPressdotorg\Theme\FiveForTheFuture_2024\Pledge_Contributors; | ||
|
||
defined( 'WPINC' ) || die(); | ||
|
||
add_action( 'init', __NAMESPACE__ . '\init' ); | ||
|
||
/** | ||
* Register the block. | ||
*/ | ||
function init() { | ||
register_block_type( dirname( __DIR__, 2 ) . '/build/pledge-contributors' ); | ||
} |
Oops, something went wrong.