xwp / block-scaffolding-wp

WordPress plugin template for extending Gutenberg
https://join.xwp.co
18 stars 17 forks source link

Use correct function to get plugin meta #52

Open pierlon opened 4 years ago

pierlon commented 4 years ago

Using get_file_data requires a default set of default headers to also be passed. The correct function to use here would be get_plugin_data, which has those headers already set.

I would assume the projects that use this template also need to have this patched.

kasparsd commented 4 years ago

This was changed in #16 because of #12. Is get_file_data() not working at all now?

pierlon commented 4 years ago

Oh I wasn't aware of that issue. get_file_data() is missing the required $default_headers argument, and so fails. get_plugin_data() internally calls get_file_data with default headers, which we could copy over to fix this.

ravichdev commented 4 years ago

@kasparsd get_file_data is throwing a PHP fatal if WP_DEBUG is not set because of the missing $default_headers argument. As @pierlon mentioned we might need to copy over the default headers to fix both this and the PHP fatal issue.

derekherman commented 4 years ago

This plugin should technically be deprecated. The wp-foo-bar plugin supports everything this does and more.