You got the native date( 'Y' );
function that will give you in that case the current year. Combine that with some if/else statement and wp_redirect( $location, $header );
and you’re almost finished. It’s as easy as using user meta data $current_user
to check and so on.
Btw: no need to add any extra tables. Just use add_user_meta()
, update_user_meta()
& get_user_meta()
functions.
- http://codex.wordpress.org/Function_Reference/get_userdata
- http://codex.wordpress.org/Function_Reference/add_user_meta
- http://codex.wordpress.org/Function_Reference/update_user_meta
- http://codex.wordpress.org/Function_Reference/get_user_meta
Update: Try to only use a single meta field per user and store your data in there as an array to avoid polluting the table too much.
Related Posts:
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- MySQL SELECT increment counter
- phpMyAdmin – Error > Incorrect format parameter?
- MySQL Database User: Which Privileges are needed?
- Why is my database import losing text widget data?
- Will it break my site if I delete all transient records in wp_options table?
- WordPress (MyISAM) database is slow, should I switch to InnoDB?
- Please explain how WordPress works with MySQL character set and collation at a low level
- Reset Post IDs to less than 64bit integer
- Restoring WordPress posts from database only
- WordPress database scalability from the code perspective
- Does WordPress use the InnoDB engine for MySQL by default?
- Can I use MariaDB instead of MySQL in wordpress?
- Using Dynamic Data Pulled from a MySQL Table in a WordPress Page
- What are conventions about the schema of the $table_prefix
- Split WP install between 2 databases?
- Inserting Post Meta From SQL
- Migrating non-WordPress CMS to WordPress, lots of data to move — possible solutions?
- Why does dbDelta() not catch MysqlErrors?
- Is deleting orphaned wp_options entries safe?
- Is altering a default WordPress database table update safe?
- How to solve slow WordPress site caused by attachment_metadata
- Delete all post meta except featured image
- Custom DB_COLLATE (collation) value not working on fresh install?
- What causes the “max_user_connections” warning on WordPress frontend?
- what to do when your WordPress database is too large?
- Change all http to https in mysql databse?
- WooCommerce – Query for ordered products
- Large database causes slow load
- Delete duplicate rows from wordpress database where a column is duplicate in phpmyadmin
- Database slowdown after update to 3.4.1
- WordPress and automated MySQL backups to a different host
- Query WordPress database by registered date and role
- Tons of Twitter rows in my database
- How to insert data into MySQL database from the form created in WordPress site
- Size article thumbnails and retrieve them directly from database
- WordPress site uses MyISAM, should I switch to InnoDB necessary?
- Which is more efficient? Using usermeta, or creating a new MySQL table?
- WordPress mysql table double prefixes
- CRUD operations using WordPress database API
- WordPress database import: Row size too large
- Advanced SELECT query with condtional statements
- Why do mass updates to post_content shows in front end, but not in edit screen?
- Error establishing database connection – high traffic?
- Handling large N data in WordPress
- Is MariaDB’s Aria storage engine suitable for WordPress?
- Improve performance by removing unnecessary database queries
- Redirecting to old domain after migration website
- A MySQL DB within a MySQL DB
- Switching Databases in LocalHost
- Is there a way to recover the table wp_term_relationships?
- Trouble Migrating all data blog from WordPress.com to WordPress.org
- Unable to set a default serialized array using dbdelta()
- How to prevent/delay MySQL connections when an object cache is used?
- How to fix database error duplicate entry
- Error establishing a database connection,
- Changing between Local Host DB to Production DB and in reverse
- Best practice to limit results in get_row()?
- Why does changing Database Table Prefixes result in loss of content?
- Query Column of Specific ID from Database Table
- Moving WordPress site to new domain – database import [duplicate]
- How to connect and insert data in database of wordpress?
- Buddypress avatar image in database [closed]
- $wpdb->get_var – What value is returned when zero records are found?
- Installing local to live WP into subdirectory
- Cloning blog to localhost via WAMP
- Counting post and changing roles in mysql database. Query not code
- MSQL database wp_postmeta has meta key tve_revision
- Link multiple user databases together?
- I wanted to Know that how can I give ingore to 0000-00-00 in my config file
- I imported an restore an database and It shows #1067 – Invalid default value for ‘user_registered’
- Set a cron job to delete a specific database table table every midnight
- “BS_” rows in postmeta table
- How can I find user role in Mysql?
- Where is the HTML-handler part in the wpdb class?
- Featured image from custom to WordPress database
- WordPress Database Query works in phpMyAdmin but not in the code
- next comment id number wordpress
- Delete all users meta that named: user_avatar
- mySQL database size large, but tables size less
- spambot registering without providing email or password, bypassing registration process
- After renaming MySQL database, I can no longer access my Blog page
- How To connect to the same WordPress database with different database user
- Possible to restore wordpress database from mysql56 and sqlite files?
- Missing latest posts and options after DB migration via phpMyAdmin
- Check if a database is well installed
- Create a new table on the database and save parameters from a contact form
- Widgets with *internal* links do not display after database migration
- How do i get value from wp_postmeta?
- “MySQL server has gone away” since update to 3.8
- featured image not showing up with mysql_connect
- MySQL Database User: Which Privileges are needed?
- Import Excel (or csv) Table with user-data as subscribers to wordpress
- How to back-up a database on IIS
- SQL query : Select a thumbnail for a media
- Importing Concrete5 content to WordPress
- why you don’t Implement PDO for access every thing to database
- SQL Query to get post_id from wp_posts and and meta_key(s) from wp_postmeta
- How to find fresh (last modified) and sql backup?