Download button in backend post edit page

WordPress
1 April, 2021 01:03:35
eliodata
Topics: 14
Messages: 43
Hi there,
We use e2pdf to generate invoices from custom post types custom fields. We do not need front end for these post types, and prefer to completely disable front end access for security reasons.
Is it possible to add a pdf download button in the back end cpt edit pages please?
Best regards
1 April, 2021 02:36:04
E2Pdf
Support
Topics: 7
Messages: 3188
Hi,

Unfortunately export in backend available only at "E2Pdf" -> "Export" page. We are working on this feature to add link inside metabox, however currently it will require custom coding to add custom metabox to needed post type where will be fired shortcode via PHP:

echo do_shortcode('[e2pdf-download id="1" dataset="'. $post_id .'"]');

P.S. $post_id is the ID of the Post for which must be generated download link.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
1 April, 2021 09:41:13
eliodata
Topics: 14
Messages: 43
Thank you for the kind and quick answer. As usual.
I dont Know how to make this work, so I will wait for the feature.
But if you can give me more time maybe you could help knowing that I use metabox.io plugin to create cpt and custome fields. I can create a metabox for the "clients" cpt but no idea how to render your shortcode with it into the cpt wordoress editor page...
Regards
1 April, 2021 10:59:18
E2Pdf
Support
Topics: 7
Messages: 3188
We do not familiar with metabox.io yet, however we think it doesn't allow add PHP code directly.

So we currently prepared simple example which will add metabox with download PDF button:
https://codeshare.io/29AZnK

It must be added to your theme functions.php or via PHP Snippet plugin.

Currently you will need to change:
1. Post Type, which currently set to "page". You must be able to detect it in url while editing
'page' //page must be replaced with custom post type

2. Change the ID of E2Pdf Template (currently 1) to your in shortcode:
echo do_shortcode('[e2pdf-download id="1" dataset="' . $page->ID . '"]');

Currently it must show download link while edit post custom post type if you will make changes correctly and this custom post type doesn't have some specific hooks which prevent default wordpress functionality.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
1 April, 2021 11:54:07
eliodata
Topics: 14
Messages: 43
Best support I ever seen for a free version! And many paid plugin support will not help so far and so fast.

Hope you the best.

Many thanks!