Skip to content

Commit 1101ad4

Browse files
authored
Merge pull request #116 from mailpoet/fix-contextual-help
Remove the contextual help tab [WML-16]
2 parents 8f8d2d7 + bb2fc0e commit 1101ad4

File tree

1 file changed

+10
-63
lines changed

1 file changed

+10
-63
lines changed

src/WPML_OptionsManager.php

Lines changed: 10 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,16 @@ public function createSettingsMenu() {
342342
$pluginNameSlug . '_about',
343343
array(&$this, 'LogSubMenuAbout') );
344344

345-
add_action( 'contextual_help', array( &$this, 'create_settings_panel' ), 10, 3 );
345+
add_action( 'load-' . $wp_logging_list_page, function() {
346+
add_screen_option(
347+
'per_page',
348+
array(
349+
'label' => __('Entries per page', 'wp-mail-logging'),
350+
'default' => 25,
351+
'option' => 'per_page'
352+
)
353+
);
354+
});
346355
}
347356

348357
public function LogSubMenuAbout() {
@@ -390,68 +399,6 @@ public function load_assets() {
390399
wp_enqueue_style( 'icheck-square', untrailingslashit( plugin_dir_url( __FILE__ ) ) . '/../lib/icheck/square/blue.css', array(), '1.0.2' );
391400
}
392401

393-
/**
394-
* Add settings Panel
395-
*/
396-
function create_settings_panel($contextual_help, $screen_id, $screen) {
397-
398-
global $hook_suffix;
399-
400-
// Just add if we are at the plugin page
401-
if ( strpos($hook_suffix, $this->getPluginSlug() . '_log' ) == false )
402-
return $contextual_help;
403-
404-
// The add_help_tab function for screen was introduced in WordPress 3.3.
405-
if ( ! method_exists( $screen, 'add_help_tab' ) )
406-
return $contextual_help;
407-
408-
409-
// List screen properties
410-
$left = '<div style="width:50%;float:left;">'
411-
. '<h4>About this plugin</h4>'
412-
. '<p>This plugin is open source.</p>'
413-
. '</div>';
414-
415-
416-
$right = '<div style="width:50%;float:right;">'
417-
. '<h4>Donate</h4>'
418-
. '<p>If you like the plugin please consider to make a donation. More information are provided on my <a href="http://no3x.de/web/donate">website</a>.</p>'
419-
. '</div>';
420-
421-
$help_content = $left . $right;
422-
423-
/**
424-
* Content specified inline
425-
*/
426-
$screen->add_help_tab(
427-
array(
428-
'title' => __('About Plugin', 'wp-mail-logging'),
429-
'id' => 'about_tab',
430-
'content' => '<p>' . __( "{$this->getPluginDisplayName()}, logs each email sent by WordPress.", 'wp-mail-logging') . '</p>' . $help_content,
431-
'callback' => false
432-
)
433-
);
434-
435-
// Add help sidebar
436-
$screen->set_help_sidebar(
437-
'<p><strong>' . __('More information', 'wp-mail-logging') . '</strong></p>' .
438-
'<p><a href = "http://wordpress.org/extend/plugins/wp-mail-logging/">' . __('Plugin Homepage/support', 'wp-mail-logging') . '</a></p>' .
439-
'<p><a href = "http://no3x.de/">' . __("Plugin author's blog", 'wp-mail-logging') . '</a></p>'
440-
);
441-
442-
// Add screen options
443-
$screen->add_option(
444-
'per_page',
445-
array(
446-
'label' => __('Entries per page', 'wp-mail-logging'),
447-
'default' => 25,
448-
'option' => 'per_page'
449-
)
450-
);
451-
452-
return $contextual_help;
453-
}
454-
455402
/**
456403
* Save Screen option
457404
* @since 1.3

0 commit comments

Comments
 (0)