init_hooks(); } /** * Initialize hooks. */ private function init_hooks() { add_action( 'init', array( $this, 'register_post_type' ) ); } /** * Register payments post type. */ public function register_post_type() { $labels = array( 'name' => __( 'Payments', 'afridirect-payment' ), 'singular_name' => __( 'Payment', 'afridirect-payment' ), 'menu_name' => __( 'Payments', 'afridirect-payment' ), 'add_new' => __( 'Add New', 'afridirect-payment' ), 'add_new_item' => __( 'Add New Payment', 'afridirect-payment' ), 'edit_item' => __( 'View Payment', 'afridirect-payment' ), 'new_item' => __( 'New Payment', 'afridirect-payment' ), 'view_item' => __( 'View Payment', 'afridirect-payment' ), 'search_items' => __( 'Search Payments', 'afridirect-payment' ), 'not_found' => __( 'No payments found', 'afridirect-payment' ), 'not_found_in_trash' => __( 'No payments found in Trash', 'afridirect-payment' ), ); $args = array( 'labels' => $labels, 'public' => false, 'show_ui' => true, 'show_in_menu' => false, // We'll add it to our custom menu. 'show_in_admin_bar' => false, 'show_in_nav_menus' => false, 'can_export' => true, 'has_archive' => false, 'exclude_from_search' => true, 'publicly_queryable' => false, 'capability_type' => 'post', 'supports' => array( 'title' ), 'rewrite' => false, ); register_post_type( 'afridirect_payment', $args ); } }