public function __construct()
 {
     parent::__construct('contact');
     $this->setup_meta_fields();
     Rtbiz::$loader->add_action('init', $this, 'init_labels', 9);
     Rtbiz::$loader->add_action('init', $this, 'init_entity');
     //Rtbiz::$loader->add_action( 'add_meta_boxes_' . $this->post_type, $this, 'metabox_rearrange' );
     // Admin primary Notice
     Rtbiz::$loader->add_action('admin_notices', $this, 'check_primary_email_for_admin_notice');
     Rtbiz::$loader->add_action('pre_get_posts', $this, 'contact_posts_filter');
     Rtbiz::$loader->add_action('before_delete_post', $this, 'before_contact_deleted');
     Rtbiz::$loader->add_action('wp_ajax_search_user_from_name', $this, 'search_user_ajax');
     /**
      * Add ACL meta box
      */
     Rtbiz::$loader->add_action('rtbiz_entity_meta_boxes-' . $this->post_type, $this, 'acl_meta_boxes');
     //User integration
     Rtbiz::$loader->add_action('user_register', $this, 'contact_create_for_wp_user');
     Rtbiz::$loader->add_action('manage_users_custom_column', $this, 'manage_export_user_columns', 15, 3);
     Rtbiz::$loader->add_action('wp_ajax_rtbiz_export_contact', $this, 'export_contact');
     Rtbiz::$loader->add_action('wp_ajax_rtbiz_export_all_contacts', $this, 'export_all_contacts');
     Rtbiz::$loader->add_action('admin_notices', $this, 'exported_admin_notice');
     // for bulk action
     Rtbiz::$loader->add_action('admin_footer-users.php', $this, 'add_export_user_bulk_action');
     Rtbiz::$loader->add_action('load-users.php', $this, 'callback_bulk_action');
     rtbiz_register_p2p_connection($this->post_type, 'user', array('cardinality' => 'one-to-one', 'admin_column' => 'any', 'title' => '', 'from_labels' => array('column_title' => 'User'), 'to_labels' => array('column_title' => 'Staff / Customer')));
 }
Example #2
0
/**
 * Register a company connection with a post type
 *
 * @param $post_type
 * @param $label
 */
function rtbiz_register_company_connection($post_type, $label = array())
{
    global $rtbiz_company;
    rtbiz_register_p2p_connection($post_type, $rtbiz_company->post_type, $label);
}