Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin Name: plugin name
- Plugin URI:
- Description: Descript
- Version: 1.0
- Author: Author
- Author URI:
- License: GPLv2 or later
- */
- if ( ! defined( 'ABSPATH' ) ) {
- exit; // Exit if accessed directly
- }
- require_once(dirname(__FILE__) . '/lib/visit_stats.php');
- // Current wordpress user id
- $userid = 3;
- // Getting visit value from user meta
- $oldvisitdata = get_user_meta($userid, "visits", true);
- // For example if it's returning 3
- // Now increasing the old visits value by 1
- $newvisit = $oldvisitdata + 1;
- // Now update the meta
- update_user_meta($userid, 'visits', $newvisit);
Add Comment
Please, Sign In to add comment