Hello Please add following code snippet in your theme’s functions.php file
if (!function_exists('write_log')) {
function write_log ( $log ) {
if ( true === WP_DEBUG ) {
if ( is_array( $log ) || is_object( $log ) ) {
error_log( print_r( $log, true ) );
} else {
error_log( $log );
}
}
}
}
Now you can add custom log as and when you wish by using following output
write_log('THIS IS THE START OF MY CUSTOM DEBUG');
write_log($your_variable);
Do let me know if you have any queries.
Related Posts:
- Post meta vs separate database tables
- How to add a javascript snippet to the footer that requires jQuery
- Enhance Media Manager for Gallery
- Adding Custom Text Patterns in the WP 4.5 Visual Editor
- How to create an API for my plugin?
- How to use PanelColorSettings in custom Gutenberg block?
- Is there a way for a plug-in to get it’s own version number?
- How to add tab which is visible only in admin side of product in woocommerce? [closed]
- Replace audio/video enclosure with player?
- Contact Form 7: wp_mail doesn’t work after update to 4.6
- How do I print a notice only on certain admin pages?
- Hook the Keydown Event in the TinyMCE Post Editor
- Gutenberg ServerSideRender is deprecated, how to work with new wp.serverSideRender component?
- Add an image gallery to a custom post type?
- Unit testing wordpress plugins with plugin options
- Create a clickable name in WP_List_Table for Plugin Admin
- Plugin development without Theme adjustments?
- How to Make a Category Always Selected?
- WordPress Settings API: saving multiple rows of similar data
- Modify how gallery.js builds the shortcode [gallery ...] in tinyMCE?
- How to use is_multisite() in a must-use-plugin?
- Can’t we use strings defined as PHP constants if we want to translate them in a plugin?
- What is the difference between current_page_parent and current_page_ancestor?
- Using the component outside the editor. select(‘core’) is null
- Gutenberg is there a way to know if the current block is reusable?
- Tips for targeting widget dragable for WP Pointer on widgets.php page
- Any ideas how to make unit test read the theme functions.php?
- Scheduling a task using class methods
- WordPress Ajax callback function from plugin – OOP
- StackExchange clone using WordPress?
- Custom url for a plugin page add_rewrite_rule WordPress
- Cannot update …/tags folder in SVN Repository
- Is there a way to ensure plugin script loads before another script?
- Verify if user is wordpress logged in from another app since wordpress 4.0
- Is it necessary to sanitize plugin options?
- how to get link of added document with a post
- Doubts about the use of metadata and how this can affect performance on WordPress
- How can I replace content in the WP Admin area before an admin page is rendered?
- You do not have sufficient permissions to access this page on a submenu
- When is the proper time to minify css and js with git workflow?
- Get draggable widgets on Edit Post page
- Plugin that saves form data
- how to invoke wordpress API from other existing PHP system
- Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0
- How to cancel update messages from a changed plugin
- How to get the post excerpt using post object?
- jquery & ajax sending data to php
- How to import the css in the plugin admin area?
- how to get the post id in plugin
- What’s the impact on WordPress’ performance regarding the amount of classes/files in a plugin?
- Using add_sub_menu to put into Appearance Section
- How to call code when adding WooCommerce menu items via woocommerce_account_menu_items
- jquery in wordpress plugin with depdendency
- Replace first occurence of a word with link [closed]
- Converting core modification to a plugin
- Plugin creation, restricting access to specific roles
- wordpress automatic update does not run
- Ajax +wordpress onClick link redirect to new page and create html content
- Adding filter to the title without affecting the menu title
- How to move an image in a plugin to the upload directory and make it as a media of wordpress?
- Script to replace default blogroll with links to my social media URLs
- How to show multiple instances of the WP125 Widget?
- Posts form with AJAX request – Plugin development
- Multiple TinyMCE on button click is initialized and appended but why only last one is writeable?
- How to create a custom post-new.php page for plugin , no wp menu
- How to create a custom WordPress page with my plugin?
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Where to add functions and code snippets in wordpress
- How to re-render inspector controls?
- Save meta box data from selected dropdown list in bbpress reply form
- Sanitize WordPress Array Input?
- Events Manager: Create custom Placeholder for use in Email notification
- WC REST API Error Handling
- Shortcode content is not showing. Only the [shortcode-tag] is showing
- How to remove the WooCommerce Product->Category thumbnail from admin [closed]
- woocommerce add a new bulk action in the bulk actions dropdown in the orders list
- Creating a virtual page without exit
- Plugin Development – Call to undefined function comment_exists()
- Replace “content-area” of themes 404 page with plugin?
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- WordPress doesn’t create table on plugin activation
- Create Customization panel for Plugins not for theme
- Building WordPress Themes With Bootstrap with Adi Purdila → TutsPlus
- Allow user to change homepage
- Need to change buddypress profile url by add_rewrite_rule
- wp_mail links are dead
- Generate activation url
- Adding Third Post Box Column: postbox-container-3
- Use different archive template for plugin
- Get custom wp_query search results to appear on search.php
- Is it safe to use PUT and DELETE requests
- Multi-part form and wp_redirect()
- Sharing changes to a post (preview changes) with another user
- Checking if the query is empty does not work
- Remove default wordpress roles
- What is the meta_query key name for the woo product average rating? [closed]
- how to catch a data from a array in WordPress
- Why my admin-ajax url returns 0 even after adding echo and die() at the end of function?
- External api call using wordpress
- Set link dialog to open in blank by default