Skip to content

Commit

Permalink
Contextual help appears again.
Browse files Browse the repository at this point in the history
  • Loading branch information
No3x committed Dec 9, 2014
1 parent 0fa35fe commit 162ae57
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions WPML_OptionsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ protected function deleteSavedOptions() {
public function getPluginDisplayName() {
return get_class($this);
}

/**
* @return string slug of the plugin to use as identifier.
* Just returns the class name in lowercase.
*/
public function getPluginSlug() {
return strtolower( get_class($this) );
}

/**
* Get the prefixed version input $name suitable for storing in WP options
Expand Down Expand Up @@ -261,7 +269,7 @@ public function createSettingsMenu() {
$pluginIcon = '';
if ( $wp_version >= 3.8 ) $pluginIcon = 'dashicons-email-alt';

$pluginNameSlug = strtolower( get_class($this) );
$pluginNameSlug = $this->getPluginSlug();
//create new top-level menu
$wp_logging_list_page = add_menu_page(__('WP Mail Log', 'wpml'),
__('WP Mail Log', 'wpml'),
Expand Down Expand Up @@ -334,7 +342,7 @@ function create_settings_panel($contextual_help, $screen_id, $screen) {
global $hook_suffix;

// Just add if we are at the plugin page
if( strpos($hook_suffix, get_class($this) . '_log' ) == false )
if( strpos($hook_suffix, $this->getPluginSlug() . '_log' ) == false )
return $contextual_help;

// The add_help_tab function for screen was introduced in WordPress 3.3.
Expand Down

0 comments on commit 162ae57

Please sign in to comment.