Replace your code with as mentioned below:
public function admin_body_class($classes) {
global $wpdb, $post;
$screen = get_current_screen();
$status="parent-";
if( isset( $post->post_parent ) && $post->post_parent > 0 ) {
$status="child-";
}
$classes .= ' ' . $status . $screen->post_type;
return $classes;
}
Related Posts:
- How to show an error message after publishing a post?
- Unwanted redirect in admin area
- Too many datadabse connections – upper ceiling mysql
- Adding body class to login page?
- 500 Internal Server Error after Register dialog, but with successful registration
- WP Database Error (Windows Server 2008 & SQL Server)
- How To Reset Ownership And Permissions of Wp-Content Folder, In Order to Fix HTTP Error When Uploading Images to WordPress Media Library
- How to create a WP Admin user in phpMyAdmin for WordPress 4.6
- Wp-admin is giving me an error “Sorry, you are not allowed to access this page.”. I do have access to the wp-admin besides the dashboard itself
- wp-admin 302 redirects
- class-wp-hook.php on line 288
- Cannot log in to the admin, no error message [closed]
- Uncaught SyntaxError: Unexpected Token Illegal
- Pages section (only) not loading after publishing large number of pages
- How do I fix wp-admin error when exporting reusable blocks?
- WordPress critical error on wp-admin page with 100% permissions
- Unable to access my page or WP Admin
- mixed contents admin panel is Unsecured
- How do I fix the 403 error for wp-admin/admin-ajax.php?
- Failed to load resource: the server responded with a status of 431 ()
- WordPress logged in but no access to wp-admin
- Can’t log into WordPress after domain change
- WordPress blog fails to open
- Why when I click on a link into the WP admin panel I am redirected to a link that doesn’t contains wp-admin prefix, so I obtain 404 error
- Error 403 on wp-admin – Redirection to upgrade.php
- How to restrict dashboard access to Admins only?
- How to disable the “Post Lock/Edit Lock”?
- How can I control the position in the admin menu of items added by plugins?
- Check if user is admin by user ID
- Unable to login to my wordpress site. reauth=1 redirection loop
- Highlight custom widgets in the admin area?
- Can I add custom attributes while adding inline scripts?
- create users to site with specific language
- Hide a page in the admin end without a plugin?
- Prevent from deleting any user role but subscriber
- Disable sticky posts feature
- Hide username from users list
- Remove HTTP: from the site URL and just keep // in it
- Prevent Admin gui output from page added using add_submenu_page
- wp-admin blank in a clean install of WordPress on PHP 5.4 [closed]
- How to use Yoast SEO backend in english even if WPLANG variable is not english?
- Admin first hook that outputs HTML?
- Should I add the IP of the server that hosts my sites to the list of authorized IPs in the wp-admin/.htaccess?
- wp-admin edit user url wont show up correct url [closed]
- Which HTTP headers to use for subdomain embedding?
- To remove default dashboard items and add quick draft widget for custom post type
- FORCE_SSL_ADMIN not working
- Can enter wp-admin when logged in with custom ajax
- lock meta box position on post edit screen for contributors
- map_meta_cap was called incorrectly error?
- How do I host WordPress on a hidden domain through a reverse proxy?
- Clicking On View Post In Draft Opens New Tab
- How to set admin login page as home page
- Users disappeared from wp-admin
- WordPress (behind HAProxy and Jetty), not multisite, in sub folder – and /en/wp-admin/ keeps redirecting to /wp-admin/
- Created a new subdomain with same content. Should I add a redirect in my old subdomain?
- Placing a custom Control element in an existing block InspectorControls panel
- What are the requirements to make the admin toolbar show up on the front end
- Sorry, you are not allowed to access this page
- wp-admin folder removed by hacker [closed]
- Hide username discovery
- Cookie Domain is preventing Admin login
- How to use the built in tooltip for form validation error messages in WP admin plugin?
- _wpnonce blank screen
- Register page in admin area
- Removing Dashboard Menu Items Through The Database
- “WordPress installations is currently out of date” problem with difficult situation [closed]
- Custom plugin admin page issues
- Customising Word press Admin – Add Post Page functionality to another similar page
- How to add ‘Insert HTML Table’ button to TinyMCE in admin?
- How can I remove commas when adding tags?
- Displaying Title in Title Tag on Edit page?
- How to add custom CSS and JavaScript file for wp- admin dashboard (backend)
- How can I remove unwanted word on my WP site?
- How to take the help button and link off the dashboard
- issue with wordpress [wp-admin] redirects, when using kubernetes ingress hosting two wordpress websites using path
- Toggle between block ‘edit content’ and ‘select’ not properly working in WordPress Admin
- WordPress Admin extremely slow when other admin logged in
- Why does an ad page open when I browse my websites’s wp-admin page?
- Can’t acces login on new site
- WordPress Admin Panel Left Sidebar No showing on Post create page
- After changing Site http to https, can’t access wp login page with a digitalocean hosting
- Can’t access WP-Admin via HTTPS
- adding existing menu page on new customer user role
- stop customize.php redirect to login page if admin is not logged in
- Random authentication failures on a load balanced WP setup
- Can I get programmatic access to wp-admin?
- remove_query_arg on options.php
- wp.svgPainter cannot init error, causing issues with admin panel
- mysql_escape_string PROBLEM
- Organising and display thousands of photos in media library
- Custom comment action
- get_current_screen – ‘Trying to get property of non-object’ error
- Block tools menu in wp-admin?
- is_admin() triggers error
- wha does the following function remove from wordpress users admin area? [closed]
- How to make the Panel // WP-Admin lighter via Mobile
- React Material UI and WordPress Admin Area
- WordPress Add/Edit Post right admin sidebar change title
- Array() displaying in all pages of admin -view page source