The main errors where the missing of the $post_ID
parameter in page_template_field
and using $custom_field_id
instead of $post_ID
.
Anyway, this works and is simpler:
add_filter('manage_pages_columns', 'column_page');
function column_page($defaults) {
$defaults['column_template'] = 'Page Template';
return $defaults;
}
add_action('manage_pages_custom_column','column_page_template',10,2);
function column_page_template($column_name, $post_ID) {
if ($column_name == 'column_template') {
$custom_field_values = get_post_meta($post_ID,'page_template');
if (!empty($custom_field_values)) {
echo '<p> '. join(', ',$custom_field_values) .' </p>';
}
}
}
Related Posts:
- Best collection of code for your 'functions.php' file [closed]
- What’s the point of using WordPress’s built in admin-ajax.php?
- Is there a way to lock certain pages from being edited by anyone other then the admin?
- wordpress reusable content blocks
- Add a plugin before main container
- Adding a pagenavi to function for displaying bookmarks
- How do I create pages within a WordPress post?
- What is the most efficient way of adding additional functionaliy for admin only
- Add_Meta_box to custom page (formidable edit post)
- Get content and send to 3rd party
- Wordress admin page is fetching error You do not have sufficient permissions to access this page.
- Create a blank admin page from plugin
- Remove 3rd party plugin notices from within own plugin
- Between functions.php (theme), widgets, and plugins, which is loaded first?
- Where do I put the code snippets I found here or somewhere else on the web?
- Manually set global $post vars with an ID, in order to use template tags
- Disable plugin / plugin action via theme
- How to check if user is in back end?
- How do i know the current post type when on post.php in admin?
- Pass PHP variable to javascript
- Create tabs inside Plugins Admin Page [closed]
- Changing the “Plugin Activated” Message Default
- How to Add a Third Level Sub Menu to the WordPress Admin Menu
- How do I call wp_get_current_user() in a plugin when plugins are loaded before pluggable.php?
- How do I replace a function, declared inside a plugin’s class, in functions.php?
- What are the best practices for updating?
- How to not allow users to create new tags, but allow to them to use existing ones
- How to export comments in WordPress?
- Is there a way (plugin?) to restrict a user to being able to edit just one page?
- How to set back-end language per user?
- How to include a plugin’s php file to another plugin functions file [duplicate]
- How can I call a function from one plugin within another plugin?
- Shared functionality in plugins and themes
- Gutenberg disallow certain custom blocks but keep all core blocks?
- Remote upload file to server B
- Publish author posts only with editor approval?
- Replacing Icons in the Dashboard
- How can I make an Ajax login form work with FORCE_SSL_ADMIN enabled?
- Is There a WordPress Hook to Filter the Edit Posts View?
- Changing wp login url without .htaccess
- Add section (add_settings_section) to a custom page (add_submenu_page)
- Creating a WordPress admin page without a menu for a plugin
- How to remove WPML Generator Meta Tag by theme’s functions.php (override plugin function)? [closed]
- What is the best page ordering plugin that works well with WPML? [closed]
- How to remove duplicate sub-menu name for top level menu items in a plugin?
- Plugin update error message
- Limit access to posts/pages by user roles
- Using functions from a plugin in your theme
- Prevent publishing the post before setting a featured image?
- Keep one user logged for a year?
- Remove Google Fonts Which Are (Probably) Added By Plugins
- Customizing subject in comment notification e-mails
- Admin plugin, how can I output a different content-type?
- Plugin or mod for wordpress to make content publication SUPER easy
- if plugin is active? check if plugin is enabled or not?
- How can I log a user out of WordPress before the page loads?
- Common functionality between my own plugins
- WP showing “warning: call_user_func_array()”, What to do?
- Need to create a Theme demo site that features multiple themes
- Best way to manage a lot of pages in Wp Admin [closed]
- Adding a text domain to every __(), _e() and __n() gettext call without a plan to create own translations
- Define Function in functions.php or plugin and call in theme loop
- Autogenerate wordpress shortcodes using array?
- How to Loop Plugin Option Field Set?
- Create page when plugin is activated
- Can we completely remove the WordPress Sitemaps (WordPress 5.5)?
- How do I only load a plugin js on it’s settings pages?
- How to enable Admins to see Plugins
- Declare a function before plugin does on the theme functions.php file
- How to handel multiple checkbox field in the admin settings page with Settings API
- How to add a help tab to all admin pages – including plugin pages
- Why does including a file in theme’s functions.php not work?
- wp_insert_user – how to send verification email before logging in
- Custom plugin settings: clicking “save changes” does not display success message
- How to override a theme function (within a class) using a plugin
- Editor access to plugin settings
- Creating button next to “add media” that allows you to choose a single post
- WooCommerce create new product and add to cart on form submit
- jQuery plugin only in one page/post
- Seeking clarification on page request life-cycle
- Generate Advanced Custom Fields box in custom admin menu page
- How to assign user a role if none is present when logging in
- How can I show drafts in wp_dropdown_pages list?
- Is the WordPress HTTPS Plugin Still Safe To Use? [closed]
- Saving Plugin settings to the database
- Bad Request (Invalid Hostname) on working server, database problem
- Set a User as Author of all ‘New Posts’ posted
- How to develop a community feature in the dashboard for multiauthor site
- Shortcode display outside the div
- Post source link plugin – small modification
- Pages with 2 Columns
- Adding New Role
- How to create a Page alias in WordPress
- Change destination author link
- How to turn off email you receive when registered?
- Removing user contact methods works from functions.php but not from a plugin
- Execute a function using ajax
- Shortcode under a Shortcode Multiple times Possible?
- Custom Widget outputs the input but doesn’t save anything inside the textarea
- How do you auto-activate plugins from child themes