JavaScript for WordPress › Forums › Gutenberg Development › Re-branding the example plugin
- This topic has 5 replies, 3 voices, and was last updated 7 years, 2 months ago by
mikemcalister.
-
AuthorPosts
-
January 14, 2018 at 11:32 am #38025
munirkamal
ParticipantHey Zac,
I am trying to rebrand the example plugin. I replaced all the instance of “jsforwp” with something else and I am getting errors and also blocks doesn’t appear in editor. Could you please guide on this?
Regards,
MunirJanuary 14, 2018 at 12:05 pm #38035Zac Gordon
KeymasterInteresting. So I just looked through the source and doing find and replace on “jsforwp” turns up
– CSS Style, fine
– Block names and namespace, should be fine
– Enqueue function calls and names, should be fineMy thoughts would be this.. Mmm…
– Check for any errors, of course
– Try wiping the bundled code and run a clean npm run build, just to try
– Try changing it back and see if it works again. If it works you have to gradually go through and change on smaller scope firstIf you do a find all in your app do you see anything different that was affected? Were there any errors displaying at all?
January 14, 2018 at 12:51 pm #38038munirkamal
ParticipantHi Again,
Thank you for your response. I’ve almost made it work. with one issue only which is related to dynamic blocks. After the change I am getting this error.
Fatal error: Uncaught Error: Call to undefined function register_block_type() in /app/public/wp-content/plugins/blocks-ultimate/jsforwp-blocks.php:137 Stack trace: #0 /app/public/wp-settings.php(305): include_once() #1 /app/public/wp-config.php(87): require_once('/app/public/wp-...') #2 /app/public/wp-load.php(37): require_once('/app/public/wp-...') #3 /app/public/wp-admin/admin.php(31): require_once('/app/public/wp-...') #4 /app/public/wp-admin/plugins.php(10): require_once('/app/public/wp-...') #5 {main} thrown in /app/public/wp-content/plugins/blocks-ultimate/jsforwp-blocks.php on line 137
Also for others who may try to rebrand the plugin, remember two things.
* Do not use Upercase in your string as Block names may not contain uppercase.
* Do not use “-“ as there are functions also which will breakNow just need to fix that above error as well 🙂
January 14, 2018 at 3:42 pm #38044Zac Gordon
KeymasterWhat is on line 137 of
blocks-ultimate/jsforwp-blocks.php
?Had a feeling that it could be dynamic field related if anything, wasn’t sure what kind of block you were building. Should have asked ;p
Also for others who may try to rebrand the plugin, remember two things. * Do not use Upercase in your string as Block names may not contain uppercase. * Do not use “-“ as there are functions also which will break
ALSO, good tips for others!
January 15, 2018 at 7:36 am #38116munirkamal
ParticipantHey Zac,
Yes that code is indeed related to Dynamic block and Dynamic Alt block. So why is it break after changing the brand string only? Any Idea? And well I am trying to build a multi block plugin. I will share with you as soon I got something ready. Still gettingggg staaarteed 🙁
Thanks for you help.
January 30, 2018 at 6:21 pm #40126mikemcalister
ParticipantHey there, there is a fix for this register_block_type error in another thread: https://javascriptforwp.com/forums/topic/moved-fatal-error-due-to-the-register_block_type/
-
AuthorPosts
- You must be logged in to reply to this topic.