Support » Fixing WordPress » 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;
    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="" alt="reject" title="Reject this reservation" style="background: none !important; border: none !important;">
    if (isset($_POST['FE_REJECT']) && $_POST['FE_REJECT'] == 'FE_REJECT'){
        if (isset($_POST['pid2']) && !empty($_POST['pid2'])){

    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.