PHP code example of soderlind / class-wp-list-table-custom-column-toggle

1. Go to this page and download the library: Download soderlind/class-wp-list-table-custom-column-toggle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

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


[
    '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,
]

$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 );