Closed bianqui149 closed 3 months ago
The diff doesn't reflect your description. Did you forget to push some changes?
Also, I don't think the src
directory is right there, although I doubt it matters since the block.kson file ends up in bloth places anyway. The core sub uses build
though as well (link).
What errors did you see previously?
I get this error "Function WP_Block_Type_Registry::register was called incorrectly." The plugin is pointing to a folder that does not exist in the root of the plugin, so it is generating a bad practice. The changes now pointing to the block.json with the correct name block "kevinbatdorf/code-block-pro"
Did you get it from GitHub here? If so you need to build it first. Run npm ci && npm run build
If you only downloaded the GitHub zip then that also doens't include the build (I don't commit the build files).
Otherwise download it from WordPress https://wordpress.org/plugins/code-block-pro/
Is from the wordpress org official repository, I tried the same code from here, If you need the see the error, try using the query monitor plugin(https://wordpress.org/plugins/query-monitor/) in a production site
I'll check it, but the directory and file is there. I'm aslo following the official documentation. You can see it here: https://plugins.trac.wordpress.org/browser/code-block-pro/trunk/build/block.json
Some questions actually if you don't mind. This might be something that needs to be fixed in WordPress
Weird, I see the file and the line in the wordpress repo, but it is not loading that file in my prod instance, it must be some config on my server, feel free to cancel the pull request. thanks!
Could be a deployment situation. Maybe you have a .gitignore
file somewhere that stops "build" from being pushed. Anyway, I appreciate the PR regardless.
This pull request addresses an issue where the block registration was causing an error due to the lack of a proper namespace prefix. The following changes were made:
register_block_type
function to correctly point to theblock.json
file located in thesrc
directory.block.json
adheres to the required "namespace/block-name" format.This fix resolves the "Block type names must contain a namespace prefix" error and ensures that the block is registered correctly in WordPress.
Testing: