Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Replace your Title Column with the Existing one //
- function replace_title_column($columns) {
- $new = array();
- foreach($columns as $key => $title) {
- if ($key=='title')
- $new['new-title'] = __(Title); // Our New Colomn Name
- $new[$key] = $title;
- }
- unset($new['title']);
- return $new;
- }
- // Replace the title with your custom title
- function replace_title_products($column_name, $post_ID) {
- if ($column_name == 'new-title') {
- $cont = get_the_title();
- $cont = str_replace('<', '<', $cont);
- $cont = str_replace('>', '>', $cont);
- $cont = str_replace('"', '"', $cont); ?>
- <a class="row-title" href="<?php echo esc_url( home_url( '/' ) ); ?>wp-admin/post.php?post=<?php echo $post_ID; ?>&action=edit"><?php echo strip_tags($cont); ?></a>
- <?php
- }
- }
- add_filter('manage_posts_columns', 'replace_title_column');
- add_action('manage_posts_custom_column', 'replace_title_products', 10, 2);
- add_filter('manage_pages_columns', 'replace_title_column');
- add_action('manage_pages_custom_column', 'replace_title_products', 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement