定制 drcsystems/display-third-party-users 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

drcsystems/display-third-party-users

Composer 安装命令:

composer require drcsystems/display-third-party-users

包简介

A simple wordpress plugin to display users in table on custom endpoint from third party API

README 文档

README

A simple wordpress plugin to display users in table on custom endpoint from third party API.

PHP Quality Assurance

Installation

Plugin Installation

The plugin can be installed via Composer by the name drcsystems/display-third-party-users.

It means they can be installed by adding the entry to composer.json require-dev:

{
    "require-dev": {
        "drcsystems/display-third-party-users": "^1"
    }
}

or via command line with: (From your wordpress root)

$ composer require drcsystems/display-third-party-users --dev

Plugin Requirements

  • Php 5.6 or later
  • Wordpress 5 or later

(The default target version is PHP 7.0+ and Wordpress 5.7)

Usage

Basic usage

When the plugin is installed via Composer, and dependencies are updated, everything is ready and you can view the plugin in wp-admin under plugin where you need to activate it.

There are options that can be used to customise which can be found under Settings->Third Party Users in wp-admin

Configuration

After activating the plugin go to Settings->Third Party Users in wp-admin and change the Endpoint Slug if you want other wise the default value will be used.

Following API is used as default to display users:

https://jsonplaceholder.typicode.com/users

(You can change the API but make sure your API has the same response structure as the default API)

Visit the page with your Endpoint Slug to view the data in table

http://YOUR_DOMAIN_NAME/ENDPOINT_SLUG

OR

https://YOUR_DOMAIN_NAME/ENDPOINT_SLUG

Customization

You can display more columns in the table using this filter hook:

wpdtpu_datatable_columns

For e.g.,

function wpdtpu_get_columns($data){
	$data[] = 'email'; //valid column name
	return $data;
}

add_filter( 'wpdtpu_datatable_columns', 'wpdtpu_get_columns',1 );

Phpunit Testing

Go to your plugin dir, run this command:

wp scaffold plugin-tests display-third-party-users

Replace “root” with the username of your database and replace ” with the database password. Also replace “localhost” with the hostname of your database. You can find all three of these values in your wp-config.php file.

You can now type phpunit OR lib/bin/phpunit into the command line and the unit tests will run

Phpunit Testing Refrence

统计信息

  • 总下载量: 12
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2021-07-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固