Solved

Wordpress PHP

Posted on 2014-09-10
5
266 Views
Last Modified: 2014-09-10
Is there a way in Wordpress with php to show what function, hook, filter or action is creating a specific piece of code?;
0
Comment
Question by:rgranlund
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40314962
Nope.
0
 
LVL 7

Author Comment

by:rgranlund
ID: 40315194
Is there a way to replace one function with another?
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 500 total points
ID: 40315236
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
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 40315398
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
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40315406
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

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
This article discusses how to implement server side field validation and display customized error messages to the client.
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question