Call to undefined function `get_plugin_data()`

get_plugin_data() is only defined in the administration section. What info did you need to get from the plugin’s header that you would need to display in the theme? If the answer is none, I would suggest that you place a conditional call in your constructor. Something like:

if ( is_admin() ) {
    $var = get_plugin_data();
}

Leave a Comment