awesomemotive / easy-digital-downloads

Sell digital downloads through WordPress
https://easydigitaldownloads.com
GNU General Public License v2.0
868 stars 473 forks source link

[Feature Request] Column actions in purchase history #4837

Open rubengc opened 8 years ago

rubengc commented 8 years ago

On purchase history page, some official plugins adds a column for their actions (Reviews 2.0, EDD Invoices, PDF Invoices)

This could be improved adding a single actions column where those plugins could add their custom actions

what do you think?

cklosowski commented 8 years ago

If we do this route I think there are a few concerns I'd have and it's related to continuity.

I think what I'd like to see is instead of adding items to it, plugin developers can provide a title attribute and if they want to a link attribute. We can set an empty array into the filter, and then any extensions can add their own link and title to the array and we'll just foreach through the array so we can use a standard separator character like a | or something.

The goal is someone could do something as simple as (psudo code here)

function my_function( $actions, $payment_id ) {
    $actions['my-action'] = array( 'title' => 'My Title', 'link' => 'http://example.org/' );

    return $actions;
}
add_filter( 'filter_name', 'my_function', 10, 2 );
cklosowski commented 8 years ago

Not sure why anyone would link back to the hompepage but I think that gives the idea of what I'm going for ;)