The $hook_suffix
global (copy of which you are getting passed to the hook) doesn’t go into such detail.
However there is plenty more of context to check. In modern WP versions bulk of it is via get_current_screen()
which returns WP_Screen
object with plenty of stuff (in this case you would want to check id
and post_type
properties likely).
As for post’s ID — get_the_ID()
should work perfectly fine in that context.
Related Posts:
- Simple/basic use of get_current_screen
- How to add background image control to page admin controls?
- Is my code correct to enqueue CSS on a specific page?
- This code works, but the way I integrated it is breaking the media uploader. How can I integrate it properly?
- How can I append and prepend something to all post hyperlinks without using ::before or ::after? PHP hook solution?
- Does hooking into the same action multiple times drain memory?
- Extract image from content and set it as the featured image
- functions.php inject inline css
- Issue with get_theme_mod returning a blank value instead of the saved value
- Show modified time if post is actually modified
- How to create thumbnails for PDF uploads?
- Logout/login redirect CSS issue
- How do I change parameters without changing the core
- How to add CSS style sheet dynamically in wordpress
- CSS stylesheet not loading
- Issue adding text after short description on product pages Woocommerce [closed]
- Customize “the_posts_pagination” and put list instead div
- Increment price for Woocommerce Minicart [closed]
- How to preserve edits to Name or Slug of term when using wp_update_term on save?
- Register and enqueue style.css custom theme
- Multiple CSS body classes to specific page I.D.’s – is this possible?
- Gravity Forms – Using a Form to Pre-populate A Gravity Form [closed]
- Running a script before absolutely everything
- How to display post content instead of excerpt
- Add function to every post?
- Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘greenday_head’ not found or invalid function name
- Enqueue Style Only On Certain Pages Not Working
- How to Display Frontend CSS for Administrator only
- Which action does wp_update_user triggers?
- How can I get my Script to work on the Login page?
- Trigger a custom function when option are saved in admin area
- Execute a ultimate member action when user role is updated
- Add other social networks to TwentyNineteen_SVG_Icons class in child theme?
- How to use wp_trash_post (or wp_delete_post) for deleting a (or all) post(s) from custom post type?
- change the url paths in the stylesheet dynamically
- Please Explain the Importing Process of Multiple Stylesheets for Child Themes
- Change CSS for logged in users
- jQuery does not work
- different style sheet for just one page template
- Override the WordPress core function wp_referer_field
- How to return hook data when multiple parameters are present?
- Hook into a function without a hook?
- Custom styles.css sheet for visual editor
- Control the srcset much more (not all sizes in it each time)
- How to add_filter html template to middle of content
- Filter yoast canonical add_action priority [closed]
- How do I hook into the container of wp_nav_menu?
- Remove links from the_content when using filters wp_trim_excerpt
- Is there a way to prevent a function/method from being called outside a specific hook?
- Some questions about how proper add 2 CSS file in a WordPress theme?
- Function not working inside of a function in functions.php
- Adding code before post title with the_title produces weird results
- Add back in child theme what the parent theme removed with remove_action
- How to insert class in each list of categories?
- I can’t add CSS with functions.php
- why can’t i add front.css to my frontpage.php
- Changing where my author box is printed
- Add Adsense code between job listings – wp job manager plugin
- remove/hide wp-editor
- Page Template Won’t Load Correct CSS File
- define css class in functions.php
- How to place a div inside a function that creates a div
- WordPress comment processing . Default unapproved comments detection before posting
- Completely Disable WordPress RSS Feeds
- Combine page types and Custom Taxonomy in a functions.php command
- Save_post – Warning: Cannot modify header information
- How to use WP conditional tag in a functions.php with OCEANWP Theme?
- custom error message for empty username and password using authenticate filter not working
- How to reference different css (bootstrap) stylesheets for the header and body of a page?
- Can we have conditional CSS styling?
- Post content overflows on my mobile phone
- Stylesheet does not load despite functions.php
- Get post_author email for Zapier Integration
- Remove clickable Link of WordPress Site Logo from Woocommerce Single Product page
- function class doesnt work
- Help using ShortCodes to style whole chunks of the post
- Run function for specific user only
- how to remove a tag in the_category function
- Adding a class to the body of an inactive site using multisite
- Conditionally apply css for a specific template part
- How can I stop the hook from breaking the login/logout function?
- WordPress hooks to call a function inside a construct
- WordPress undefined function error on using add_action() in functions.php
- How to automatically add custom classes to headings in content area
- How to echo the translated custom field?
- Function the_content
- Changing the color of post title [closed]
- save_post hook – headers already sent?
- Random text changing to weird icons in both admin & front end
- functions.php / replacing div’s with new ones?
- Add custom fields after post/page title
- Force resize for all video content
- Unhook the comment form in Buddypress
- Why wp_ajax hooks doesn’t work?
- Image width issue in IE [closed]
- Why functions metaboxes is causing White Screen in Admin [closed]
- How do I make my child theme’s CSS update when I save it?
- image_size with respect to aspect ratios
- wp_head not injecting css
- Create section wit form