定制 soderlind/class-wp-list-table-custom-column-toggle 二次开发

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

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

soderlind/class-wp-list-table-custom-column-toggle

Composer 安装命令:

composer require soderlind/class-wp-list-table-custom-column-toggle

包简介

Add a toggle column to WP_Table or its siblings.

README 文档

README

Add a toggle column to WP_List_Table or its siblings.

Use

$toggled = \WP_List_Table_Custom_Column_Toggle::create( $propterties );

Where default properties are:

[
    'meta_key'        => 'column_meta_key',  // "toggle" for a single site is saved using post meta
    'column_id'       => 'column_id',
    'column_name'     => 'Column Toggle',
    'column_hooks'    => [
        'header'  => 'manage_page_posts_columns',
        'content' => 'manage_page_posts_custom_column',
    ],
    'use_siteoptions' => false,
]

Get toggled IDs using $toggled->get_values();

Example, note use of column hooks:

$subsite_maintenance_sites = \WP_List_Table_Custom_Column_Toggle::create(
	[
		'column_id'       => 'subsite_maintenance',
		'column_name'     => '<span class="dashicons dashicons-hammer"></span>',
		'column_hooks'    => [
			'header'  => 'wpmu_blogs_columns',
			'content' => 'manage_sites_custom_column',
		],
		'use_siteoptions' => true,
	]
);
$subsite_maintenance = \Subsite_Maintenance::create( $subsite_maintenance_sites );

Working example at: https://github.com/soderlind/subsite-maintenance-mode/

Copyright and License

WP_List_Table Custom Toggle Column is copyright 2021 Per Soderlind

WP_List_Table Custom Toggle Column is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

WP_List_Table Custom Toggle Column is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the Extension. If not, see http://www.gnu.org/licenses/.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2021-01-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固