Advertisement
olie480

WP - Admin Columns Plugin - Filter Meta / Change Values

Aug 1st, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1. add_filter('cpac_get_column_value_custom_field', 'my_custom_value', 10, 3);
  2. function my_custom_value( $meta, $fieldtype, $field ) {
  3.     fb($field);
  4.         switch($field){
  5.             case "ev_hide_date":
  6.                 if($meta == 1){
  7.                     $meta = "<span style='color: #eee; background: #C9161A; padding: 2px 5px; border-radius: 2px;'>date hidden</span>";
  8.                 }else{
  9.                     $meta = "";
  10.                 }
  11.             break;
  12.         }
  13.  
  14.     // change output on custom-fields KEY
  15. /*
  16.     if ( 'my_custom_field_key' == $field )
  17.         $meta = 'my custom text';
  18.  
  19.     // change output on custom-fields VALUE
  20.     if ( 'my_custom_field_value' == $meta )
  21.         $meta = 'another custom text';
  22. */             
  23.     return $meta;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement