简体   繁体   中英

can i override a core function from moodle?

Can I override a core function from Moodle? I changed the core function setnew_password_and_mail() and it is working there ( moodlelib.php ), but I would love to have that customized on my theme so I have better control depending on what selected theme I have. The function is not even in a class so I can't override a renderer.

I tried Overriding plugin renderer moodle and that worked perfect for a function within a renderer but not one single function in a library.

Thanks :)

The answer is no about the function I'm afraid.

But you could have a local version of the language string newusernewpasswordtext which won't be overwritten by upgrades.

Go to site admin -> language -> language customisation.

Then search for newusernewpasswordtext in component 'core - moodle.php'

Then modify and save the text.

This will be stored in moodledata/lang/xx_local/moodle.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM