-
-
Save derpixler/993032 to your computer and use it in GitHub Desktop.
add_filter( 'manage_category_custom_column','myTestC'); | |
function myTestC($content){ | |
return $content; | |
} |
bueltge
commented
May 26, 2011
add_filter( 'manage_category_custom_column', 'myTestC', 10, 2 );
function myTestC( $column, $id ) {
if ( 'my_content' === $column )
echo 'my_value';
}
add_filter( "manage_category_custom_column", array( &$this, 'myTestC' ), 10, 2 );
function myTestC($column_name, $id){
var_dump($column_name, $id);
#return $content;
}
Als Erläuterung, aus dem Core:
apply_filters( "manage_{$screen->taxonomy}_custom_column", '', $column_name, $tag->term_id );
Das ist dein Hook, category ist ja nur eine der Taxonomien, und dann kommen die beiden Werte, name der Spalte und Id
add_filter( "manage_category_custom_column", 'myTestC', 10, 2 );
function myTestC($column_name, $id){
var_dump($column_name, $id);
return $content;
}
add_action( 'manage_edit-category_columns', 'myTest');
function myTest($content){
$content['test'] = 'hallo';
return $content;
}
add_filter( "manage_category_custom_column", 'myTestC', 10, 3 );
function myTestC($column_name, $id, $der){
var_dump($column_name, $id, $der);
return $content;
}
//create a new row
add_action( 'manage_edit-category_columns', 'myTest');
function myTest($content){
$content['test'] = 'hallo';
return $content;
}
//fill the row with content
add_filter( "manage_category_custom_column", 'myTestC', 10, 3 );
function myTestC($column_name, $columid, $termId){
var_dump($column_name, $id, $termId);
}
this works, with WP Codex ;)
//create a new row
add_action( 'manage_edit-category_columns', 'my_test' );
function my_test( $column ) {
$column['test'] = 'hallo';
return $column;
}
//fill the row with content
add_filter( 'manage_category_custom_column', 'my_test_c', 10, 3 );
function my_test_c( $foo, $column_name, $term_id ) {
var_dump( $column_name, $term_id );
}