-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathac-custom_author.php
executable file
·48 lines (36 loc) · 1.55 KB
/
ac-custom_author.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/*
Plugin Name: Admin Columns - Custom Author
Plugin URI: PLUGIN_URL
Description: DESCRIPTION
Version: 1.0
Author: AUTHOR_NAME
Author URI: AUTHOR_URL
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
// 1. Set text domain
/* @link https://codex.wordpress.org/Function_Reference/load_plugin_textdomain */
load_plugin_textdomain( 'ac-custom_author', false, plugin_dir_path( __FILE__ ) . '/languages/' );
// 2. Register the column.
add_action( 'ac/column_types', 'ac_register_column_custom_author' );
function ac_register_column_custom_author( AC_ListScreen $list_screen ) {
// Use the type: 'post', 'user', 'comment' or 'media'.
if ( 'post' === $list_screen->get_group() ) {
require_once plugin_dir_path( __FILE__ ) . 'ac-column-custom_author.php';
$list_screen->register_column_type( new AC_Column_custom_author );
}
}
// -------------------------------------- //
// This part is for the PRO version only. //
// -------------------------------------- //
// 3. (Optional) Register the PRO column.
add_action( 'acp/column_types', 'ac_register_pro_column_custom_author' );
function ac_register_pro_column_custom_author( AC_ListScreen $list_screen ) {
// Use the type: 'post', 'user', 'comment', 'media' or 'taxonomy'.
if ( 'post' === $list_screen->get_group() ) {
require_once plugin_dir_path( __FILE__ ) . 'ac-column-custom_author.php';
require_once plugin_dir_path( __FILE__ ) . 'acp-column-custom_author.php';
$list_screen->register_column_type( new ACP_Column_custom_author );
}
}