1
0
Fork 0
SemmelstatzR/trunk/includes/help/v33/sample.php

82 Zeilen
3,4 KiB
PHP

2011-11-15 16:43:23 +00:00
<?php
/*
Plugin Name: Sample 3.3 Help Tabs Plugins
Plugin URI: http://pippinsplugins.com/
Description: Put custom functions in this plugin
Author: Pippin Williamson
Author URI: http://pippinsplugins.com
Version: 1.0
*/
add_action('admin_menu', 'pippin_admin_add_page');
function pippin_admin_add_page() {
global $pippin_options_page;
$pippin_options_page = add_options_page(__('Sample Help Tabs', 'pippin'), __('Sample help Tabs', 'pippin'), 'manage_options', 'options-test', 'pippin_options_page');
add_action("load-$pippin_options_page", 'pippin_plugin_help_tabs');
}
function pippin_plugin_help_tabs() {
global $pippin_options_page;
$screen = get_current_screen();
if($screen->id != $pippin_options_page)
return;
$screen->add_help_tab(array(
'id' => 'pippins-usage',
'title' => __('Using the Plugin', 'pippin'),
'content' => pippin_help_tab_content('pippin-usage')
));
$screen->add_help_tab(array(
'id' => 'pippins-settings',
'title' => __('Plugin Settings', 'pippin'),
'content' => pippin_help_tab_content('pippin-settings')
));
$screen->add_help_tab(array(
'id' => 'pippins-css',
'title' => __('Custom CSS', 'pippin'),
'content' => pippin_help_tab_content('pippin-css')
));
}
function pippin_help_tab_content($tab = 'pippin-usage') {
if($tab == 'pippin-usage') {
ob_start(); ?>
<h3><?php _e('Using the plugin', 'pippin'); ?></h3>
<p>In scelerisque, placerat nec urna in pulvinar rhoncus vut dolor tincidunt dapibus in ac massa sit tristique egestas? Non, integer dis massa egestas eros! Elementum vel rhoncus! Et lorem sed lundium nascetur amet! Et scelerisque sit. Egestas tincidunt, quis enim urna arcu mattis rhoncus nisi nec enim tincidunt! Augue magnis.</p>
<p>In scelerisque, placerat nec urna in pulvinar rhoncus vut dolor tincidunt dapibus in ac massa sit tristique egestas? Non, integer dis massa egestas eros! Elementum vel rhoncus! Et lorem sed lundium nascetur amet! Et scelerisque sit. Egestas tincidunt, quis enim urna arcu mattis rhoncus nisi nec enim tincidunt! Augue magnis.</p>
<?php
return ob_get_clean();
} elseif ($tab == 'pippin-settings') {
ob_start(); ?>
<h3><?php _e('Plugin Settings', 'pippin'); ?></h3>
<p>In scelerisque, placerat nec urna in pulvinar rhoncus vut dolor tincidunt dapibus in ac massa sit tristique egestas? Non, integer dis massa egestas eros! Elementum vel rhoncus! Et lorem sed lundium nascetur amet! Et scelerisque sit. Egestas tincidunt, quis enim urna arcu mattis rhoncus nisi nec enim tincidunt! Augue magnis.</p>
<?php
return ob_get_clean();
} elseif ($tab == 'pippin-css') {
ob_start(); ?>
<h3><?php _e('Custom CSS', 'pippin'); ?></h3>
<p>In scelerisque, placerat nec urna in pulvinar rhoncus vut dolor tincidunt dapibus in ac massa sit tristique egestas? Non, integer dis massa egestas eros! Elementum vel rhoncus! Et lorem sed lundium nascetur amet! Et scelerisque sit. Egestas tincidunt, quis enim urna arcu mattis rhoncus nisi nec enim tincidunt! Augue magnis.</p>
<ul>
<li>List Item Sample</li>
<li>List Item Sample</li>
<li>List Item Sample</li>
<li>List Item Sample</li>
</ul>
<?php
return ob_get_clean();
}
}
function pippin_options_page() {
ob_start(); ?>
<div class="wrap">
<h2><?php _e('Sample Help Tab', 'pippin'); ?></h2>
<p>This is out settings page content. Click the "Help" menu above to see the new help tabs.</p>
</div>
<?php
echo ob_get_clean();
}
?>