Not tested but this should work:
add_action('manage_pages_custom_column', 'display_page_custom_cols', 10, 2);
function display_page_custom_cols($col_name, $post_id) {
global $wpdb;
$user_group = $wpdb->get_results("SELECT * From custom_user_group",OBJECT_K);
if ('user_group' == $col_name) {
$pages = explode(',',get_post($post_id));
$output = array();
foreach ($pages as $page ) {
$output[] = $user_group[$page]->GroupName;
}
echo implode(',',$output);
}
}
Related Posts:
- Difference between the_content() and get_post()?
- How to get the image EXIF date/time and use it for the WP post date/time
- Show modified time if post is actually modified
- AJAX handler throws 400 (Bad request) – why?
- How to display the_post_thumbnail if a post has one or otherwise display the first image in a post?
- Most elegant way to enqueue scripts in function.php with foreach loop
- WordPress – thumbnail image from youtube (function and loop)
- Most efficient way to get custom database records from 20 buttons and 20 tables?
- How to update BuddyPress xprofile fields programmatically? [closed]
- Adding WooCommerce to a Custom Theme – not working [closed]
- A snippet after every image
- Function to show only first instance of shortcode
- Automatically insert php function into post $the_content
- Creating loop within functions.php
- Best Practice for Syncing Local Development With Staging Development [closed]
- Display WooCommerce subscriptions for user [closed]
- How to use max and min values of custom fields
- Is it good practice to use wpdb->query() function?
- Custom Shortcode, functions PHP WP_Query loop
- Filtering posts by category name based on page’s slug
- Check if row exists before inserting
- Remove the deleted users avatar from list
- 2 Loops, Only Displaying 1 Loop in Both Loops
- when I fetch data from remote mysql database in wordpress built in wordpress function is not working?
- WordPress shortcode attributes for database SELECT?
- Having a Function Inside of the Loop
- Getting different functions data while using while loop in wordpress
- Updating Media Published Date When Parent Post Is Modified in WordPress
- Create a new query in function.php to filter blog posts
- Limit length of first excerpt in the loop
- Default Custom Field Value Automatically Update
- Multiple Loops Meta Data
- Get User Login Data (date, time… )
- Multisite 404 on pages – rewrite error breaks database
- Accessing two databases wordpress
- Why doesn’t is_page(id) work in functions.php?
- Connecting to a 2nd DB gives me no results when querying
- Is There Any Built In WP Functionality For Combining Form Fields To Return Specific Data
- The Loop not looping?
- While loop with an exception after a count is reached
- How do I pull excerpts from pages?
- Output loop to function return?
- issue with if/elseif in_array inside foreach loop display only one post
- Check if a value exists in database table
- Genesis Framework: How to exclude a specific author from archive custom loop
- Problem with calling custom function in a foreach loop
- Get term slug by term id and then explode it
- Using functions.php to include code that’s processed inline
- wp_usermeta – Read from database, but save function broken
- Breaking up multiple words and inserting an image after first word
- Simplest Way to Build Custom Archives Page?
- Woocommerce Variable Product Dropdown for Custom Shop Template
- How to loop while adding data to database?
- the_date() and the_time() functions display actual date an time instead of published date and time
- How can I connect to a second database and still be able to use wp functions like get_post_types()?
- Fetch ids of live posts only (not posts with other statuses) and change status with a button in candidate dashboard
- Writing a function for WP Cron to run a SQL command daily
- Update wp_postmeta table based on 2 keys
- How set a while with a function
- Pass post ID from archive template to functions file
- Prevent function from triggering on current page
- Button click counter for login user
- How to use `foreach()` in ajax call
- Function stops working
- Code executes outside of Loop while same code gives ‘Uninitialized string offset’ notice inside a while loop
- Only seems to be displaying one child when there are supposed to be multiple
- Database SQL Error, Should Work
- Database Query not working
- Integrate WP Tiles into existing loop (index.php) and theme
- Check if excerpt is empty at loop-portfolio
- Way of getting queried loop before the query with a filter hook?
- Post variables not displaying correctly in custom function
- Functions file mods and CPU
- Why don’t some template tags work when querying information on single.php?
- trouble with passing class method data to outside function
- how to handle multiple forloop?
- Parse error: syntax error, unexpected ‘endforeach’ (T_ENDFOREACH) in [closed]
- How do grab the main loop, with conditions, and output via shortcodes
- Creating mixture of shortcodes to use in the visual/text editor
- Bulk set Post Title as Tag where Tag is Empty Function
- Get full slug for a WordPress Post
- Update post meta with wp cron
- Is it ok to use a function to output the text domain name in a wordpress theme
- contactform7 remove tags with “wpcf7_autop false” from functions.php
- How to get an array of menu items from the toolbar?
- List of Body Classes Generated by body_class()
- Redirect specific page in WordPress for first time visit
- Display alert on successful user Sign Up
- Set spesific size of featured images
- Functions.php Problem
- Get arguments from URL
- Can’t Write Custom Widget Code In One ECHO
- Add a class to post if it has been recently updated
- how to add_filter to non hook function
- Members only function, but allow account activation [solved]
- Why is the term of my current page not returning a slug?
- Fatal error: Call to undefined function. Underscore me
- What is wrong with functions.php? Fills error log with same error
- Function returning queried meta value based on current post ID
- How do I make my child theme’s CSS update when I save it?