Because in functions.php, it is too early to just run the print_r(), you may run it within a init hook like this:
Placing it inside theme’s functions.php
add_action( 'init', 'test_trace' );
function test_trace() {
global $post;
print_r($post);
}
Related Posts:
- Disallow a user to post in certain categories
- How to filter content post only on save
- Function added to hook “new_to_publish” not executing – custom plugin
- What hook can I use to modify custom post data before it is displayed on the page?
- Is there a hook similar to “save_post” which only fires AFTER the post is completely published?
- Randomize post (and page) IDs on generation
- Identify if the_post hook is being called from the admin post list
- Solutions to repost categories into multisite blogs?
- How to enable qTranslate languages tabs in custom plugin page
- How do I “get the next 10 posts after post_id == x”?
- Hiding posts – WP Hide Post not working
- Inserting above the comment template
- Insert new user with form submit ‘init’ hook
- How do I display only the latest post on my home page, while maintaining proper plugin hooks?
- submit posts by unregistered users in wordpress
- Calendar Solution: Handling upcoming Dates with Posts?
- get_post_type on post.php
- Is there an easy way to flag posts in the admin area?
- finding whether request is for post, and post id
- Hooking in to replace the Sidebar/Widget areas
- How to get all of the activate_plugin action parameters?
- Any built-in function to associate a post to category through a plugin?
- Modifying the comments section through a plugin regardless of theme
- How to hide some section in WordPress under Post
- Display post lists in 2nd paragraph
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- Using a post-signup hook to get user details
- Can’t delete Draft Post [closed]
- Map a custom id to wordpress post id
- Matching Chapters to a Custom posts [closed]
- WordPress comments not appearing in blog posts, likely because of Redux template. Could I fix this with a plugin that adds a comment form as a block? [closed]
- woocommerce_package_rates not fired when wordpress woocommerce accessed as non ajax
- Trigger Elementor Popup via code [closed]
- wp_get_post_terms is difference obj model than the one in rest api response
- Calling plugin function inside custom plugin for onclick event
- WordPress display breadcrumbs using Yoast plugin [closed]
- Outbound link autometic converted into linkdirect , and not opening
- Display by Category in Admin
- get current date + 90 days and checking every day
- Preg Match All doesn’t Allow echo first character for WordPress Taxonomy Tags
- Calculate price and display on woocommerce product single page under price (simple price, variable price) [closed]
- How to allow an editor to edit all WordPress blog posts but have the last say as administrator?
- Two problems on my WordPress installation [closed]
- Get Time Taken By Each Action Hook in WordPress
- posts comments goes to trash
- Contributive page where people logged in can write
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- Filtering WooCommerce Orders by Category
- Best place for short bio,image and button [closed]
- Excerpts on category page
- How to pull email and name from Flamingo plugin
- Which widget to use for display category post with view more? [closed]
- External RSS feed to WordPress Portfolio
- Trying to fix form resubmition with PRG (Getting error: Cannot modify header information – headers already sent by)
- do_action() hook into load-(page)
- Display wordpress post’s in popup?
- Howto check version of another plugin and then add a submenu page to it
- password_reset hook is not working
- The Hook registration_errors was not called
- Unable to add TAB character to post?
- how to add text to posts from tags
- Hook into existing tinyMCE button
- Add category selection to custom post type (plugin)
- How to get post ID with hooks publish_post, new_to_publish, etc
- Redirect to another page using contact form 7? [closed]
- edit_user_profile and show_user_profile are not firing inside a class
- Template filter for custom taxonomy terms
- Would Gutenberg be considered a PlugIn?
- pagination on data fetched using SQL query
- Add sub menu page in your plugin
- How to delete all trashed item in one-go
- AJAX fileupload – TypeError: not a function ajaxSubmit()
- how to change automatic placing of social plugins below content?
- How to get the first post and second post in a wordpress blog?
- Is it possible to send blog posts via email to subscribers?
- Custom setup of wordpress comments that are displayed
- Is there any plugin which can paste a common content to my every post?
- Recent posts per category loop?
- ‘Organize Series Plugin’ as muti author feature
- What exactly happens to function argument availability when using a filter?
- Import Instagram post to WordPress blog post
- Problem of encoding characters (apostrophes) in my posts publications
- How to backup single post in wordpress [closed]
- Combining several CSS files into one for optimization
- the_post hook is not firing for me
- Why do plugins often ask to add in to templates?
- Deactivate JS Script in Plugin Shortcode
- How to get all posts belongs to a user between a certain date
- Create a post builder skin in a plugin
- remove_action not removing add_action from constructor
- Plugin Development – Functions or Hooks?
- How to get menu location in wp_update_nav_menu hook
- How do I add some javascript validation to the admin interface form’s onsubmit?
- How do I publish portfolio items with a future date?
- Can my hooked uninstall class function access a global var declared in main plugin file?
- wordpress content .php file in an iframe’s src in a wordpress post
- Flipping Book PHP Code? Any experience?
- Making my plugin create a page?
- Is there a way to make the main page only display a brief description of the full article?
- How to change the post form from plugin?