Permalink
Please
sign in to comment.
Browse files
Add the minimal code to start building BuddyPress blocks
Add 2 example blocks so that it is easy to understand how to add new ones. Create a BP_Block class to simplify scripts and styles registration. Only load blocks when corresponding components are active. Set the run/build process using Parcel Bundler. Add a WordPress code formatting script to check it.
- Loading branch information
Showing
with
9,581 additions
and 0 deletions.
- +3 −0 .babelrc
- +24 −0 .editorconfig
- +14 −0 .gitignore
- +29 −0 build/bp-groups/bp-groups-blocks.php
- +1 −0 build/bp-groups/css/blocks/group.css
- +396 −0 build/bp-groups/css/blocks/group.js
- +341 −0 build/bp-groups/js/blocks/group.js
- +29 −0 build/bp-members/bp-members-blocks.php
- +1 −0 build/bp-members/css/blocks/member.css
- +396 −0 build/bp-members/css/blocks/member.js
- +341 −0 build/bp-members/js/blocks/member.js
- +109 −0 class-bp-blocks.php
- +13 −0 composer.json
- +341 −0 composer.lock
- +183 −0 inc/classes/class-bp-block.php
- +57 −0 inc/functions.php
- +30 −0 inc/globals.php
- +7,188 −0 package-lock.json
- +33 −0 package.json
- +1 −0 src/bp-groups/css/blocks/group.css
- +25 −0 src/bp-groups/js/blocks/group.js
- +1 −0 src/bp-members/css/blocks/member.css
- +25 −0 src/bp-members/js/blocks/member.js
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["@wordpress/default"] | ||
} |
@@ -0,0 +1,24 @@ | ||
# This file is for unifying the coding style for different editors and IDEs | ||
# editorconfig.org | ||
|
||
# WordPress Coding Standards | ||
# https://make.wordpress.org/core/handbook/coding-standards/ | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
indent_style = tab | ||
|
||
[*.yml] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[{*.txt}] | ||
end_of_line = crlf |
@@ -0,0 +1,14 @@ | ||
# Operating system specific files | ||
.DS_Store | ||
.DS_* | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
ehthumbs.db | ||
Thumbs.db | ||
|
||
# Files and folders related to build/test tools | ||
node_modules | ||
npm-debug.log | ||
vendor | ||
.cache |
@@ -0,0 +1,29 @@ | ||
<?php | ||
/** | ||
* BP Groups Blocks Functions. | ||
* | ||
* @package bp-blocks | ||
* @subpackage \inc\bp-groups\bp-groups-blocks | ||
*/ | ||
// Exit if accessed directly. | ||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; | ||
} | ||
/** | ||
* Register Groups Blocks. | ||
* | ||
* @since 6.0.0 | ||
*/ | ||
function bp_groups_register_blocks() { | ||
bp_register_block( | ||
array( | ||
'name' => 'bp/group', | ||
'editor_script' => 'bp-group-block', | ||
'editor_script_url' => plugins_url( 'js/blocks/group.js', __FILE__ ), | ||
'editor_script_deps' => array( 'wp-blocks', 'wp-element' ), | ||
) | ||
); | ||
} | ||
add_action( 'bp_blocks_init', 'bp_groups_register_blocks', 10 ); |
@@ -0,0 +1 @@ | ||
/* CSS for the bp/group block */ |

Oops, something went wrong.
0 comments on commit
227a158