Title: Function Missing a Hook?
Last modified: August 20, 2016

---

# Function Missing a Hook?

 *  [ktrusak](https://wordpress.org/support/users/ktrusak/)
 * (@ktrusak)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/function-missing-a-hook/)
 * I am using a draft_to_rejected action hook to update some post meta (‘rejected’
   is a custom status). Which works fine on the backend when I select rejected from
   the drop down and hit save. However, I have a following function to update the
   post status from the frontend, which doesn’t seem to trigger the action
 * frontend function:
 *     ```
       function change_post_status($post_id,$status){
           $current_post = get_post( $post_id, 'ARRAY_A' );
           $current_post['post_status'] = $status;
           wp_update_post($current_post);
       }
   
       function show_reject_button(){
           Global $post;
   
               echo '<form name="front_end_reject" method="POST" action="">
                       <input type="hidden" name="pid2" id="pid2" value="'.$post->ID.'">
                       <input type="hidden" name="FE_REJECT" id="FE_REJECT" value="FE_REJECT">
                       <input type="image" src="https://----.com/images/logo1/sreject.png" alt="reject" title="Reject this reservation" style="background: none !important; border: none !important;">
                   </form>';
   
       }
   
       if (isset($_POST['FE_REJECT']) && $_POST['FE_REJECT'] == 'FE_REJECT'){
           if (isset($_POST['pid2']) && !empty($_POST['pid2'])){
               change_post_status((int)$_POST['pid2'],'rejected');
           }
       }
       ```
   
 * And it is missing this action:
 * `add_action ('draft_to_rejected', 'void_payment_hold' );`
 * Does anyone know what hook/action or whatever is not getting hit by using the
   button to trigger that action?

The topic ‘Function Missing a Hook?’ is closed to new replies.

## Tags

 * [frontend](https://wordpress.org/support/topic-tag/frontend/)
 * [hook](https://wordpress.org/support/topic-tag/hook/)
 * [Post-Status](https://wordpress.org/support/topic-tag/post-status/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [ktrusak](https://wordpress.org/support/users/ktrusak/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/function-missing-a-hook/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
