• Welcome to Tux Reports: Where Penguins Fly. We hope you find the topics varied, interesting, and worthy of your time. Please become a member and join in the discussions.
Resource icon

HOWTO: Add a custom post in admin panel for XF Thread ID

Integrating XenForo and WordPress requires more than just a means to create a XenForo thread from a WordPress post, it requires easier maintenance too. The following code will help an administrator see the thread tied to a WordPress post.

Add the following WordPress actions to the theme's function.php file:

PHP:
add_filter( 'manage_posts_columns', 'add_thread_id' );
function add_thread_id($columns) {
   $columns['threads'] = 'Threads';
   return $columns;
}

add_action( 'manage_posts_custom_column', 'xf_show_columns' );
function xf_show_columns($name) {
   global $XF, $post;
   switch ($name) {
     case 'threads' :
       $threads = $XF->getThreadIdForPost($post_id);
       echo $threads;
   }
}

XenForo WordPress Integration WP Post Admin Panel.png
Author
LPH
Views
507
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from LPH

Top