Title: Create plugin with hook
Last modified: August 18, 2016

---

# Create plugin with hook

 *  [cruelladeville](https://wordpress.org/support/users/cruelladeville/)
 * (@cruelladeville)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/create-plugin-with-hook/)
 * I strive with the Simple Tagging plugin, and tries to experiment with making 
   things appear in my post form. So – I created this tiny plugin, which only function
   is to write something to my post-form page, but nothing happens.
 * My code:
 *     ```
       <?php
       /*
       Plugin Name: my plugin test
       Plugin URI:
       Description: blablabla
       Version: 1.3
       Author: Siv
       Author URI:
       */
   
       add_filter('simple_edit_form', 'srh_print_dill');
       function srh_print_dill(){
       	print "this should be displayed below my post form";
       }
   
       ?>
       ```
   
 * I found a do_action(‘simple_edit_form’,”) in my edit_post.php file (in admin 
   folder), but I really don’t understand what this means. When I read the codex
   all the examples are generic, and I’m not able to find an explanation of simple_edit_form
   nor do_action().
 * If anyone has a good idea I’ll be overlykkelig! (norwegian for very, very, very,…..,
   very happy)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Lester Chan](https://wordpress.org/support/users/gamerz/)
 * (@gamerz)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/create-plugin-with-hook/#post-521163)
 * use
 *     ```
       add_action('simple_edit_form', 'srh_print_dill');
       ```
   
 *  Thread Starter [cruelladeville](https://wordpress.org/support/users/cruelladeville/)
 * (@cruelladeville)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/create-plugin-with-hook/#post-521198)
 * Thanks, but that made no different. But I refactorated the plugin and now I’m
   able to print the word “ushj” where the form should be, but the form it self 
   does not appear.
    I can print out strings right ’till the form starts, but then
   it stops.
 *     ```
        print "tralalala";
       print '<div id="lptagstuff" class="sta-group">            <fieldset class="sta-box" id="posttags">
       <h3 class="sta-handle">'
       . __('Tags (comma separated list)') . '</h3>
       <div class="sta-content">
       <input class="wickEnabled" name="tag_list" id="stp_tag_entry" value="' . $post_tags . '" />
       					<input type="hidden" name="simpletaggingverifykey" id="simpletaggingverifykey" value="' . wp_create_nonce('simpletagging') . '" />' . '
       					<script type="text/javascript" language="JavaScript">'
       . $ta_result . '</script>
       					<script type="text/javascript" language="JavaScript" src="' . $this->sTagObj->info['install_url'] . '/simpletagging.type-ahead.js"></script>
       <div id="stp_taglist">
       <h4>' . (($opt['dsp_suggested']) ? 'Suggested Tags' :
       'Tags') . ':</h4>
       <p>' . $result_tags_str . '</p>
       <div id="clearer">&nbsp;</div>
       </div>
       </div>
       </fieldset>
       </div>';
       ```
   
 * The “tralala” gets printed, the following not. What is this????
 *  [csautot](https://wordpress.org/support/users/csautot/)
 * (@csautot)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/create-plugin-with-hook/#post-521573)
 * Maybe you shouldn’t use multiple print statements and do something like:
 * [PHP heredoc notation](http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc):
 *     ```
       add_filter('simple_edit_form', 'srh_print_dill');
   
       function srh_print_dill()
       {
          echo <<<EOHTML
   
             this should be displayed below my post form
   
             some more text on another line
   
       EOHTML;
       }
       ```
   
 * OR
 *     ```
       add_filter('simple_edit_form', 'srh_print_dill');
   
       function srh_print_dill()
       {
          ?>
             this should be displayed below my post form
   
             some more text on another line
          <?php
       }
       ```
   
 *  [csautot](https://wordpress.org/support/users/csautot/)
 * (@csautot)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/create-plugin-with-hook/#post-521574)
 * Another thing to watch for that is mentioned in this forum post:
 * [http://wordpress.org/support/topic/51631](http://wordpress.org/support/topic/51631)
 * is that if you want your added XHTML to show up when you have gone to Manage 
   > Posts or Manage > Pages, you need to use the edit_form_advanced hook as well.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Create plugin with hook’ is closed to new replies.

## Tags

 * [hook](https://wordpress.org/support/topic-tag/hook/)

 * 4 replies
 * 3 participants
 * Last reply from: [csautot](https://wordpress.org/support/users/csautot/)
 * Last activity: [18 years, 6 months ago](https://wordpress.org/support/topic/create-plugin-with-hook/#post-521574)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
