dannyo
El Presidente
Just Getting Started
Member Likes (0)
Hi,
I cleaned up my Fundraiser Panel widget a bit and edited template-functions.php. Although I am happy (so far) with the results, I'm concerned that an update to the plugin will affect my changes.
What do you recommend I do to make my changes immune to a plugin update? My changes are merely commenting out certain parts of the widget.
1. Remove the "None" button by commenting /fundraising/lib/template-functions.php as:
/*
$content .= '
<div class="wdf_reward_item">
<div class="wdf_reward_choice"><input type="radio" name="wdf_reward" value="none" /></div>
<div class="wdf_reward_description">'.apply_filters('wdf_no_reward_description',__('None','wdf')).'</div>
</div>';
*/
2. Remove custom donation label and text field for variable pledge amount by commenting /fundraising/lib/template-functions.php as:
/*
$content .= '<div class="wdf_custom_donation_label">'.apply_filters('wdf_choose_amount_label',__('Choose An Amount','wdf')).'</div>';
$content .= ($settings['curr_symbol_position'] == 1 || $settings['curr_symbol_position'] == 2 ? '<span class="currency">'.$wdf->format_currency().'</span>' : '');
$content .= '<input type="text" name="wdf_pledge" class="wdf_pledge_amount" value="" />';
*/

Responses (3)
Support Hamster (joined March 2012) Likes (0)
I can think of 4 potential solutions:
1. Set file permissions to not writable. This way, when the update kicks in this file will be spared. The downside to this is that you may miss some other updates to this file.
2. Don't do anything and when the plugin updates, remember to comment these lines again.
3. put this file on git and track any changes.
4. copy the functions to your theme's functions.php file, rename them, edit them the way you want them and then call them in a custom template file in your theme.
Support Chimp (joined March 2010) Likes (0)
Hey there.
Some sound advice here from aristath.
Unfortunately there isn't such thing as a child plugin like themes, so upon every update that will would be overwritten. Whilst preventing it being overwritten this could have adverse consequences if for example a function is depreciated or changes somehow, you could also miss feature updates.
Where filters are used you can remove those and then apply your own from your theme or plugin which is what I think aristath was also suggestion in point 4.
Of course if these changes are something which could be optional and something others want then we could make this a request for the developer to look at if there is enough interest.
Take care.
Support Hamster (joined March 2012) Likes (0)
@Timothy that's exactly what I meant.... Thanks for the clarification.
Become a member