<?php // don't copy this line | |
/** | |
* @snippet WooCommerce: My Account Orders Pagination - per page setting | |
* @source https://kybernaut.cz/?p=2896 | |
* @author Karolína Vyskočilová (https://kybernaut.cz) | |
* @testedwith WordPress 5.2 & WooCommmerce 3.6.2 | |
*/ | |
// ------------------- | |
function kbnt_my_account_orders( $args ) { | |
$args['posts_per_page'] = 15; // add number or -1 (display all orderes per page) | |
return $args; | |
} | |
add_filter( 'woocommerce_my_account_my_orders_query', 'kbnt_my_account_orders', 10, 1 ); |
I don't think it's possible via filter (maybe you could add some logic via JS). I don't use downloads myself, but there is no pagination or querying, it just displays all the downloads, right? This function is responsible for it: https://github.com/woocommerce/woocommerce/blob/bf29119032954313970752372aec1e485a2095c4/plugins/woocommerce/includes/class-wc-customer.php#L228
Thank you for your answer. Yes, I did a lot of research to do it through a filter, but unfortunately it is not possible. I did it with datatables js, but I was wondering if there was a simpler way.
You're welcome. My fingers crossed with the JS solution.
@wpressall Do you have a solution for pagination in my account / downloads ? I would also be very happy to have it. Thanks!
Thanks for sharing, so how can we implement this on the product downloads page? ( .../my-account/my-downloads/ )