Skip to content

Commit

Permalink
Issue #43 - check plugin main file name not plugin slug
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbingwide committed Dec 23, 2020
1 parent f5f0750 commit 539f778
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions oik-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ function oik_blocks_dynamic_block_person( $attributes ) {
* Returns null if everything is OK, HTML if there's a problem.
*
* @param $filename - relative path for the file to load
* @param $plugin - plugin name
* @param $plugin - plugin slug
* @param $funcname - required function name
* @return string| null
*/
Expand All @@ -400,8 +400,12 @@ function oik_blocks_check_server_func( $filename, $plugin, $funcname ) {
return $html;
}

/**
* We assume the plugin's main file is the same as the plugin name.
* This is true for oik plugins.
*/
if ( $plugin ) {
$activated = is_plugin_active( $plugin );
$activated = is_plugin_active( "$plugin/$plugin.php" );
if ( !$activated) {
$html = "Plugin $plugin is not activated.";
return $html;
Expand Down

0 comments on commit 539f778

Please sign in to comment.