一,常用函数 获取当前用户ID的方式: 通过邮箱获取用户信息的方式: 通过ID获取用户信息的方式: 二,WP_User 类 通过 WP_User 类获取用户信息 方法: 用户信息:
简介 WordPress v4.4以后,已经内置了WP REST API。 接口文档:https://developer.wordpress.org/rest-api/ The WordPress REST API provides an interface for applications to interact with your WordPress site by sending and r […]
1,数据库相关表 WordPress 文章表中是没有文章点击次数这个字段的,所以把文章点击次数,保存在表 wp_postmeta 中。 2, 通用函数 /** * 设置文章浏览次数 */ function setPostViews($postID) { $count_key = 'post_views_count'; $count = get_post_meta($postID, $count_k […]
图片列表
热门文章
-
WordPress 添加文章自定义字段3个月前 (11-22)
-
WordPress 增加文章阅读次数3个月前 (11-22)
-
WordPress 引入自定义 JavaScript 文件3个月前 (11-22)
-
实现自定义 Ajax 请求3个月前 (11-22)