Skip to content

Instantly share code, notes, and snippets.

function register_book_post_type() {
$args = array (
'label' => esc_html__( 'Books', 'text-domain' ),
'labels' => array(
'menu_name' => esc_html__( 'Books', 'text-domain' ),
'name_admin_bar' => esc_html__( 'Book', 'text-domain' ),
'add_new' => esc_html__( 'Add new', 'text-domain' ),
'add_new_item' => esc_html__( 'Add new Book', 'text-domain' ),
'new_item' => esc_html__( 'New Book', 'text-domain' ),
<?php
add_action( 'mb_relationships_init', function() {
MB_Relationships_API::register( array(
'id' => 'books_to_authors',
'from' => array(
'object_type' => 'post',
'post_type' => 'book',
'admin_column' => 'before title', // THIS!