Skip to content

Avoid get_plugin_data undefined#240

Closed
paolofantozzi wants to merge 1 commit intoyo35:masterfrom
paolofantozzi:patch-1
Closed

Avoid get_plugin_data undefined#240
paolofantozzi wants to merge 1 commit intoyo35:masterfrom
paolofantozzi:patch-1

Conversation

@paolofantozzi
Copy link
Copy Markdown

In some cases the plugin is initialized without the include of plugin functions. In those cases we need to load them first.

In some cases the plugin is initialized without the include of plugin functions. In those cases we need to load them first.
@yo35
Copy link
Copy Markdown
Owner

yo35 commented Jun 14, 2022

Hi Paolo,
Can you explain in which circumstances the plugin functions are not loaded by default?

@yo35
Copy link
Copy Markdown
Owner

yo35 commented Jun 14, 2022

PS: I cannot find any information about that in the WP.org (https://developer.wordpress.org/reference/functions/get_plugin_data/).

@yo35
Copy link
Copy Markdown
Owner

yo35 commented Jun 14, 2022

PPS: OK, with all other plugins disabled, and with the default WP theme (Twenty Twenty-Two), I do get the following error:

Fatal error: Uncaught Error: Call to undefined function get_plugin_data()
...

:-( The WordPress developer documentation is full of traps... Not mentioning that this function may not be loaded by default (even in the admin) is a real pitfall.

-> as a fix, I would rather defining the RPBCHESSBOARD_VERSION directly instead of relying on such poorly documented mechanism.

yo35 added a commit that referenced this pull request Jun 14, 2022
@yo35
Copy link
Copy Markdown
Owner

yo35 commented Jun 14, 2022

@paolofantozzi I've issued a new version that fixes the above-mentioned error, using a different fix than what you proposed. Still, thanks for reporting.

@yo35 yo35 closed this Jun 14, 2022
@paolofantozzi
Copy link
Copy Markdown
Author

Thank you for your efficiency!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants