admin管理员组

文章数量:1391999

I need to add a form after closing form tag in woocommerce admin order edit page. I need to do this because the action of this form points to an iframe...

ex:

<form action='someurl' target='myiframe'>
   <input type='hidden' value='myvalue' /> 
</form>
<iframe id='myiframe' src='someurl'></iframe>

I need to put anywhere in order details admin page... I researching by two days.. the only way i found is in the admin_footer, but the layout breaks.

with admin_footer hook the there are two or three div.clear between the default form and my form...

I'm asking this here because i think it is just a custom post type... if doesn't i'm sorry for that.

I'm thinking in place this form in order list admin page!!! anyone can help me?

thanks for helping!

I need to add a form after closing form tag in woocommerce admin order edit page. I need to do this because the action of this form points to an iframe...

ex:

<form action='someurl' target='myiframe'>
   <input type='hidden' value='myvalue' /> 
</form>
<iframe id='myiframe' src='someurl'></iframe>

I need to put anywhere in order details admin page... I researching by two days.. the only way i found is in the admin_footer, but the layout breaks.

with admin_footer hook the there are two or three div.clear between the default form and my form...

I'm asking this here because i think it is just a custom post type... if doesn't i'm sorry for that.

I'm thinking in place this form in order list admin page!!! anyone can help me?

thanks for helping!

Share Improve this question asked Feb 19, 2020 at 12:55 Reculos Gerbi NetoReculos Gerbi Neto 1033 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

You can use the other action which called before wp_footer. You can use action "in_admin_footer"

// define the in_admin_footer callback 
function action_in_admin_footer() { 
    global $pagenow, $current_page, $post;

    //$current_page->post_type === 'shop_order' 

    if( $pagenow == 'post.php' && !empty( $_GET['action'] ) && $_GET['action'] == 'edit' && $post->post_type == 'shop_order' ) {
        // make action magic happen here... 
    }
}; 

// add the action 
add_action( 'in_admin_footer', 'action_in_admin_footer' ); 

本文标签: custom post typesAdd form after woocommerce admin order edit