Wordpress PHP

Is there a way in Wordpress with php to show what function, hook, filter or action is creating a specific piece of code?;
LVL 7
rgranlundAsked:
Who is Participating?
 
Jason C. LevineConnect With a Mentor No oneCommented:
Sure.  If you know where the code is, you can edit it.  I strongly suggest moving to a child theme footing if you haven't yet done so and avoid hacking the core.
0
 
Jason C. LevineNo oneCommented:
Nope.
0
 
rgranlundAuthor Commented:
Is there a way to replace one function with another?
0
 
Ray PaseurCommented:
Further to what Jason advises...

WordPress has Themes.  You install one, and you've got it.  But WordPress also has updates to its software, and to its Themes.  If you modify a Theme and it gets updated, you lose your modifications.  These updates are automatic and necessary.  Hence the idea of Child Themes.  They are like object-oriented inheritance, in that they extend the original theme with your own custom modifications.  Make a Google search for WordPress Child Themes and learn more before you invest your time, talent and treasure in something that could get blown away without notice!
0
 
Jason C. LevineNo oneCommented:
I also may have spoken too soon.  You might be able to get a report of which functions/hooks/filters are firing on a specific page by using Debug Objects:

http://wordpress.org/plugins/debug-objects/

Not sure it will be helpful, if it returns a list of EVERYTHING that fires each time a page loads but it might be better than nothing.

Also for good reading:

http://nacin.com/2010/04/23/5-ways-to-debug-wordpress/
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.