why use a custom table for this? eliminate the whole save_post
function and just use get_post_meta
and update_post_meta
to check/increment the view count. this is exactly what post meta data is for.
Related Posts:
- Show content from database
- Post Views / Hit Counter Problem?
- What is the difference between an ORM and an ODM?
- Rename a table in MySQL
- How should I tackle –secure-file-priv in MySQL?
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- Keeping WP database synced across multiple developers using git
- Checking if Database Table exists
- How To Export/Import WordPress (MySQL) Database Properly Via Command-Line?
- How to define composite keys with dbDelta()
- Is it possible to define two databases for one installation?
- Connect forms in WP to external database
- Hook into $wpdb
- How to get site URL if database is disconnected?
- Is it wise to delete post revisions and autosaves from database?
- Improve or optimize a very slow query
- What is the advantage of separating wp_users and wp_usermeta table?
- Multiple WP install with same users database
- “MySQL server has gone away” since update to 3.8
- Using two different DB users on one WP install
- Usage of Direct Database Call Without Caching Error
- Can I transfer a mysql database to another site?
- MySQL Syntax Error upon restoring database from backup [closed]
- Weird issue with database migration and SSL links
- Merge two databases: OLD SITE -> NEW SITE
- Backup another database with BackUpWordPress plugin [closed]
- Easiest Way to Authenticate WP Users Using an External DB?
- How to use a different database to list and manage comments in the backend
- Who is responsible for data sanitization in WordPress development?
- How to check if a core update, like 4.9.8 → 5.0, involves a database update (migration)?
- Why is it that not all users have a ‘session_tokens’ meta_key record in the usermeta table?
- How do I find out the full path of a page’s template?
- I need to get an array from the wordpress database
- Moving minor updates between local and live sites – just database?
- what is the best way to store user created data?
- Use mulitple usernames?
- Using GROUP CONCAT in my-sql query with wp_usermeta table
- Routine to convert custom post meta from old to new value
- “The link you followed has expired” & “Error while saving” messages when adding new post
- input data and output table [closed]
- sanitize POST arrays
- WP character encoding error after sharing post on Facebook �
- Sending data with multi step form to wp database
- WordPress query is not returning proper results
- Localhost to Staging to Development Dynamic WP-CONFIG
- WordPress and user security
- Migrating from PDO using SQLite to clean new install using MySQL
- can we add extra table or column in wordpress for adding our data
- Change WordPress URL in sql file via Terminal
- $wpdb->insert Giving duplicates
- Where is phpMyAdmin inside WordPress?
- Changing root password in PHPMyAdmin for WordPress Database when going live
- How to properly check if a table exists in WordPress Database using Show Tables Query
- How to delete database without using any plugin?
- restore a db after bad backup
- Best practice to import user base (subscribers) from one website to another?
- AJAX wp-mysql running too slow
- Some weird users in database
- Delete/Replace words from X to Y in post content
- Location of image metadata on my server
- How to create more than one new wpdb object?
- Multiple WordPress sites installs sharing the same database but with different content and domains
- Brandoo WordPress Unable to Update to WordPress 4.2.2
- Remote database -> massive response time increase?
- Custom Post Type not showing anything added by code anymore?
- Is it good practice to import/export a blog to test a redesign?
- Getting value from database table depending on field value
- Getting “Error Establishing a Database Connection” on localhost in new Mac OSX Lion environment
- Secure way to use name_save_pre?
- wpdb->insert not inserting first variable
- Database tables for sports betting integrated in WordPress
- How do I have a user upload a blog post and then retrieve that to display in a card on the site?
- New installation fatal error in 5.9.3 at edit or create entry
- Storing transients giving database error
- I want to replicate a wordpress website over multiple servers
- Is there anyway to split posts to different databases?
- wp-cli + valet: “Error establishing a database connection”
- How to edit custom table data in frontend
- local wordpress broke after changing URL
- Unable to login to a https website via the app after changing from http
- mysqli_query(): MySQL server has gone away for Curl Request
- Is it safe to add INDEX to a column in WordPress database?
- WP website showing blank page after moving from subdomain to main domain
- create a table using user meta custom data
- wpdb query to insert images in to post/page gallery
- WPCLI search and replace in a particlar site dir effect another site-dir
- How do I find out from my database what version of WordPress I need?
- How to create a database table?
- get_user_meta and umeta_id
- Extracted CSV as Array for Custom Query Loop
- Hang Up Followed By Can’t select database
- Database error after importing WordPress
- Send data to database after redirect (and popping out of iframe)
- Pulling values from a sepcific row in table
- import (migration) user database to wp-users
- Create hundreds of users with just ID in phpMyAdmin
- What is best for saving lot of extra detail of user?
- Insert Extra fields added in the front end registration form to DB
- $wpdb->insert not working for last select option
- How to create a table [closed]