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
- Should I use spl_autoload_register() in my plugin?
- How can I save a multiple select array with the settings API for a plug-in options page?
- Using register_activation_hook in classes
- Remove “Insert from URL” link in Media upload – WP 3.5
- Is there a way for a plugin to add an attribute to the tag of a theme?
- Gutenberg Blocks doesn’t render correctly when using do_blocks
- add_meta_boxes action with refresh on save
- My shortcode is showing up twice
- Database “Migration” for Plugins?
- Does wp-cron runs all tasks scheduled at same time together or one after other?
- Filter get_the_title to remove certain characters?
- Making Quote Plugin more efficient
- How do I use the Simple HTML DOM Parser in plugin when other plugin already uses it?
- Will simple function names in a class structure conflict with other plugins?
- wp_loaded hook block script enquequing
- Change the site tagline (or similar) based on current page
- How to find error in my code when the error message is pointing to WP core file?
- How to access global variable $menu inside a class function
- Ajax category filtering products default show all
- Custom user login page by creating a plugin
- Add a specific part of current category page url to shortcode
- Singelton class does not work, multiple initialization on page reload
- Saving an array of dynamic repeater data as post_meta
- How to upload a file to a folder named after the user_id via plugin
- developing a wordpress plugin, have a few PHP Woocommerce related coding questions
- Whitelisting items from custom options page
- Add_menu_page not displaying the menu in class based plugin
- Print last modified date only on posts
- adjust section according to country?
- Change tinyMCE editor to allow marked content when pasting from Word
- What exactly do this function declared into functions.php file of a WP theme?
- How to make modifications only to certain elements of an HTML string on the server-side?
- How to use html inside a functions.php code?
- WordPress Environment: Dynamic Page using shortcode – how to change the page name for sharing
- Extend Woocommerce Widget Class – WC_Widget_Product_Categories
- plugin add action hook is not working :
- zip unzip attachments in wordpress
- wordpress admin plugin menu custom css
- Scheduling an event inside plugin class is not working
- How to append to an array and return the results in a filter?
- how to Update 15k products on plugin activation with meta_option
- Hooks for post saving make a post-new.php to load latest post’s data
- wrap a span tag around author’s post count
- Adding Additional Variables on Menus Page
- Using flickr api in custom wordpress plugin
- Toolbar Hidden in a Virtual Page
- PHP: $_SESSION destroyed after page reload for my custom session
- WordPress – Get Posts with Category data
- How to correctly escape an echo
- Payment field disappears on custom Paypal plugin
- Call to “admin_notices” hook from a static method
- Adding image upload in tag section – WordPress plugin development
- How to Remove Theme Style CSS inside Custom Plugin?
- Creating plugin with front-end pages
- How to Send Pingbacks for all Posts in WordPress?
- I am having errors with checkout on wordpress
- Change lost password url to a mailto URL in WordPress
- How to edit post meta data before publishing the post it self wordpress?
- How can I update the price when someone enters postcode or zip code in woocommerce checkout page?
- 400 bad request admin-ajax file upload
- get Woocommerce product format json for WP_Query
- Update user meta when an external link in admin notice is clicked
- Is there an option to execute javascript file only on plugin activation
- How to change href of a Widget menu item link?
- How do I remove an action hook inside a class that is called by another class?
- Reload page with a different shortcode when a user selects from a dropdown
- WordPress Ajax filter: Create two loops for different output styles?
- How to display custom seo title before the loop?
- The plugin generated 225 characters of unexpected output during activation
- Ajax in a class instantiated via shortcode
- Parsing webhook from Shopify in WordPress
- How to remove title tag with this filter
- Shortcode Works for Logged in Users but Not Working for Guest
- Submit to itself don’t work
- WordPress / PhpStorm / XDebug and plugin_dir_path issues
- Send data from plugin to external database
- Get terms of the posts with one query
- Woocommerce Price Text
- Limit Taxonomy Parents
- See output of a sql query while plugin installation in wordpress
- Why this plugin is not working?
- Permission error on plugin save
- dynamically filter by category via sub-menu
- How to execute add_action() function from custom plugin to Crontrol plugin or do_action()?
- base64_encode conflict with convert_smilies in wordpress
- Properly process a custom WP REST API request (Authenticate, Authorize + Validate)?
- Login user into magento using wordpress account
- Customize create table SQL statement in any WordPress plugin
- Add text below WooCommerce short description if metabox value is true