hook into init action on your initial plugin function
add_action('init', array(__CLASS__, 'your_function_within_class'));
and add the function
public static function your_function_within_class()
{
wp_register_style('myfirstplugin-admin-css', '/wp-content/plugins/myfirstplugin/assets/style.css', false);
wp_enqueue_style('myfirstplugin-admin-css');
}
hope this help
Related Posts:
- Using wp_add_inline_style without a stylesheet
- How important is it to enqueue a theme’s stylesheet?
- Why is wp_head() creating a top margin at the top of my theme header?
- Enqueue a stylesheet for login page and make it appear in head element
- Caching and Versioning for rtl.css
- Why I can’t add a CSS style in this WordPress theme?
- How to control initial wp_head() output?
- The difference between calling wp_enqueue_scripts to load scripts and styles in custom theme
- How can I get wp_head() as a string instead of echoing it?
- Adding customizer styles with wp_add_inline_style
- What can I hook into after_setup_theme?
- Identifying the priority of style.css so I can make a small CSS file load last
- use add_action(‘wp_head’) in a widget for generating dynamic CSS styles
- Adding inline styles from a widget
- The best way to add stylesheets to WordPress
- Advantages of using instead of wp_enqueue_style()?
- How to add dynamic inline style?
- Enqueued Stylesheets Effecting Admin Styles
- wp_head() not inserting the default stylesheet style.css
- De-registering parent style sheet css recommended?
- enqueue_style is not working
- Dequeue a style file which is making website load slow!
- Is my approach to enqueue styles inefficient?
- Child theme style.css versioning
- Why wp_head() function not loading style.css?
- Disable wp_enqueue_style for theme on wp-admin
- functions.php not hooking up with style.css
- How can I let templates choose which stylesheets are enqueued?
- Stylesheet not linking
- Theme Loading Into Dashboard
- How to check if a WordPress core block is active in sidebar
- Font Awesome 5 Free – far working but fas is not? [closed]
- How remove render blocking css from wordpress when you build a theme?
- What is the safe way to print tracking code / pixel code before tag or tag
- How to modify default controls in WordPress theme customizer
- filemtime(): stat failed warning within a child theme
- How do I use a color from theme options?
- How to remove ID’s from wp_enqueue_style?
- Ideal inline dynamic CSS injection
- How to include a file only on dashboard widgets page?
- Having issue with WordPress wp_enqueue_style
- theme style is applied on the dhasboard rather than the website
- Are there any caveats to compiling all of my theme’s SCSS into the style.css file in the theme root?
- How to use Canonical URL meta tag to avoid duplicate content issues with WP home pages
- Adding google fonts to WordPress theme
- Displaying front side empty with one file attached problem
- Find out the reason that the Styles and scripts in the theme are loading properly in localhost but Not in server after deploying
- Using wp_add_inline_style Inside a Template File
- Different stylesheet for different pages not working fully
- Enqueue script/style with multiple GET parameters
- Is there a way to prevent wp_head from outputting self-closing tags?
- Menu items description? Custom Walker for wp_nav_menu()
- How to define and link full path to css located at a random folder on header.php
- Sizing screenshot.png without losing aspect ratio
- Software for WordPress Theme and Plugin Development? [closed]
- When to use is_home() vs is_front_page()?
- What is the preferred way to add custom javascript files to the site?
- Get the blog page URL set in Options
- How to create .pot files with POedit?
- How do I get the theme URL in PHP?
- Why when I submit a form in wordpress it loads a 404 page though URL is correct
- What is the constant WP_USE_THEMES for?
- Worthwhile to restrict direct access of theme files?
- How Do I Protect My Premium WordPress App Theme from Copying?
- How to detect mobile devices and present them a specific theme?
- How to add posts to custom menus?
- WordPress Theme Preview Image
- How To extend WP_Customize_Control
- What is the difference between front-page.php and home.php? [duplicate]
- How can I get page slug
- Does the functions.php file ever get called during an AJAX call? Debug AJAX
- When to use _e and __ for the translation?
- What is a Theme textdomain?
- How to show a custom meta box on the “Quick Edit” screen?
- How to add CSS class to custom logo?
- How to add custom css file in theme?
- CSS not updating in browser when I change it
- Display Search Result Count
- wp_nav_menu(), how to change class?
- theme path in javascript file
- Is wp_is_mobile() effective?
- Display Menu Name using wp_nav_menu
- Making update notification functionality for my themes
- What questions do you ask when asked to give an estimate on theme development?
- How to remove dashicons.min.css from frontend?
- How do I remove a pre-existing customizer setting?
- Minimum Template Files for Theme Development
- What’s the difference between home.php and index.php?
- pass object/JSON to wp_localize_script
- get_template_part vs action hooks in themes
- Theme Activate Hook
- How to Link External jQuery/Javascript files with WordPress
- Solutions for generating dynamic javascript / CSS
- wp_redirect() – headers already sent
- Can I create my own “Recent Posts” widget or customize the existing one?
- Custom single template for a specific category
- how can I add an icon/image for a child theme?
- How can I add a URL field to the attachments window?
- The the_post_thumbnail without srcset?
- The proper way to include/require PHP files in WordPress