Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Check get_post value after wp-admin login

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:

  1. Making Custom Fields Standard in the Admin UI
  2. Custom ReCaptcha Login
  3. Print shortcode in custom action hook not where the shortcode is entered
  4. Disable email field on WooCommerce customer account details
  5. Customizing the default logout page of WordPress
  6. How can Use custom input field in functions.php page?
  7. where can i find the login page in wordpress and add my header to it
  8. How to remove admin menu pages inserted by plugins?
  9. Is there a hook that runs after a user logs in?
  10. How can I edit post data before it is saved?
  11. How to add a new product type on woocommerce product types? [closed]
  12. WordPress hook before inserting post into database
  13. Change the login button on the login page
  14. Add custom html to last sub-menu item
  15. Creating my own Admin Forms in a WordPress CMS?
  16. How to make custom bulk actions work on the media/upload page?
  17. Run javascript code after wp_login hook?
  18. Removing fields from the Media Uploader/Gallery
  19. deleted users still show in count?
  20. WordPress admin notice in plugin function
  21. Why isn’t is_home() working correctly?
  22. How can I tell if I’m on a login page? [duplicate]
  23. What is the proper way to apply the login_form_bottom filter?
  24. How to override wp-login.php
  25. Remove Links from Login page
  26. Restrict access to admin but allow admin_post hook
  27. How to build custom WP admin with custom URLs
  28. Any Hook Called When Post Becomes Published?
  29. 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?
  30. after login that will redirect user role into a page
  31. How to exclude certain widget from showing up on home/front page? [duplicate]
  32. setting a specific home page for logged in users
  33. Redirect members to custom page upon logging in through WP admin
  34. Change “logged in” link in (you must be logged in to post a comment)
  35. Adding body class to login page?
  36. Redirect to requested page after (custom) login
  37. Custom Dashboard Home Screen Options
  38. Schedule cron event from widget
  39. Add a page that appears in the backend admin that lists files to download? WP 3.3
  40. Adding “Interesting Tags” & “Ignored Tags” like StackOverflow.com in a WordPress Blog?
  41. Is there a filter hook that I can use to change how taxonomy term names are displayed?
  42. Remove “Get Shortlink” button in admin of custom post type
  43. How to place HTML below the title of the (custom) post overview
  44. How do I remove the eye icon that shows visibility on login screen and reset password screen
  45. How can I add data to a custom column in the Users section of the wordpress backend?
  46. How do I change the default admin color scheme in MP6
  47. How to trigger function on theme delete?
  48. Custom Login and Registration form in Ajax
  49. How to get multiple Action Hooks in an Array
  50. Last time a user logged in
  51. add filter login_redirect does not contain original requested redirect
  52. Edit admin post page
  53. How can I allow access to multiple users, using the same login, at the same time?
  54. ‘wp_login’ action hook not working with wp-login.php file
  55. Extend Screen Options
  56. Admin Panel – Custom Menu Sub-Item LINK
  57. WordPress custom login page
  58. Adding custom styles to dropdown in editor
  59. Hooking into the init action will fire it too frequently?
  60. Adding a login form that concatenates three fields into a username
  61. how to add custom css and js on wordpress post editor directly without using .php file
  62. How to customize core admin pages within a theme?
  63. Allow non-admins to access the Customize theme page
  64. Properly customizing login/register form
  65. How to modify the action attribute of the wp-login.php?action=register form?
  66. adding multiple custom columns to users.php
  67. How to change popular term checklist title when edit post?
  68. WordPress customizer Preview not loading
  69. How can I get my Script to work on the Login page?
  70. Viewing checkout page removes fees from mini cart
  71. Adding buttons to Add New Post and Add New Page
  72. How to add an extra variable to login and authenticate it?
  73. Login/Logout Session Sharing – Multiple WordPress Installations
  74. Modify custom field input data before creating a new post
  75. Custom login with external provider iframe and data object
  76. Deep customization of wp-login.php
  77. User can not login
  78. Lost password empty field error redirect to custom login
  79. How to use default WP form elements to interact with custom DB table?
  80. Custom Log In Screen – Disable password recovery [duplicate]
  81. ‘wp’ hook supposed to trigger when editing a post?
  82. Enqueue script globally
  83. Multi-site User Sessions
  84. Is it possible to add the_content filter upon login?
  85. Extend WordPress Core Classes in OOP Theme?
  86. Should `wp_login` be used since it’s deprecated?
  87. A truely custom login page?
  88. Switch between WordPress websites easy for an end user
  89. How to cancel an action hooked to untrash_post? or any hook
  90. Plugin Development – Functions or Hooks?
  91. Lost password and back to blog in same line
  92. Returning or use form data using a hook?
  93. Customizing Users in Admin Area
  94. Custom Columns WordPress Admin
  95. Restrict Viewing of post on both front and backend?
  96. I w’d like to know If there are simple solutions to integrate other CMSs to wordpress
  97. add custom content to appearance/widgets screen
  98. Adding JavaScript file in Admin Panel
  99. Advanced WordPress plugin activation detection
  100. How do I add something to the “Edit Tag” page in wp-admin?
Categories customization Tags actions, customization, hooks, login, wp-admin
Displaying 3 Category Posts differently
Local theme changes upload on server but theme changes not showing

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress