forked from codepress/admin-columns-hooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathac-headings-label.php
More file actions
35 lines (29 loc) · 827 Bytes
/
ac-headings-label.php
File metadata and controls
35 lines (29 loc) · 827 Bytes
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
<?php
/**
* This hooks allows you to alter the label just before they are rendered on the screen
*/
/**
* @param string $label
* @param AC\Column $column
*
* @return string
*/
function ac_heading_label( $label, AC\Column $column ) {
// Change column label
// $label = 'My Custom Label';
return $label;
}
add_filter( 'ac/headings/label', 'ac_heading_label', 10, 2 );
/**
* Example on running each label through the string translation methods
* translation must already be available in the language file, since no new strings are registered
*
* @param string $label
* @param AC\Column $column
*
* @return string
*/
function ac_heading_label_translate( $label, AC\Column $column ) {
return __( $label, 'custom-text-domain' );
}
add_filter( 'ac/headings/label', 'ac_heading_label_translate', 10, 2 );