Description
Register the oik-recording Custom Post TypeA Recording is a set of tracks. If there is more than one volume in the recording you will need to create more than one recording. e.g. Title: The World Is Yours: The Anthology 1968-1976 Disc 3 Tracks (oik-track) refer to a specific volume of a recording Copyright information, label, and other stuff can go in the content Should there be a link to a product – like oik-plugins has to WooCommerce or EDD's products ? You should upload the album cover photos as attachments With front first in the menu – so that it can be selected in a slider or other display We need some way to uniquely identify the album – this is the mediaprimaryclassid which is pretty hideous… {D1607DBC-E323-4BE2-86A1-48A42A28441E}
Usage
oik_tunes_register_recording();Parameters
Returns
voidSource
File name: oik-tunes/oik-tunes.phpLines:
function oik_tunes_register_recording() { $post_type = 'oik-recording'; $post_type_args = array(); $post_type_args['label'] = 'Recordings'; $post_type_args['description'] = 'Audio and video recordings'; $post_type_args['show_in_rest'] = true; bw_register_post_type( $post_type, $post_type_args ); bw_register_field( "_oikt_type", "select", "Recording type", array( '#options' => oik_tunes_recording_types() ) ); bw_register_field( "_oikt_year", "numeric", "Recording year" ); bw_register_field( "_oikt_MPCI", "text", "Media Primary Class ID - NOT a unique key" ); bw_register_field( "_oikt_URI", "text", "Unique Recording Identifier - possibly a unique key" ); bw_register_field_for_object_type( "_oikt_type", $post_type ); bw_register_field_for_object_type( "_oikt_year", $post_type ); bw_register_field_for_object_type( "_oikt_MPCI", $post_type ); bw_register_field_for_object_type( "_oikt_URI", $post_type ); add_filter( "manage_edit-{$post_type}_columns", "oik_tunes_oik_recording_columns", 10, 2 ); add_action( "manage_{$post_type}_posts_custom_column", "bw_custom_column_admin", 10, 2 ); }View on GitHub
