Support

Home Forums Custom Files Add-on (EE3) Override advanced_settings.php?

Override advanced_settings.php?

Posted: July 16, 2012 at 3:00 am


emarienborg

July 16, 2012 at 3:00 am

Hi,

I’m running Event Espresso 3.1.24.3.P. Things seem to be working fine, I just have one question. Or actually two. I’ll get to that.

In the “Add new event” page, I want to change the default value of the “Additional Attendee Registration info?” dropdown. This is set in the includes/admin-files/event-management/advanced_settings.php file, and I’ve managed to succesfully alter the code her to make the change I want.

But this will break on future upgrades. So I need a different approach.

I have the custom files addon. But since the dropdown is not made in a separate function, I guess I won’t be able to override it with that?

So, then I’m wondering if there is any other way to achieve what I’m looking for?

My second question is a more long-term one:

The advanced_settings.php file is called by includes/event-management/add_new_event.php with this code:

if (file_exists(EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/admin-files/event-management/advanced_settings.php')) {
            require_once(EVENT_ESPRESSO_PLUGINFULLPATH . "includes/admin-files/event-management/advanced_settings.php");
        } else {

Wouldn’t it be possible to first check for that file in e.g. /uploads/espresso/overrides/, to see if I’ve made my own version of the advanced_settings.php, and then, if it’s not present there, do the check it’s already doing? That would enable me to easily edit my own advanced settings, and also have the system fall back on the defaults if I’ve chosen not to. Just a suggestion for future versions.. 🙂

Hope to get some input from all you clever Event Espresso people! Thank you in advance 🙂


emarienborg

July 16, 2012 at 3:04 am

..in the same category of question: That would perhaps also enable me to remove all the event settings that aren’t used by the users of the site, and just confuse them? Like the alternate registration page, etc.


Josh

  • Support Staff

July 16, 2012 at 12:01 pm

In Event Espresso 3.1, the way to modify core functions and keep them from being overwritten on plugin updates was to copy over pluggable functions to the custom_functions.php file. Which left out any of the functions that were not pluggable.

In Event Espresso 3.2, many of the core admin functions have a means to add filters. So while I can’t point to a solution for 3.1, here’s how you’ll change this in 3.2 (which we hope to have an early version available for testing very soon):

Create a new function like this:

function my_change_default_addl_attendee($event){
    $event->additional_limit = 2;
    return $event;
}
add_filter( 'filter_hook_espresso_new_event_template', 'my_change_default_addl_attendee, 10, 1 );

The support post ‘Override advanced_settings.php?’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Support forum for the Custom Files add-on for EE3.
Documentation for Custom Files Add-on https://eventespresso.com/wiki/custom-files-add-on/

Status: closed

Updated by  Josh 8 years, 7 months ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!