Tips and Tricks HQ Support Portal › Forums › WP PDF Stamper › Available hooks for button with stamper
- This topic has 6 replies, 2 voices, and was last updated 7 years, 5 months ago by admin.
-
AuthorPosts
-
June 13, 2017 at 2:30 pm #14313trock3Participant
Hello. We are trying to add some hook code to our site related to your plugin. I am having some trouble while overriding some functions using Hook & filter. Could you please tell me what hook function exists for the following function?
Function for which I need a hook:
function eStore_show_download_now_button_with_stamping()
Thanks.
June 13, 2017 at 11:01 pm #75862trock3ParticipantAny help on this would be appreciated!
June 13, 2017 at 11:40 pm #75863adminKeymasterWe don’t have any hook in the following function at this stage:
function eStore_show_download_now_button_with_stamping()
If you tell us what action/filter hook you want in there and we will add it.
June 14, 2017 at 12:35 pm #75864trock3ParticipantThanks for the response.
You can create any hook/filter function, i will get it and use according to that.
June 15, 2017 at 12:56 am #75865adminKeymasterYou kind of need to tell me what you are trying to do so I know where to add the hook and what arguments that hook should pass. Otherwise if I just create a hook at the start of the function that probably won’t be helpful for you.
June 16, 2017 at 12:36 pm #75866trock3ParticipantOK, here’s what we are looking for:
#1) Add following ***filter***
Location: eStore-extra-shortcodes/shortcode_include.php
Function name:
function eStore_show_download_now_button_with_stamping($id, $view = 0) {
How to add filter:
// this is the function in which filter has to be include
function eStore_show_download_now_button_with_stamping($id, $view = 0) {
// Add this filter code just before the form
$output = apply_filters(‘eStore_before_button_display_filter’, $id);
$output .= ‘<form method=”post” action=”” style=”display:inline”>’;
}
#2) Add following ***action***
Location: wp-cart-for-digital-products/download.php
Function name:
function download_dispatch($file_path, $file_name, $force_method=FALSE) {
How to add filter:
// Add this action before **** switch($eStore_dl_method) {
function download_dispatch($file_path, $file_name, $force_method=FALSE) {
// Add this action before **** switch($eStore_dl_method) {
do_action(‘eStore_before_download_stamp_file’, $_GET );
switch($eStore_dl_method) {
}
Hopefully that clarifies.
June 17, 2017 at 3:36 am #75867adminKeymasterOk good. We have added the following filter to the extra shortcodes addon:
$output = apply_filters(‘eStore_download_now_stamping_before_button_display_form’, $id);
You can download the new version of the extra shortcodes addon now to get it.
Regarding the hook in the download handling script, it is not necessary since we already have a better hook for it. Tell your developer that they can use the following existing action hook of eStore to intercept a download request and override it:
do_action(‘eStore_action_download_file’,$file_path);
The $_GET argument is a global one so it shouldn’t be passed to a function. The function handling the action hook already has access to that variable.
-
AuthorPosts
- You must be logged in to reply to this topic.