Created
February 2, 2013 09:13
-
-
Save jayarjo/4696711 to your computer and use it in GitHub Desktop.
wp: add/modify columns in post type listing screens
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function f__manage_posts_columns($cols) | |
{ | |
global $typenow; | |
if ($typenow != 'price_table') | |
return $cols; | |
$cols = array( | |
'cb' => $cols['cb'], | |
'title' => $cols['title'], | |
'template' => "Template", | |
'shortcode' => "Shortcode", | |
'date' => $cols['date'], | |
); | |
return $cols; | |
} | |
function a_10_2__manage_posts_custom_column($col_name, $post_id) | |
{ | |
global $typenow; | |
if ($typenow != 'price_table') | |
return $cols; | |
if ($col_name == 'shortcode') { | |
?><code><strong>[price_table id="<?php echo $post_id; ?>"]</strong></code><?php | |
} elseif ($col_name == 'template') { | |
echo "Default"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment