• Resolved rdm100

    (@rdm100)


    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

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi Rob, what kind of customization are you trying to achieve?

    Thank you.

    Thread Starter rdm100

    (@rdm100)

    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,
    Rob

    • This reply was modified 2 years, 7 months ago by rdm100.
    • This reply was modified 2 years, 7 months ago by rdm100.
    Thread Starter rdm100

    (@rdm100)

    Hi,

    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 2 years, 7 months ago by rdm100.
    Plugin Contributor mbrsolution

    (@mbrsolution)

    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.

    Plugin Author mra13

    (@mra13)

    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_output

    If 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-monitor

    Thread Starter rdm100

    (@rdm100)

    Hi,

    Thanks for the quick reply.

    Could you add a filter to the ‘sdm_generate_fancy2_display_output’ function in sdm-fancy-2.php?

    Thanks,
    Rob

    Plugin Author mra13

    (@mra13)

    Sure. 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#L203

    It 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.

    Thread Starter rdm100

    (@rdm100)

    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,
    Rob

    Plugin Author mra13

    (@mra13)

    Yes, it has been added to the core plugin’s code so it will be included in the next update.

    Thread Starter rdm100

    (@rdm100)

    Hi,

    Ok Thanks.

    Rob

    Thread Starter rdm100

    (@rdm100)

    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,
    Rob

    Plugin Author mra13

    (@mra13)

    Done. I have released a new update that has the filter.

    Thread Starter rdm100

    (@rdm100)

    Hey,

    Thanks again for being so responsive!

    Rob

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘overriding / customizing sdm-fancy-2.php?’ is closed to new replies.