UM_Admin_Columns

The Ultimate Member UM Admin Columns class.

Defined (1)

The class is defined in the following location(s).

/admin/core/um-admin-columns.php  
  1. class UM_Admin_Columns { 
  2.  
  3. function __construct() { 
  4.  
  5. $this->slug = 'ultimatemember'; 
  6.  
  7. add_filter('manage_edit-um_form_columns', array(&$this, 'manage_edit_um_form_columns') ); 
  8. add_action('manage_um_form_posts_custom_column', array(&$this, 'manage_um_form_posts_custom_column'), 10, 3); 
  9.  
  10. add_filter('manage_edit-um_directory_columns', array(&$this, 'manage_edit_um_directory_columns') ); 
  11. add_action('manage_um_directory_posts_custom_column', array(&$this, 'manage_um_directory_posts_custom_column'), 10, 3); 
  12.  
  13. add_filter('post_row_actions', array(&$this, 'post_row_actions'), 99, 2); 
  14.  
  15.  
  16. /*** 
  17. *** @custom row actions 
  18. ***/ 
  19. function post_row_actions($actions, $post) { 
  20. //check for your post type 
  21. if ($post->post_type =="um_form") { 
  22. $actions['um_duplicate'] = '<a href="' . $this->duplicate_uri( $post->ID ) . '">' . __('Duplicate', 'ultimatemember') . '</a>'; 
  23. return $actions; 
  24.  
  25. /*** 
  26. *** @duplicate a form 
  27. ***/ 
  28. function duplicate_uri( $id ) { 
  29. $url = add_query_arg('um_adm_action', 'duplicate_form', admin_url('edit.php?post_type=um_form') ); 
  30. $url = add_query_arg('post_id', $id, $url); 
  31. return $url; 
  32.  
  33. /*** 
  34. *** @Custom columns for Form 
  35. ***/ 
  36. function manage_edit_um_form_columns($columns) { 
  37.  
  38. $admin = new UM_Admin_Metabox(); 
  39.  
  40. $new_columns['cb'] = '<input type="checkbox" />'; 
  41. $new_columns['id'] = __('ID') . $admin->_tooltip( 'Unique ID for each form' ); 
  42. $new_columns['title'] = __('Title'); 
  43. $new_columns['mode'] = __('Type') . $admin->_tooltip( 'This is the type of the form' ); 
  44. $new_columns['shortcode'] = __('Shortcode') . $admin->_tooltip( 'Use this shortcode to display the form' ); 
  45. $new_columns['date'] = __('Date'); 
  46.  
  47. return $new_columns; 
  48.  
  49.  
  50. /*** 
  51. *** @Custom columns for Directory 
  52. ***/ 
  53. function manage_edit_um_directory_columns($columns) { 
  54.  
  55. $admin = new UM_Admin_Metabox(); 
  56.  
  57. $new_columns['cb'] = '<input type="checkbox" />'; 
  58. $new_columns['id'] = __('ID') . $admin->_tooltip( 'Unique ID for each form' ); 
  59. $new_columns['title'] = __('Title'); 
  60. $new_columns['shortcode'] = __('Shortcode') . $admin->_tooltip( 'Use this shortcode to display the member directory' ); 
  61. $new_columns['date'] = __('Date'); 
  62.  
  63. return $new_columns; 
  64.  
  65.  
  66. /*** 
  67. *** @Display cusom columns for Form 
  68. ***/ 
  69. function manage_um_form_posts_custom_column($column_name, $id) { 
  70. global $wpdb, $ultimatemember; 
  71.  
  72. switch ($column_name) { 
  73.  
  74. case 'id': 
  75. echo '<span class="um-admin-number">'.$id.'</span>'; 
  76. break; 
  77.  
  78. case 'shortcode': 
  79. echo $ultimatemember->shortcodes->get_shortcode( $id ); 
  80. break; 
  81.  
  82. case 'mode': 
  83. $mode = $ultimatemember->query->get_attr('mode', $id); 
  84. echo '<span class="um-admin-tag um-admin-type-'.$mode.'">'. $ultimatemember->form->display_form_type($mode, $id) . '</span>'; 
  85. break; 
  86.  
  87.  
  88.  
  89. /*** 
  90. *** @Display cusom columns for Directory 
  91. ***/ 
  92. function manage_um_directory_posts_custom_column($column_name, $id) { 
  93. global $wpdb, $ultimatemember; 
  94.  
  95. switch ($column_name) { 
  96.  
  97. case 'id': 
  98. echo '<span class="um-admin-number">'.$id.'</span>'; 
  99. break; 
  100.  
  101. case 'shortcode': 
  102. echo $ultimatemember->shortcodes->get_shortcode( $id ); 
  103. break; 
  104.  
  105.  
  106.