Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. add_action('woocommerce_single_product_summary', 'display_psm_meta', 5);
  2. function display_psm_meta() {
  3. // echo the content from the wp_editor here
  4. }
  5.  
  6. add_action( 'admin_menu', 'hooked_content_page', 9999 );
  7. function hooked_content_page() {
  8. add_submenu_page( 'edit.php?post_type=product', 'Hooked Content', 'Hooked Content', 'edit_products', 'hooked_content', 'hooked_content_page_callback', 9999 );
  9. }
  10.  
  11. function hooked_content_page_callback() {
  12. if(isset($_POST['psm_content'])){
  13. update_option('psm_content', $_POST['psm_content']); } ?>
  14. <div class='wrap'>
  15. <h2>Hooked Content</h2>
  16. <form method='post'> <?php
  17. $content = get_option('psm_content');
  18. wp_editor( $content, 'psm_content', $settings = array('textarea_rows'=> '10') );
  19. submit_button('Save', 'primary'); ?>
  20. </form>
  21. </div>
  22. <?php
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement