- This topic has 2 replies, 2 voices, and was last updated 8 years, 9 months ago by .
- The topic ‘Functions with same name’ is closed to new replies.
These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.
Tagged: same function
Hi Genesis Community
I am wondering if its bad practice or perhaps outright wrong to use a function twice.
For example if I have the same function in custom-post-archive.php and in buddypress.php.
Is that bad?
Thanks for your input.
In theory, yes. If both functions were called on the same page, chances are the site would hang and you'd get a white screen.
I thought so. In this case I can't see them being called the same time as they are in templates but better safe than sorry. I will use different function names.
Thanks for your reply.
© 2023 WPEngine, Inc.