You just use a normal if statement around the notice so that it only appears if the value of your option matches the current date.
function wpse_277689_admin_notice() {
if ( get_option( 'expiry_date' ) === date( 'd/m/Y') ) :
?>
<div class="notice notice-success is-dismissible">
<p><?php _e( 'Done!', 'sample-text-domain' ); ?></p>
</div>
<?php
endif;
}
add_action( 'admin_notices', 'wpse_277689_admin_notice' );
Related Posts:
- Making Custom Fields Standard in the Admin UI
- Custom ReCaptcha Login
- Print shortcode in custom action hook not where the shortcode is entered
- Disable email field on WooCommerce customer account details
- Customizing the default logout page of WordPress
- How can Use custom input field in functions.php page?
- where can i find the login page in wordpress and add my header to it
- How to remove admin menu pages inserted by plugins?
- Is there a hook that runs after a user logs in?
- How can I edit post data before it is saved?
- How to add a new product type on woocommerce product types? [closed]
- WordPress hook before inserting post into database
- Change the login button on the login page
- Add custom html to last sub-menu item
- Creating my own Admin Forms in a WordPress CMS?
- How to make custom bulk actions work on the media/upload page?
- Run javascript code after wp_login hook?
- Removing fields from the Media Uploader/Gallery
- deleted users still show in count?
- WordPress admin notice in plugin function
- Why isn’t is_home() working correctly?
- How can I tell if I’m on a login page? [duplicate]
- What is the proper way to apply the login_form_bottom filter?
- How to override wp-login.php
- Remove Links from Login page
- Restrict access to admin but allow admin_post hook
- How to build custom WP admin with custom URLs
- Any Hook Called When Post Becomes Published?
- When using the block.getSaveElement hook can you output different markup based on whether or not you are in the edit view or the live page view?
- after login that will redirect user role into a page
- How to exclude certain widget from showing up on home/front page? [duplicate]
- setting a specific home page for logged in users
- Redirect members to custom page upon logging in through WP admin
- Change “logged in” link in (you must be logged in to post a comment)
- Adding body class to login page?
- Redirect to requested page after (custom) login
- Custom Dashboard Home Screen Options
- Schedule cron event from widget
- Add a page that appears in the backend admin that lists files to download? WP 3.3
- Adding “Interesting Tags” & “Ignored Tags” like StackOverflow.com in a WordPress Blog?
- Is there a filter hook that I can use to change how taxonomy term names are displayed?
- Remove “Get Shortlink” button in admin of custom post type
- How to place HTML below the title of the (custom) post overview
- How do I remove the eye icon that shows visibility on login screen and reset password screen
- How can I add data to a custom column in the Users section of the wordpress backend?
- How do I change the default admin color scheme in MP6
- How to trigger function on theme delete?
- Custom Login and Registration form in Ajax
- How to get multiple Action Hooks in an Array
- Last time a user logged in
- add filter login_redirect does not contain original requested redirect
- Edit admin post page
- How can I allow access to multiple users, using the same login, at the same time?
- ‘wp_login’ action hook not working with wp-login.php file
- Extend Screen Options
- Admin Panel – Custom Menu Sub-Item LINK
- WordPress custom login page
- Adding custom styles to dropdown in editor
- Hooking into the init action will fire it too frequently?
- Adding a login form that concatenates three fields into a username
- how to add custom css and js on wordpress post editor directly without using .php file
- How to customize core admin pages within a theme?
- Allow non-admins to access the Customize theme page
- Properly customizing login/register form
- How to modify the action attribute of the wp-login.php?action=register form?
- adding multiple custom columns to users.php
- How to change popular term checklist title when edit post?
- WordPress customizer Preview not loading
- How can I get my Script to work on the Login page?
- Viewing checkout page removes fees from mini cart
- Adding buttons to Add New Post and Add New Page
- How to add an extra variable to login and authenticate it?
- Login/Logout Session Sharing – Multiple WordPress Installations
- Modify custom field input data before creating a new post
- Custom login with external provider iframe and data object
- Deep customization of wp-login.php
- User can not login
- Lost password empty field error redirect to custom login
- How to use default WP form elements to interact with custom DB table?
- Custom Log In Screen – Disable password recovery [duplicate]
- ‘wp’ hook supposed to trigger when editing a post?
- Enqueue script globally
- Multi-site User Sessions
- Is it possible to add the_content filter upon login?
- Extend WordPress Core Classes in OOP Theme?
- Should `wp_login` be used since it’s deprecated?
- A truely custom login page?
- Switch between WordPress websites easy for an end user
- How to cancel an action hooked to untrash_post? or any hook
- Plugin Development – Functions or Hooks?
- Lost password and back to blog in same line
- Returning or use form data using a hook?
- Customizing Users in Admin Area
- Custom Columns WordPress Admin
- Restrict Viewing of post on both front and backend?
- I w’d like to know If there are simple solutions to integrate other CMSs to wordpress
- add custom content to appearance/widgets screen
- Adding JavaScript file in Admin Panel
- Advanced WordPress plugin activation detection
- How do I add something to the “Edit Tag” page in wp-admin?