false ), $atts) ); if ( !$id ) return ''; $snippet = get_option('rhs_snippet-' . $id); return $snippet; } add_action('admin_menu', 'rhs_raw_html_snippet_admin_menu'); function rhs_raw_html_snippet_admin_menu() { add_submenu_page('options-general.php', 'Raw HTML Snippets', 'Raw HTML Snippets', 'edit_posts', 'raw-html-snippets', 'rhs_raw_html_snippet_settings'); } function rhs_raw_html_snippet_settings() { if ( $_GET['edit'] ) return rhs_raw_html_snippet_editor(); if ( $_GET['add'] ) return rhs_raw_html_snippet_add(); $errors = array(); $clean = array(); if ( $_GET['rhs_del'] && wp_verify_nonce($_GET['rhs_nonce'], 'rhs_delete') ) { delete_option('rhs_snippet-' . $_GET['rhs_del']); $snippet_list = get_option('rhs_snippet_list'); if ( is_array($snippet_list) && in_array($_GET['rhs_del'], $snippet_list) ) { $snippet_list = array_diff( $snippet_list, array( $_GET['rhs_del'] ) ); update_option('rhs_snippet_list', $snippet_list); $success = 'Snippet with ID "' . esc_html($_GET['rhs_del']) . '" successfully deleted.'; } } $snippet_list = get_option('rhs_snippet_list'); if ( !is_array($snippet_list) ) $snippet_list = array(); ?>
Create and manage your HTML snippets here. Name them with an id (letters, numbers, and dashes only) and then
call them within your content via shortcode:
[raw_html_snippet id="my-unique-id"]
This will use maintain core WordPress content filtering and autoformatting for all other elements within your content while allowing you to easily insert managed RAW HTML.
WARNGING: This does not filter your HTML for errors or for malicious scripts. Use at your own risk.
0 ) : ?>| Snippet Name | Shortcode | Actions |
|---|---|---|
[raw_html_snippet id=""]
|
Edit Snippet | Delete Snippet |
You have no snippets, please please add one.