TransWikia.com

where is admin footer?

WordPress Development Asked by Alif Azhar on December 8, 2021

hi im working on my new wordpress website. and i wanted to add custom order status in my woocommerce order status and i found this code:-

function custom_bulk_admin_footer() {
            global $post_type;

            if ( $post_type == 'shop_order' ) {
                ?>
                    <script type="text/javascript">
                        jQuery(document).ready(function() {
                            jQuery('<option>').val('mark_invoiced').text('<?php _e( 'Mark invoiced', 'textdomain' ); ?>').appendTo("select[name='action']");
                            jQuery('<option>').val('mark_invoiced').text('<?php _e( 'Mark invoiced', 'textdomain' ); ?>').appendTo("select[name='action2']");   
                        });
                    </script>
                <?php
            }
        }

the question is , where should i put the code ? should i put it in my theme function.php ? or put it in admin_footer? if so can someone navigate me to the admin_footer section?

One Answer

So the question that you found this code from here says that they added this to the admin_footer action. So you could add that custom_bulk_admin_footer to your functions.php, and then hook it into the admin_footer action with this after the function:

add_action('admin_footer', 'custom_bulk_admin_footer');

Obviously you need to change the jQuery code to do what you want inside the function too ;-)

HTH

Answered by mozboz on December 8, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP