ramphor/user-profile

用于嵌入到其他插件或主题的用户资料核心

dev-master 2021-05-20 08:09 UTC

This package is auto-updated.

Last update: 2024-09-20 15:10:06 UTC


README

WordPress中用于嵌入到其他插件或主题的用户资料核心

如何使用

<?php
use Ramphor\User\ProfileManager;

$profileManager = $ProfileManager::init(
  'default_template_directory',
  'template_directory'
);

注册用户资料页面

如果您想为用户创建自定义用户资料页面,可以通过 ProfileManager 注册用户资料。

$slug = 'user-profile-slug';
$profileManager->registerUserProfile($slug);

示例URL:注册自定义URL后,您可以通过以下格式访问用户 puleeno 的自定义页面 user-profile-slug

https://example.com/user-profile-slug/puleeno

注册“我的资料”页面

$uniqueueIdToCreateHookForCustomize = 'puleeno_org';
$profileManager->registerMyProfile($uniqueueIdToCreateHookForCustomize);

注册 my profile 功能后,您必须创建一个新页面,页面内容应包含以下短代码。

[{$uniqueID}_user_profile]

示例:在上面的PHP代码中,您可以看到我的唯一ID是 puleeno_org。因此,我们有以下短代码。

[puleeno_org_user_profile]

致谢