Q:

Wordpress: How to add element to Woocommerce order page

I have a woocommerce shop, and I want to be able show orders where a custom field has a value of today.
I realized that it can be done by going to a certain url, since updating the HTTP query string will get the job done. I'm thinking of something likes this: 'domain.com/wp-admin/edit.php?order_by=abc&date=DATE_HERE&somethingelse'
So how can I put an html <a>-element on the woocommerce orders page, and how can I update the href automatically using javascript? Which php action hooks should I use?

A:

The following code will add a custom button, based on your attached image. Why should the href update be done via javascript and not with php?
// Add action button
function my_manage_posts_extra_tablenav( $which ) {
    global $pagenow, $typenow;

    if ( $typenow === 'shop_order' && $pagenow === 'edit.php' && $which === 'top' ) {
        ?>
        <div class="alignleft actions custom">
            <button type="submit" name="custom" style="height:32px;" class="button" value="">
            <?php echo __( 'Custom', 'woocommerce' ); ?>
            </button>
        </div>
        <?php
    }
}
add_action( 'manage_posts_extra_tablenav', 'my_manage_posts_extra_tablenav', 20, 1 );

