esc_html__( 'Add company', 'accounts-buddy-accounting' ), 'singular_name' => esc_html__( 'Company', 'accounts-buddy-accounting' ), 'menu_name' => esc_html__( 'Companies', 'accounts-buddy-accounting' ), 'all_items' => esc_html__( 'Companies', 'accounts-buddy-accounting' ), 'edit_item' => esc_html__( 'Edit Company', 'accounts-buddy-accounting' ), 'new_item' => esc_html__( 'New Company', 'accounts-buddy-accounting' ), 'view_item' => esc_html__( 'View Company', 'accounts-buddy-accounting' ), 'search_items' => esc_html__( 'Search Company', 'accounts-buddy-accounting' ), 'not_found' => esc_html__( 'No compnay Related to your search', 'accounts-buddy-accounting' ), 'not_found_in_trash' => esc_html__( 'No company in trash', 'accounts-buddy-accounting' ) ); $args = array( 'labels' => $labels, 'label' => esc_html__( 'Manage Companies', 'accounts-buddy-accounting' ), 'description' => esc_html__( 'Admin can access all companies while other users can only access companies they have access to.', 'accounts-buddy-accounting' ), 'supports' => array ( 'title' ), 'public' => false, 'publicly_queryable' => false, 'show_ui' => true, 'show_in_menu' => false, 'query_var' => true, 'rewrite' => array('slug' => 'company' ), 'capability_type' => 'post', 'has_archive' => true, 'menu_icon' => 'dashicons-clipboard', 'menu_position' => 30, 'register_meta_box_cb' => 'abas_company_features', ); register_post_type ( 'abas_company', $args ); } add_action ( 'init', 'abas_company_post_type_init' ); endif; //registeration of post type ends here. if ( ! function_exists( 'abas_company_features' ) ) : function abas_company_features() { $screens = array ( 'abas_company' ); foreach ( $screens as $screen ) { add_meta_box( 'myplugin_sectionid', esc_html__ ( "Company Details", "accounts-buddy-accounting" ), 'abas_companys_features_callback', $screen ); } } //Parts features post. add_action( 'add_meta_boxes', 'abas_company_features' ); endif; if ( ! function_exists( 'abas_companys_features_callback' ) ) : function abas_companys_features_callback( $post ) { if ( ! current_user_can( 'manage_options' ) ) { wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'accounts-buddy-accounting' ) ); } wp_nonce_field ( 'abas_meta_box_nonce', 'abas_companys_features_sub' ); settings_errors (); $content = ''; $content = '
| ';
$image_id = get_post_meta ( $post->ID, '_company-logo', true );
$content .= ' ';
if( $image = wp_get_attachment_image_url ( $image_id, 'Large' ) ) {
$content .= ' | |
| '; $content .= ''; $content .= ' | '; $value = get_post_meta ( $post->ID, '_business_type', true ); $content .= ''; $content .= ''; $content .= ' |
| '; $content .= ''; $content .= ' | '; $value = get_post_meta ( $post->ID, '_address_2', true ); $content .= ''; $content .= ''; $content .= ' |
| '; $content .= ''; $content .= ' | '; $value = get_post_meta ( $post->ID, '_state', true ); $content .= ''; $content .= ''; $content .= ' |
| '; $content .= ''; $content .= ' | '; $value = get_post_meta ( $post->ID, '_zip_code', true ); $content .= ''; $content .= ''; $content .= ' |
| '; $content .= ''; $content .= ' | '; $value = get_post_meta ( $post->ID, '_email', true ); $content .= ''; $content .= ''; $content .= ' |
| '; $content .= ''; $content .= ' | '; $value = get_post_meta( $post->ID, '_about_company', true ); $content .= ''; $content .= ''; $content .= ' |