Skip to content

Instantly share code, notes, and snippets.

@lukecarbis
Last active April 8, 2019 21:32
Show Gist options
  • Save lukecarbis/4bd35486b436654ce1c9f0b8b43c5819 to your computer and use it in GitHub Desktop.
Save lukecarbis/4bd35486b436654ce1c9f0b8b43c5819 to your computer and use it in GitHub Desktop.
Using Block Lab in a Plugin
class My_Block_Plugin {
/**
* Register any hooks that this component needs.
*/
public function __construct() {
add_filter( 'block_lab_template_path', array( $this, 'template_path' ) );
}
/**
* Include the plugin's blocks folder in the template path.
*/
public function template_path() {
return untrailingslashit( dirname( __FILE__ ) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment