Skip to content

Latest commit

 

History

History
63 lines (44 loc) · 2.02 KB

README.md

File metadata and controls

63 lines (44 loc) · 2.02 KB

@wordpress/scripts

https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/

Adding multipal input file

Now are using the https://github.com/x3p0-dev/x3p0-ideas/tree/block-example exmaple to setup out plugins

  1. Run npm install command and it will generate folder and files
  2. Now run npm run build command and it will generate plugin build
  3. Now run npm run start command and it will generate plugin on every file update

Create blocks

  1. Once everything install goto src/ folder and run npx @wordpress/create-block post-anonymously-block --no-plugin

  2. Now run composer require wpboilerplate/wpb-register-blocks

  3. Now add

/**
 * Check if class exists or not
 */
if ( class_exists( 'WPBoilerplate_Register_Blocks' ) ) {
	new WPBoilerplate_Register_Blocks( $this->plugin_dir );
}

inside the define_public_hooks method of your plugin

  1. Now run composer require wpboilerplate/wpb-register-blocks

  2. Now run composer update

  3. Once that is installed run npm run build

Composer

Adding dependency for Custom Plugins

  1. Adding BuddyBoss Platform and Platform Pro dependency composer require wpboilerplate/wpb-buddypress-or-buddyboss-dependency and then add the below code in function load_dependencies after vendor autoload file included require_once( POST_ANONYMOUSLY_PLUGIN_PATH . 'vendor/autoload.php' );
/**
 * Add the dependency for the call
 */
    if ( class_exists( 'WPBoilerplate_BuddyPress_BuddyBoss_Platform_Dependency' ) ) {
        new WPBoilerplate_BuddyPress_BuddyBoss_Platform_Dependency( $this->get_plugin_name(), POST_ANONYMOUSLY_FILES );
    }
  1. Adding BuddyBoss Platform dependency composer require wpboilerplate/wpb-buddyboss-dependency

  2. Adding WooCommerce dependency composer require wpboilerplate/wpb-woocommerce-dependency

  3. Adding ACF Pro dependency composer require wpboilerplate/acrossswp-acf-pro-dependency

  4. Adding View Analytics dependency composer require wpboilerplate/wpb-view-analytics-dependency