overriding / customizing sdm-fancy-2.php?
-
Hi,
Is there a way to override / customize sdm-fancy-2.php as I need to make a slight change to the sdm_generate_fancy2_display_output function in that file?
Thanks,
Rob
-
Hi Rob, what kind of customization are you trying to achieve?
Thank you.
Hi,
Thanks for the quick reply.
Within the sdm-fancy-2.php file at
wp-content\plugins\simple-download-monitor\includes\templates\fancy2\sdm-fancy-2.php
in the sdm_generate_fancy2_display_output function on line 107 changing the $button_text variable to get_the_title( $id ) works for the functionality I need, which is making the button text the same as the title.
So how would I be able to do that by overriding it so the changes are not lost when the plugin updates?
Thanks,
RobHi,
Sorry it should be get_the_title( $id ) that replaces the $button_text variable in the sdm_generate_fancy2_display_output function on line 107 that works for the functionality I need, which is making the button text the same as the title.
I have edited the previous reply to correct it now.
Thanks,
Rob-
This reply was modified 4 years, 1 month ago by
rdm100.
Hi Rob, unfortunately at present you will loose the customized file when the plugin is updated. I have submitted a message to the plugin developers to investigate further your request.
Kind regards.
We have the following filter hook that you can use to fully override the shortcode output:
https://simple-download-monitor.com/simple-download-monitor-filter-hook-reference/#sdm_download_shortcode_outputIf you want a more specific filter hook for your specific customization requirement, you can tell us where in the code you want a hook and we will try to add it to the plugin’s code.
If you are familiar with github, you can create a pull request on our following github repository with the filter hook that you want to add to the core plugin:
https://github.com/Arsenal21/simple-download-monitorHi,
Thanks for the quick reply.
Could you add a filter to the ‘sdm_generate_fancy2_display_output’ function in sdm-fancy-2.php?
Thanks,
RobSure. I have added a filter for it. You can see the code reference in the following URL:
https://github.com/Arsenal21/simple-download-monitor/blob/c7e4ef98beabf08dbfed65d079f110a181970213/simple-download-monitor/includes/templates/fancy2/sdm-fancy-2.php#L203It hasn’t been released yet so if you want to try it now, you can download a copy from the github repository and use it.
Hi,
That is great and thanks for the quick reply.
I tested the hook and it works.
Will you put the change out in your next update and when approximately will that be so I can look out for it?
Thanks,
RobYes, it has been added to the core plugin’s code so it will be included in the next update.
Hi,
Ok Thanks.
Rob
Hi,
Could you please also add a filter to sdm_generate_fancy1_display_output in plugins/simple-download-monitor/includes/templates/sdm-fancy-1.php as that would also be very helpful?
Thanks,
RobDone. I have released a new update that has the filter.
Hey,
Thanks again for being so responsive!
Rob
-
This reply was modified 4 years, 1 month ago by
The topic ‘overriding / customizing sdm-fancy-2.php?’ is closed to new replies.