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
- Disable plugin / plugin action via theme
- Changing the “Plugin Activated” Message Default
- Changing wp login url without .htaccess
- Need to create a Theme demo site that features multiple themes
- Why does including a file in theme’s functions.php not work?
- Adding New Role
- Add Top-Level Menu that opens URL
- Is there an action that is called when a post is restored from the trash?
- wordpress custom login successful redirect hook
- WordPress ajax call for not logged in users, doesn’t work
- Replace existing pages with new pages, keep menu links
- Display All Non-Used Plugins
- why in my wordpress admin panel the membership option is not showing
- New Plugin: Post update pushes a copy as a revision
- Moving WordPress from host without FTP?
- Placement of Code in Plugin for hooking `save_post`
- Making menu link open in new tab?
- Add get_option to jquery
- How can plugins have their own pages?
- Avoiding Duplicate function names in Post Loop (WP_Footer script)
- How to add class in plugin only for network site?
- PHP Fatal error: Call to undefined function plugin_basename
- Executing my function once on a specific time
- Missing Argument
- load_plugin_textdomain error
- See which user installed a plugin?
- Edit default comments page in WP Admin
- Globally register styles but enqueue them selectively
- Adding Shortcode to Text Widget
- Does WordPress validate inputs to all functions? (such as get_user_meta and insert_user_meta)
- Using a function to change favorites listing
- WordPress web pages keep getting deleted (moved into the trash) by themselves
- Run plugins only on certain pages
- (FES EDD) New vendor submission page is blank
- WP Query. Is there a maximum size?
- How to change the name of the “edit my profile” link in the WordPress admin backend
- How do I write an inventory list plugin that creates dynamic details pages?
- Difference and examples of esc_attr__() and esc_attr_e()
- Is there a best practice remediation for PhpStorm’s warning that void function the_post_thumbnail is used?
- How to over-ride a file in a plugin? [closed]
- Overwrite category head title
- execute function after one completed
- How to reset the plugins without deactivate the plugin
- plugins_url() works everywhere but wp_reqister_script()
- Replacing global wp_query
- Simulating a wp page – wp page load sequence
- How to get specific string/value from an array? php [closed]
- WordPress Stock Update Programatically
- 5 PHP Fatal error: Uncaught ArgumentCountError (Cannot Find)
- Getting a ressource ID, from a WC_Order_Item_Product/Order
- same user role or copy the user role to be same as the other role
- Custom form not showing in correct place on page
- Equivalent of admin.php for public pages
- Use jQuery Datepicker code from plugin
- Execute a function when the entire page is displayed
- How to force load a page in plugin?
- How can i listing current category and Featured Category post list?
- How to add custom function to pluggable.php
- Ajax request sends url rather than data
- grab or load text on demand
- Is there a syntax highlighting plugin for HTML View? [duplicate]
- sliding/fading header plugin or approach suggestion
- How to permanently show Word Counter on Create/Edit Page. WordPress5.9.3
- How would I get the new plugin version on this function?
- Copy/paste local images not working in WordPress
- Search in WordPress
- How to allow URL with filename & extension in wordpress?
- Modify function output in a plugin
- Is admin section completely customizable in terms of styling?
- How to make the first letter of a post title uppercase, in a plugin?
- Echo custom admin field into a is_single()
- Migrating custom php we wrote from functions.php into a site-specific plugin
- Options page textarea to populate custom post select field
- Code fails in plugin file but works in functions.php
- Conditional required fields for WordPress Contact Form 7
- Cannot access variables within a widget
- WordPress plugin options need to delete after deactivate & uninstall
- WordPress function to add text
- Saving an array to get_options
- Doing action based on input from options menu
- Adding hero images to blog posts
- Frontpage Admin Bar Disappeared
- Sync roles across several plugins
- How to disable plugin capability : “create new category”
- Option value not getting updated until page refresh in WordPress
- WordPress Custom Page Blog Template Pagination Problem (Pagination Not Displaying)
- Shortcode cannot parse attributes within double quotes. ” is becoming ” breaking my shortcode
- Set the Social Icon Size in footer