Last active
April 8, 2019 21:32
-
-
Save lukecarbis/4bd35486b436654ce1c9f0b8b43c5819 to your computer and use it in GitHub Desktop.
Using Block Lab in a Plugin
This file contains hidden or 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
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