You can get the backtrace by trapping the E_NOTICE message. If you add the following snippet to wp-config.php just before
/* That's all, stop editing! Happy blogging. */
you should see the full backtrace in the error log.
set_error_handler(function() {
error_log(print_r(debug_backtrace(), true));
return true;
}, E_USER_NOTICE);
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
/* That's all, stop editing! Happy blogging. */
PS: Returning true
at the end of the function tells PHP to stop processing the E_NOTICE, which is probably what you want at this point.
I just used this approach on a project and it was exactly the solution I was looking for. In fact, I found this post while looking for a way to do the same thing. Happy sailing!
Related Posts:
- Why isn’t WordPress part of Framework Interop Group?
- Any guides on creating custom admin pages?
- Decrease file size upload in Media
- wp_delete_auto_drafts() deletes links in menus
- WP E-commerce: Showing 3 random products from current category when viewing product
- If Custom Field is empty don’t display div
- the_author_posts_link css class
- Design view breaking on Pages
- I want to remove the links from the term list returned by get_the_term_list
- error_log is not working as expected in functions.php file
- WordPress template_include filter not working properly
- query if on page/2/?
- “The plugin generated 2694 characters of unexpected output…” on Plugin activation, CREATE TABLE sql command not working
- How to display a value from a radio button in the options menu in wordpress
- How to debug php code in hostgator cPanel
- Put php variable in shortcode
- Web scraping using transients
- doing an ajax request always outputs 0
- What is the intended purpose of the _wp_attachment_context post meta key?
- PHP Script for last login time
- Why the JavaScript code is ignored from wp editor?
- Is there a WordPress version that is incompatible with PHP 5.3?
- Why does my callback function not work with this custom filter hook?
- Get and insert order email address to the PHP template inside HTML text
- Integrating PHP into Javascript to display map markers with Google API – problem with wp_localize
- Send an email to specific adress when button is clicked?
- Unable to write multiple values back to ACF user field – PHP
- PHP Array Returning [object Object]. Tried existing answers results with no luck
- PHP version problem?
- Why Won’t My Inputs in a form with a Get method work together?
- Extend PHP regex to cover “srcset” and “style” attributes
- Sort by page information by Ascending Numbers
- Automatic Shortcode Creation with Custom Fields [closed]
- WordPress function when file is uploaded, deleted or edited
- WordPress wp_redirect error
- single.php error
- Using a $GET parameter from a URL, to redirect to a URL (WordPress)
- wp-options keep crashing please help
- How do I display offsite database info on my wordpress site?
- Post’s ID pattern?
- Countdown to date function?
- Hide Heading if ACF Field is empty
- How to remove the message ‘We could not find any results for your search’ without changing template files and without adding posts/pages?
- calling a custom field value inside functions.php
- User Meta Value not echoing despite Var_Dump Showing correct string
- How to Handle Going Backwards in Navigation When Referrer in PHP/JavaScript won’t work?
- Why does my user not get added to the database on custom registration?
- WordPress check if current taxonomy has child
- Is there a name for trivial WP PHP files like functions.php, archive php entry.php, page.php and so forth?
- show something only when user comes from specific page at remote host?
- get_theme_mod outputs number when using WP_Customize_Cropped_Image_Control
- array_rand not working correctly?
- How do I increase the upload size only when editing special pages?
- Adding php script to WordPress [closed]
- Remove category from pagination
- ‘global’ not working in wordpress?
- Function Display article [closed]
- Show login greeting above sub-menu links?
- Conditional On custom field plugin metabox
- Which version of PHP-FPM is necessary to work with WP 3.5?
- Exclude function from running on a certain page
- wordpress sql posts query won’t display the latest post in a specific category
- How to load previous or next attachment with jquery ?
- Woocommerce Custom Meta Boxes- How to only display if they actually have content
- How to change image product page by variation in PHP code?
- duplicate posts with ajax load more wordpress
- Using ACF Relationship field to set post type to draft or published status
- Fetch Data from an external MSSQL Database in a Managed WP hosting
- How can I show how much water got saved on this order (making use of the number of items bought) on a thank-you-page?
- Posts page (category) layout modification, which php file change?
- How to add WordPress Featured image in tag ..?
- Unable to update plug-ins – Undefined index a:1:{s:3:”ssl”;b:1;} in class-requests.php on line 213
- Merge wp_get_post_terms
- Php cron job (wp-cron) not working
- Huge time to first byte on live site
- CPT in a shortcode
- Make sticky post with FacetWP
- All categories options or All categories not Populating
- WordPress load javascript file if something… (after the page is loaded)
- How to return count of items found in SQL query
- Get meta_query value by user meta array
- Can we use corePHP code in wordpress?
- how can I disallow special characters, space, capital letter, dot in user name on registration?
- WordPress Shortcode based on other shortcode
- Force CSV download with template_redirect
- Rewrite /keyword1+keyword2.html to search page | .htaccess
- problem with category menu, it doesn’t want to show link
- Insert double entry in DB
- Exclude Post ID from Array Specified in Custom Field
- Hide button based on PHP result
- WordPress display name string manipulation
- WordPress create new on site when a new page is added
- Having an HTTP error 500 after migrating a website
- Why does a meta_query break this WP_Query?
- Accessing WordPress Functions get_permalink() in Vanilla PHP?
- Saving User Input to PHP Variable
- Create an if statement based on page_id
- Require Credits Footer
- Undefined variable notice [closed]
- Correct way to perform a GET to another PHP file hosted on wordpress