About your issue in admin body class, WP Codex documentation admin_body_class, class as string ( not array ), there are some of your function like get_saved_network_option not returning true that cause $new_classes not setted in array.
This code correct, we need return in string, but $new_classes maybe in string empty or not array.
return $body_classes . ' ' . implode( ' ', $new_classes ) . ' ';
For login page class, you are correct to set login_body_class in array, BUT you set condition too early as @Bruno Cantuaria comment, take a look your code:
// Only when logged in
if ( ! is_user_logged_in() ) {
return $body_classes;
}
So thats why you class settings not return, it only work if user not logged-in. I hope this helps.
Related Posts:
- body_class filter – Is there a better way to write this code?
- How to set a custom path, for ajax image upload folder in admin?
- How to call function at the bottom of post using plugin?
- Handling Body class based on Template
- Custom filter in admin edit custom post type responding with invalid post type?
- How can I remove a function that has been added to wordpress with add_filter?
- Can I remove or edit an include() from a function with a filter?
- How to Create custom block for displaying information in content section which act like shortcode
- using filter and hook inside class
- Adding body class to html tag that already has language attrubutes?
- Add custom filter to register data in array
- Custom plugin: Trying to show saved data on frontend
- Set media upload attachment link to none and hide it in WP v3.5
- How to set custom cookies before output
- Fatal error: Call to undefined function plugin_dir_path()
- How to make WordPress plugin check for database changes and then do something?
- Rename image uploads replacing “width” and “height” in filename with “medium”, “large”, “small”
- How to make an meta_query optional?
- How to remove “out of stock” variation options from size dropdown in woocommerce?
- How to use copy() function and paste file in /wp-content/themes directory
- wordpress custom endpoint multiple params
- wp_get_attachment_url filter won’t accept two arguments
- Filter link to existing content suggestion
- Am I not understanding plugins?
- Page Reloads Before AJAX Request Finishes
- When using the_author hook, how can I determine the PHP file that generates each call to `the_author()`?
- Add htaccess rules with insert_with_markers at beginning of htaccess
- Insert array data on plugin activation
- Common abstract class for plugins
- Remove a filter added by a plugin
- Same log message keeps on printing to debug.log file thousand of times
- Append HTML Using Shortcode
- Add a class to the anchor tag on HTML5 gallery
- Create onClick Event to Re-load a Widget
- Accessing the database from a plugin outside of action hooks
- Adding subdomain to home_url for “add_menu_page”
- How to select the contents in the text view textrea in wp_editor?
- How to control WordPress image metadata (using Imagick)?
- Removing “wpautop” (auto tags) only on certain pages?
- How to auto fetch customer details in Woocommerce in checkout page
- Can’t upload image using media_sideload_image
- I want to add custom add to cart link [closed]
- Execute long and heavy processes
- Font Awesome changing default WordPress Font
- Download full html page with CSV export plugin
- Filtering a function’ output for a new continued function
- Deleting Certain terms from appearing on the front end as links
- Usage of call back function of add_meta_box()
- how to save checkbox data for custom setting?
- How to Schedule Cronjobs for start of every month and year
- WordPress WP_Query without query GET parameters
- Get the name of menu item with wp_nav_menu
- Where to copy woocommerce files to in my custom theme to avoid editing the core plugin?
- update_post_meta() not saving data inside of save-post filter
- How to add aria role and schema markup to custom walker container
- Removed jQuery script from header.php , any problems?
- How can I get plugin meta data without knowing the plugin folder?
- calling admin-ajax.php from admin-ajax.php
- How to internationalize header image?
- Flatten Responses returned via WP REST API via WP_Error for obfuscation
- User filter posts by year
- How does add_option() function enable action hooks to fire right after actiavtion?
- Create plugin with custom page and template caused an error `Call to undefined function get_header()`
- Settings API form – submit with AJAX
- How to use apply_filters() inside a plugin class?
- Submit remote form to wordpress REST API and save data to custom post type
- Foreach Loop Of Post Types With Nested If Else If Not Completing Process
- In a foreach loop, how can I add a meta value if it doesn’t exist?
- Looping through and combining calls to Woocommerce REST API
- Should I use wp_cache in my plugin to make it faster?
- How to import woocommerce custom fields data into another site?
- Add a custom link to each image in WordPress gallery
- How to access this jQuery/AJAX data in a PHP file/WordPress plugin
- post_exists stops working in a scheduled event
- register dependency css and js inside a plugin class
- When I create a new custom post type, it replaces the old post type
- Add class to all meta boxes for a custom post type
- Add .php to end of all WordPress Pages (multisite)
- PHP get_category() function redeclared
- Getting Member Data From WhishList Member on Register
- I’m writing my first plugin and my echo output is showing up on every page of my wordpress installation
- global $post inside plugin query messes up every new post page in wp-admin
- wp_query (or hook) posts by date (id) in array then set post_type
- Chosen Select jquery Not Working in Plugin
- PHP calling function within a class
- Save data of select list after clicking save
- Select All not working in a WordPress search filter
- Create and update Custom Cookie based on multiple GET and POST Values for first time visitors?
- Can’t remove menu items added by plugin
- Issues separating my Plugin pages into different files
- AJAX: WordPress filters inside $html do not work as intended
- Why not showing all post by default in my jquery filter
- How to hide Ads From Certain Categories?
- Blog Posts not sorted and pagination not adjusted after filtering some category
- Custom field fetch error on woocommerce pdf invoice
- Displaying custom meta box value in a custom post page
- how to check elementor is widget is active or loaded
- Create a custom plugin with dynamic child pages listing database records
- Is there a hook that I can use when a fatal error occurs?
- Cannot Access ACF Field Values via my Plugin