Beispiel #1
0
/**
* Code Embed Menu
*
* Add a new option to the Admin menu and context menu
*
* @since	1.4
*
* @uses ace_help		Return help text
*/
function ace_menu()
{
    // Depending on WordPress version and available functions decide which (if any) contextual help system to use
    $contextual_help = ace_contextual_help_type();
    // Add main admin option
    add_menu_page('Artiss Code Embed Settings', 'Code Embed', 'edit_posts', 'ace-search', 'ace_search', plugins_url() . '/simple-embed-code/images/menu_icon.png');
    // Add search sub-menu
    if ($contextual_help == 'new') {
        global $ace_search_hook;
    }
    $ace_search_hook = add_submenu_page('ace-search', 'Artiss Code Embed Search', 'Search', 'edit_posts', 'ace-search', 'ace_search');
    if ($contextual_help == 'new') {
        add_action('load-' . $ace_search_hook, 'ace_add_search_help');
    }
    if ($contextual_help == 'old') {
        add_contextual_help($ace_search_hook, ace_search_help());
    }
    // Add options sub-menu
    if ($contextual_help == 'new') {
        global $ace_options_hook;
    }
    $ace_options_hook = add_submenu_page('ace-search', 'Artiss Code Embed Settings', 'Options', 'manage_options', 'ace-options', 'ace_options');
    if ($contextual_help == 'new') {
        add_action('load-' . $ace_options_hook, 'ace_add_options_help');
    }
    if ($contextual_help == 'old') {
        add_contextual_help($ace_options_hook, ace_options_help());
    }
    // Add readme sub-menu
    if (function_exists('wp_readme_parser')) {
        add_submenu_page('ace-search', 'Artiss Code Embed README', 'README', 'edit_posts', 'ace-readme', 'ace_readme');
    }
    // Add support sub-menu
    add_submenu_page('ace-search', 'Artiss Code Embed Support', 'Support', 'edit_posts', 'ace-support', 'ace_support');
}
Beispiel #2
0
*
* @package	Artiss-Code-Embed
* @since	1.6
*
* @uses	ace_get_embed_paras	Get the options
*/
?>
<div class="wrap">
<div class="icon32"><img src="<?php 
echo plugins_url();
?>
/simple-embed-code/images/screen_icon.png" alt="" title="" height="32px" width="32px"/><br /></div>
<h2>Artiss Code Embed Search</h2>

<?php 
if (!ace_contextual_help_type()) {
    _e(ace_search_help());
} else {
    echo '<p>' . __('Enter the suffix to search for below and press the \'Search\' button to view the results. Further help can be found by clicking on the Help tab at the top right-hand of the screen.') . '</p>';
}
?>

<?php 
// Get the suffix - either from the submitted field or via the URL line
if (isset($_GET['suffix'])) {
    $suffix = htmlspecialchars($_GET['suffix']);
} else {
    if (!empty($_POST) && check_admin_referer('code-embed-search', 'code_embed_search_nonce')) {
        $suffix = htmlspecialchars($_POST['ace_suffix']);
    } else {
        $suffix = '';