定制 eighteen73/custom-tables-api 二次开发

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

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

eighteen73/custom-tables-api

Composer 安装命令:

composer require eighteen73/custom-tables-api

包简介

A helper library for registering WordPress custom table CRUD pages with a simpler API.

README 文档

README

Allows for easier creation of custom table CRUD pages by using an object oriented approach.

An example

use Eighteen73\CustomTablesApi\CustomTablesApi;

$custom_table = new CustomTablesApi(
	'my_custom_table',
	'My Custom Table Data',
	[
		'id' => [
			'type' => 'bigint',
			'length' => '20',
			'auto_increment' => true,
			'primary_key' => true,
		],
		'title' => [
			'type' => 'varchar',
			'length' => '50',
		],
		'status' => [
			'type' => 'varchar',
			'length' => '50',
		],
		'date' => [
			'type' => 'datetime',
		]
	],
	1,
	[
		'title' => [
			'label' => __( 'Title' ),
			'sortable' => 'title', // ORDER BY title ASC
		],
		'status' => [
			'label' => __( 'Status' ),
			'sortable' => [ 'status', false ], // ORDER BY status ASC
		],
		'date' => [
			'label' => __( 'Date' ),
			'sortable' => [ 'date', true ], // ORDER BY date DESC
		],
	]
);

add_action( 'ct_init', [ $custom_table, 'init' ] );

Credits

Heavily based on CT by Ruben Garcia.

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-20