Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('woocommerce_single_product_summary', 'display_psm_meta', 5);
- function display_psm_meta() {
- // echo the content from the wp_editor here
- }
- add_action( 'admin_menu', 'hooked_content_page', 9999 );
- function hooked_content_page() {
- add_submenu_page( 'edit.php?post_type=product', 'Hooked Content', 'Hooked Content', 'edit_products', 'hooked_content', 'hooked_content_page_callback', 9999 );
- }
- function hooked_content_page_callback() {
- if(isset($_POST['psm_content'])){
- update_option('psm_content', $_POST['psm_content']); } ?>
- <div class='wrap'>
- <h2>Hooked Content</h2>
- <form method='post'> <?php
- $content = get_option('psm_content');
- wp_editor( $content, 'psm_content', $settings = array('textarea_rows'=> '10') );
- submit_button('Save', 'primary'); ?>
- </form>
- </div>
- <?php
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement