/*
This is the taxonomy build, ready for copy pasting
Do you want to add a WordPress standard thumbnail, add the post type in config.php [Rule 14]
*/
add_action( 'init', 'header_images_taxonomy_options' );
function header_images_taxonomy_options() {
$name = 'header_images';
$post_type = 'header_images_posts';
//=============== Register custom post type - VOORBEELD ================
register_post_type( $post_type, // This will be the postype!
array( 'label' => __('Header afbeeldingen'),
'labels' => array( 'name' => __('Header afbeeldingen'),
'singular_name' => __('Header afbeeldingen'),
'add_new' => __('Afbeelding toevoegen'),
'add_new_item' => __('Nieuwe afbeelding'),
'edit_item' => __('Wijzig afbeelding'),
'new_item' => __('Nieuwe afbeelding'),
'all_items' => __('Alle afbeeldingen'),
'view_item' => __('Bekijk afbeeldingen'),
'search_items' => __('Zoek afbeelding'),
'not_found' => __('Er zijn geen afbeeldingen gevonden'),
'not_found_in_trash' => __('Geen afbeeldingen gevonden in de prullenbak')
),
'public' => true,
'can_export' => true,
'show_ui' => true,
'_builtin' => false,
'_edit_link' => 'post.php?post=%d',
'capability_type' => 'post',
//'menu_icon' => get_bloginfo('template_url').'/images/favicon.ico',
'hierarchical' => false,
'rewrite' => array( "slug" => "header_imagess" ), // Permalinks
'supports' => array( 'title',
'editor',
'excerpt',
'thumbnail',
'author',
'comments',
'trackbacks',
'custom-fields',
'revisions'
),
'show_in_menu' => true,
'taxonomies' => array( 'header_imagescat',
'header_imagestag'
)
)
);
//=============== Register custom taxonomy - TAGS ================
register_taxonomy( "header_imagestag",
array( $post_type ), // Change this to the postype
array( "hierarchical" => false,
"label" => "Tags",
'labels' => array( 'name' => __('Tags'),
'singular_name' => __('Tags'),
'search_items' => __('Tags zoeken'),
'popular_items' => __('Populaire Tags'),
'all_items' => __('Alle Tags'),
'parent_item' => __('Huidige Tags'),
'parent_item_colon' => __('Huidige Tags:'),
'edit_item' => __('Wijzig Tags'),
'update_item' => __('Update Tags'),
'add_new_item' => __('Nieuwe Tag toevoegen'),
'new_item_name' => __('Nieuwe Tag')
),
'public' => true,
'show_ui' => true,
"rewrite" => true
)
);
//=============== Register custom taxonomy - CATEGORY ================
register_taxonomy( "header_imagescat",
array( $post_type ), // Change this to the postype
array( "hierarchical" => true,
"label" => "Categorieën",
'labels' => array( 'name' => __('Categorie'),
'singular_name' => __('Categorie'),
'search_items' => __('Categorieën zoeken'),
'popular_items' => __('Populaire categorieën'),
'all_items' => __('Alle categorieën'),
'parent_item' => __('Huidige categorie'),
'parent_item_colon' => __('Huidige categorie:'),
'edit_item' => __('Wijzig categorie'),
'update_item' => __('Wijzig categorie'),
'add_new_item' => __('Nieuwe categorie toevoegen'),
'new_item_name' => __('Nieuwe categorie')
),
'public' => true,
'show_ui' => true,
'with_front' => false,
"rewrite" => true
)
);
} // End custom taxonomy config
//=============== Register custom metaboxes ================
add_filter( 'cmb_meta_boxes', 'header_images_meta_boxes' );
function header_images_meta_boxes( array $meta_boxes ) {
$prefix = '';
$meta_boxes['test_metabox'] = array(
'id' => 'test_metabox',
'title' => __( 'Test Metabox', 'cmb' ),
'pages' => array( 'header_images_posts', ), // Post type
'context' => 'normal',
'priority' => 'high',
'show_names' => true, // Show field names on the left
// 'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend
'fields' => array(
array(
'name' => __( 'Test Text', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_text',
'type' => 'text',
// 'sanitization_cb' => 'my_custom_sanitization', // custom sanitization callback parameter
// 'escape_cb' => 'my_custom_escaping', // custom escaping callback parameter
// 'on_front' => false, // Optionally designate a field to wp-admin only
// 'repeatable' => true,
),
array(
'name' => __( 'Test Text Small', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_textsmall',
'type' => 'text_small',
// 'repeatable' => true,
),
array(
'name' => __( 'Test Text Medium', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_textmedium',
'type' => 'text_medium',
// 'repeatable' => true,
),
array(
'name' => __( 'Website URL', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'url',
'type' => 'text_url',
// 'protocols' => array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet'), // Array of allowed protocols
// 'repeatable' => true,
),
array(
'name' => __( 'Test Text Email', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'email',
'type' => 'text_email',
// 'repeatable' => true,
),
array(
'name' => __( 'Test Time', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_time',
'type' => 'text_time',
),
array(
'name' => __( 'Time zone', 'cmb' ),
'desc' => __( 'Time zone', 'cmb' ),
'id' => $prefix . 'timezone',
'type' => 'select_timezone',
),
array(
'name' => __( 'Test Date Picker', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_textdate',
'type' => 'text_date',
),
array(
'name' => __( 'Test Date Picker (UNIX timestamp)', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_textdate_timestamp',
'type' => 'text_date_timestamp',
// 'timezone_meta_key' => $prefix . 'timezone', // Optionally make this field honor the timezone selected in the select_timezone specified above
),
array(
'name' => __( 'Test Date/Time Picker Combo (UNIX timestamp)', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_datetime_timestamp',
'type' => 'text_datetime_timestamp',
),
// This text_datetime_timestamp_timezone field type
// is only compatible with PHP versions 5.3 or above.
// Feel free to uncomment and use if your server meets the requirement
// array(
// 'name' => __( 'Test Date/Time Picker/Time zone Combo (serialized DateTime object)', 'cmb' ),
// 'desc' => __( 'field description (optional)', 'cmb' ),
// 'id' => $prefix . 'test_datetime_timestamp_timezone',
// 'type' => 'text_datetime_timestamp_timezone',
// ),
array(
'name' => __( 'Test Money', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_textmoney',
'type' => 'text_money',
// 'before' => '£', // override '$' symbol if needed
// 'repeatable' => true,
),
array(
'name' => __( 'Test Color Picker', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_colorpicker',
'type' => 'colorpicker',
'default' => '#ffffff'
),
array(
'name' => __( 'Test Text Area', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_textarea',
'type' => 'textarea',
),
array(
'name' => __( 'Test Text Area Small', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_textareasmall',
'type' => 'textarea_small',
),
array(
'name' => __( 'Test Text Area for Code', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_textarea_code',
'type' => 'textarea_code',
),
array(
'name' => __( 'Test Title Weeeee', 'cmb' ),
'desc' => __( 'This is a title description', 'cmb' ),
'id' => $prefix . 'test_title',
'type' => 'title',
),
array(
'name' => __( 'Test Select', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_select',
'type' => 'select',
'options' => array(
'standard' => __( 'Option One', 'cmb' ),
'custom' => __( 'Option Two', 'cmb' ),
'none' => __( 'Option Three', 'cmb' ),
),
),
array(
'name' => __( 'Test Radio inline', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_radio_inline',
'type' => 'radio_inline',
'options' => array(
'standard' => __( 'Option One', 'cmb' ),
'custom' => __( 'Option Two', 'cmb' ),
'none' => __( 'Option Three', 'cmb' ),
),
),
array(
'name' => __( 'Test Radio', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_radio',
'type' => 'radio',
'options' => array(
'option1' => __( 'Option One', 'cmb' ),
'option2' => __( 'Option Two', 'cmb' ),
'option3' => __( 'Option Three', 'cmb' ),
),
),
/* array(
'name' => __( 'Test Taxonomy Radio', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'text_taxonomy_radio',
'type' => 'taxonomy_radio',
'taxonomy' => 'category', // Taxonomy Slug
// 'inline' => true, // Toggles display to inline
),
array(
'name' => __( 'Test Taxonomy Select', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'text_taxonomy_select',
'type' => 'taxonomy_select',
'taxonomy' => 'category', // Taxonomy Slug
),
array(
'name' => __( 'Test Taxonomy Multi Checkbox', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_multitaxonomy',
'type' => 'taxonomy_multicheck',
'taxonomy' => 'post_tag', // Taxonomy Slug
// 'inline' => true, // Toggles display to inline
),*/
array(
'name' => __( 'Test Checkbox', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_checkbox',
'type' => 'checkbox',
),
array(
'name' => __( 'Test Multi Checkbox', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_multicheckbox',
'type' => 'multicheck',
'options' => array(
'check1' => __( 'Check One', 'cmb' ),
'check2' => __( 'Check Two', 'cmb' ),
'check3' => __( 'Check Three', 'cmb' ),
),
// 'inline' => true, // Toggles display to inline
),
array(
'name' => __( 'Test wysiwyg', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_wysiwyg',
'type' => 'wysiwyg',
'options' => array( 'textarea_rows' => 5, ),
),
array(
'name' => __( 'Test Image', 'cmb' ),
'desc' => __( 'Upload an image or enter a URL.', 'cmb' ),
'id' => $prefix . 'test_image',
'type' => 'file',
),
array(
'name' => __( 'Multiple Files', 'cmb' ),
'desc' => __( 'Upload or add multiple images/attachments.', 'cmb' ),
'id' => $prefix . 'test_file_list',
'type' => 'file_list',
'preview_size' => array( 100, 100 ), // Default: array( 50, 50 )
),
array(
'name' => __( 'oEmbed', 'cmb' ),
'desc' => __( 'Enter a youtube, twitter, or instagram URL. Supports services listed at http://codex.wordpress.org/Embeds.', 'cmb' ),
'id' => $prefix . 'test_embed',
'type' => 'oembed',
),
),
);
return $meta_boxes;
}
?>
/*
This is the taxonomy build, ready for copy pasting
Do you want to add a WordPress standard thumbnail, add the post type in config.php [Rule 14]
*/
add_action( 'init', 'speellijst_taxonomy_options' );
function speellijst_taxonomy_options() {
$name = 'speellijst';
$post_type = 'speellijst_posts';
//=============== Register custom post type - VOORBEELD ================
register_post_type( $post_type, // This will be the postype!
array( 'label' => __('Speellijst'),
'labels' => array( 'name' => __('Speellijst'),
'singular_name' => __('Speellijst'),
'add_new' => __('Onderdeel toevoegen'),
'add_new_item' => __('Nieuw onderdeel'),
'edit_item' => __('Wijzig onderdeel'),
'new_item' => __('Nieuw onderdeel'),
'all_items' => __('Alle onderdelen'),
'view_item' => __('Bekijk onderdeel'),
'search_items' => __('Zoek onderdelen'),
'not_found' => __('Er zijn geen onderdelen gevonden'),
'not_found_in_trash' => __('Geen onderdelen gevonden in de prullenbak')
),
'public' => true,
'can_export' => true,
'show_ui' => true,
'_builtin' => false,
'_edit_link' => 'post.php?post=%d',
'capability_type' => 'post',
//'menu_icon' => get_bloginfo('template_url').'/images/favicon.ico',
'hierarchical' => true,
'has_archive' => true,
'rewrite' => array( "slug" => "speellijst" ), // Permalinks
'supports' => array( 'title',
'editor',
'excerpt',
'thumbnail',
'revisions'
),
'show_in_menu' => true
)
);
} // End custom taxonomy config
//=============== Register custom post type - Columns ================
error_reporting(0);
add_filter( 'manage_edit-speellijst_posts_columns','speellijst_custom_columns') ;
function speellijst_custom_columns( $columns ) {
$columns['cb'] = "";
$columns['title'] = "Titel";
$columns['agenda_date'] = "Speeldatum";
return $columns;
}
add_action( 'manage_speellijst_posts_posts_custom_column','speellijst_custom_columns_content');
function speellijst_custom_columns_content($column, $post_id) {
global $post;
switch( $column ) {
// /* speellijst customfield */
case 'agenda_date' :
$timestamp=get_post_meta($post->ID, 'agenda_date', true );
$customfield = get_post_meta( $post_id, 'agenda_date', true );
if( get_post_meta($post->ID, 'agenda_date', true) != '' ) {
if( get_post_meta($post->ID, 'agenda_time', true) != '' ) {
echo strftime('%A %e %B %Y om ',$timestamp); echo get_post_meta($post->ID, 'agenda_time', true );
} else {
echo strftime('%A %e %b %Y',$timestamp);
}
} else {
echo __( 'Er is nog geen datum ingesteld.' );
}
break;
// /* Just break out of the switch statement for everything else. */
default :
break;
}
}
//=============== Register custom metaboxes ================
add_filter( 'cmb_meta_boxes', 'speellijst_meta_boxes' );
function speellijst_meta_boxes( array $meta_boxes ) {
$prefix = '';
$meta_boxes['speellijst_metabox'] = array(
'id' => 'speellijst_metabox',
'title' => __( 'Agenda punt instellingen', 'cmb' ),
'pages' => array( 'speellijst_posts', ), // Post type
'context' => 'normal',
'priority' => 'high',
'show_names' => true, // Show field names on the left
// 'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend
'fields' => array(
array(
'name' => __( 'Repertoire URL', 'cmb' ),
'id' => $prefix . 'agenda_url',
'type' => 'text',
),
array(
'name' => __( 'Leeftijd', 'cmb' ),
'id' => $prefix . 'agenda_leeftijd',
'type' => 'select',
'options' => array(
'Al' => __( 'Alle leeftijden', 'cmb' ),
'5+' => __( '5+', 'cmb' ),
'4+' => __( '4+', 'cmb' ),
'3+' => __( '3+', 'cmb' ),
),
),
array(
'name' => __( 'Datum', 'cmb' ),
'id' => $prefix . 'agenda_date',
'type' => 'text_date_timestamp',
// 'timezone_meta_key' => $prefix . 'timezone', // Optionally make this field honor the timezone selected in the select_timezone specified above
),
array(
'name' => __( 'Tijd', 'cmb' ),
'id' => $prefix . 'agenda_time',
'type' => 'text_small',
// 'repeatable' => true,
),
array(
'name' => __( 'Plaats', 'cmb' ),
'id' => $prefix . 'agenda_city',
'type' => 'text',
),
array(
'name' => __( 'Tonen op de reserveer pagina', 'cmb' ),
'id' => $prefix . 'reserveer_show',
'type' => 'select',
'options' => array(
'yes' => __( 'Tonen', 'cmb' ),
'no' => __( 'Niet tonen', 'cmb' ),
),
),
array(
'name' => __( 'Locatie', 'cmb' ),
'id' => $prefix . 'agenda_location',
'type' => 'text',
),
array(
'name' => __( 'Knop tekst', 'cmb' ),
'id' => $prefix . 'agenda_btn_text',
'type' => 'text',
),
array(
'name' => __( 'Knop URL', 'cmb' ),
'id' => $prefix . 'agenda_btn_url',
'type' => 'text',
),
),
);
return $meta_boxes;
}
?>
/*
This is the taxonomy build, ready for copy pasting
Do you want to add a WordPress standard thumbnail, add the post type in config.php [Rule 14]
*/
add_action( 'init', 'repertoire_taxonomy_options' );
function repertoire_taxonomy_options() {
$name = 'repertoire';
$post_type = 'repertoire_posts';
//=============== Register custom post type - VOORBEELD ================
register_post_type( $post_type, // This will be the postype!
array( 'label' => __('Repertoire'),
'labels' => array( 'name' => __('Repertoire'),
'singular_name' => __('Repertoire'),
'add_new' => __('Bericht toevoegen'),
'add_new_item' => __('Nieuw bericht'),
'edit_item' => __('Wijzig bericht'),
'new_item' => __('Nieuw bericht'),
'all_items' => __('Alle berichten'),
'view_item' => __('Bekijk berichten'),
'search_items' => __('Zoek berichten'),
'not_found' => __('Er zijn geen berichten gevonden'),
'not_found_in_trash' => __('Geen berichten gevonden in de prullenbak')
),
'public' => true,
'can_export' => true,
'show_ui' => true,
'_builtin' => false,
'_edit_link' => 'post.php?post=%d',
'capability_type' => 'post',
//'menu_icon' => get_bloginfo('template_url').'/images/favicon.ico',
'hierarchical' => true,
'has_archive' => true,
'rewrite' => array( "slug" => "repertoire" ), // Permalinks
'supports' => array( 'title',
'editor',
'excerpt',
'thumbnail',
'revisions'
),
'show_in_menu' => true,
'taxonomies' => array( 'repertoirecat',
'repertoiretag'
)
)
);
//=============== Register custom taxonomy - CATEGORY ================
register_taxonomy( "repertoirecat",
array( $post_type ), // Change this to the postype
array( "hierarchical" => true,
"label" => "Categorieën",
'labels' => array( 'name' => __('Categorie'),
'singular_name' => __('Categorie'),
'search_items' => __('Categorieën zoeken'),
'popular_items' => __('Populaire categorieën'),
'all_items' => __('Alle categorieën'),
'parent_item' => __('Huidige categorie'),
'parent_item_colon' => __('Huidige categorie:'),
'edit_item' => __('Wijzig categorie'),
'update_item' => __('Wijzig categorie'),
'add_new_item' => __('Nieuwe categorie toevoegen'),
'new_item_name' => __('Nieuwe categorie')
),
'public' => true,
'show_ui' => true,
'with_front' => false,
"rewrite" => true
)
);
} // End custom taxonomy config
//=============== Register custom post type - Columns ================
// add_filter( 'manage_edit-repertoire_posts_columns','repertoire_custom_columns') ;
// function repertoire_custom_columns( $columns ) {
//
// $columns['cb'] = "";
// $columns['title'] = "Titel";
// $columns['repertoirecat'] = "Categorie";
//
// return $columns;
// }
//
// add_action( 'manage_repertoire_posts_posts_custom_column','repertoire_custom_columns_content');
// function repertoire_custom_columns_content($column, $post_id) {
//
// global $post;
//
// switch( $column ) {
//
//
// /* repertoirecat */
// case 'repertoirecat' :
//
// $terms = get_the_terms( $post_id, 'repertoirecat' );
// if ( !empty( $terms ) ) {
// $out = array();
// foreach ( $terms as $term ) {
// $out[] = sprintf( '%s',
// esc_url( add_query_arg( array( 'post_type' => $post->post_type, 'genre' => $term->slug ), 'edit.php' ) ),
// esc_html( sanitize_term_field( 'name', $term->name, $term->term_id, 'genre', //'display' ) )
// );
// }
// echo join( ', ', $out );
// } else {
// _e( 'Geen categorie' );
// }
// break;
//
/* Just break out of the switch statement for everything else. */
// default :
// break;
// }
// }
//=============== Register custom metaboxes ================
add_filter( 'cmb_meta_boxes', 'repertoire_meta_boxes' );
function repertoire_meta_boxes( array $meta_boxes ) {
$prefix = '';
$meta_boxes['repertoire_metabox'] = array(
'id' => 'repertoire_metabox',
'title' => __( 'Repertoire instellingen', 'cmb' ),
'pages' => array( 'repertoire_posts', ), // Post type
'context' => 'normal',
'priority' => 'high',
'show_names' => true, // Show field names on the left
// 'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend
'fields' => array(
array(
'name' => __( 'Speel type', 'cmb' ),
'id' => $prefix . 'repertoire_type',
'type' => 'text',
),
array(
'name' => __( 'Leeftijd', 'cmb' ),
'id' => $prefix . 'repertoire_leeftijd',
'type' => 'text',
),
array(
'name' => __( 'Duur', 'cmb' ),
'id' => $prefix . 'repertoire_duur',
'type' => 'text',
),
array(
'name' => __( 'Jaar', 'cmb' ),
'id' => $prefix . 'repertoire_jaar',
'type' => 'text',
)
),
);
return $meta_boxes;
}
?>
/*
This is the taxonomy build, ready for copy pasting
Do you want to add a WordPress standard thumbnail, add the post type in config.php [Rule 14]
*/
add_action( 'init', 'video_taxonomy_options' );
function video_taxonomy_options() {
$name = 'video';
$post_type = 'video_posts';
//=============== Register custom post type - VOORBEELD ================
register_post_type( $post_type, // This will be the postype!
array( 'label' => __('Video'),
'labels' => array( 'name' => __('Video'),
'singular_name' => __('Video'),
'add_new' => __('Video toevoegen'),
'add_new_item' => __('Nieuwe video'),
'edit_item' => __('Wijzig video'),
'new_item' => __('Nieuwe video'),
'all_items' => __('Alle videos'),
'view_item' => __('Bekijk video'),
'search_items' => __('Zoek video'),
'not_found' => __('Er zijn geen videos gevonden'),
'not_found_in_trash' => __('Geen videos gevonden in de prullenbak')
),
'public' => true,
'can_export' => true,
'show_ui' => true,
'_builtin' => false,
'_edit_link' => 'post.php?post=%d',
'capability_type' => 'post',
//'menu_icon' => get_bloginfo('template_url').'/images/favicon.ico',
'hierarchical' => true,
'has_archive' => true,
'rewrite' => array( "slug" => "video" ), // Permalinks
'supports' => array( 'title',
'editor',
'excerpt',
'thumbnail',
'revisions'
),
'show_in_menu' => true,
'taxonomies' => array( 'videocat',
'videotag'
)
)
);
} // End custom taxonomy config
//=============== Register custom metaboxes ================
add_filter( 'cmb_meta_boxes', 'video_meta_boxes' );
function video_meta_boxes( array $meta_boxes ) {
$prefix = '';
$meta_boxes['test_metabox2'] = array(
'id' => 'test_metabox2',
'title' => __( 'Instellingen', 'cmb' ),
'pages' => array( 'video_posts', ), // Post type
'context' => 'normal',
'priority' => 'high',
'show_names' => true, // Show field names on the left
// 'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend
'fields' => array(
array(
'name' => __( 'Uitgelichte afbeelding', 'cmb' ),
'id' => $prefix . 'highlighted_image',
'type' => 'file',
),
),
);
return $meta_boxes;
}
?>
/*
This is the taxonomy build, ready for copy pasting
Do you want to add a WordPress standard thumbnail, add the post type in config.php [Rule 14]
*/
add_action( 'init', 'poppenkasten_taxonomy_options' );
function poppenkasten_taxonomy_options() {
$name = 'poppenkasten';
$post_type = 'poppenkasten_posts';
//=============== Register custom post type - VOORBEELD ================
register_post_type( $post_type, // This will be the postype!
array( 'label' => __('Poppenkasten'),
'labels' => array( 'name' => __('Poppenkasten'),
'singular_name' => __('Poppenkasten'),
'add_new' => __('Kast toevoegen'),
'add_new_item' => __('Nieuwe kast'),
'edit_item' => __('Wijzig kast'),
'new_item' => __('Nieuwe kast'),
'all_items' => __('Alle kasten'),
'view_item' => __('Bekijk kast'),
'search_items' => __('Zoek kast'),
'not_found' => __('Er zijn geen kasten gevonden'),
'not_found_in_trash' => __('Geen kasten gevonden in de prullenbak')
),
'public' => true,
'can_export' => true,
'show_ui' => true,
'_builtin' => false,
'_edit_link' => 'post.php?post=%d',
'capability_type' => 'post',
//'menu_icon' => get_bloginfo('template_url').'/images/favicon.ico',
'hierarchical' => true,
'has_archive' => true,
'rewrite' => array( "slug" => "poppenkasten" ), // Permalinks
'supports' => array( 'title',
'editor',
'excerpt',
'thumbnail',
'revisions'
),
'show_in_menu' => true,
'taxonomies' => array( 'poppenkastencat',
'poppenkastentag'
)
)
);
} // End custom taxonomy config
//=============== Register custom metaboxes ================
add_filter( 'cmb_meta_boxes', 'poppenkasten_meta_boxes' );
function poppenkasten_meta_boxes( array $meta_boxes ) {
$prefix = '';
$meta_boxes['test_metabox'] = array(
'id' => 'test_metabox',
'title' => __( 'Test Metabox', 'cmb' ),
'pages' => array( 'poppenkasten_posts2', ), // Post type
'context' => 'normal',
'priority' => 'high',
'show_names' => true, // Show field names on the left
// 'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend
'fields' => array(
array(
'name' => __( 'Test Text', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_text',
'type' => 'text',
// 'sanitization_cb' => 'my_custom_sanitization', // custom sanitization callback parameter
// 'escape_cb' => 'my_custom_escaping', // custom escaping callback parameter
// 'on_front' => false, // Optionally designate a field to wp-admin only
// 'repeatable' => true,
),
array(
'name' => __( 'Test Text Small', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_textsmall',
'type' => 'text_small',
// 'repeatable' => true,
),
array(
'name' => __( 'Test Text Medium', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_textmedium',
'type' => 'text_medium',
// 'repeatable' => true,
),
array(
'name' => __( 'Website URL', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'url',
'type' => 'text_url',
// 'protocols' => array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet'), // Array of allowed protocols
// 'repeatable' => true,
),
array(
'name' => __( 'Test Text Email', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'email',
'type' => 'text_email',
// 'repeatable' => true,
),
array(
'name' => __( 'Test Time', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_time',
'type' => 'text_time',
),
array(
'name' => __( 'Time zone', 'cmb' ),
'desc' => __( 'Time zone', 'cmb' ),
'id' => $prefix . 'timezone',
'type' => 'select_timezone',
),
array(
'name' => __( 'Test Date Picker', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_textdate',
'type' => 'text_date',
),
array(
'name' => __( 'Test Date Picker (UNIX timestamp)', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_textdate_timestamp',
'type' => 'text_date_timestamp',
// 'timezone_meta_key' => $prefix . 'timezone', // Optionally make this field honor the timezone selected in the select_timezone specified above
),
array(
'name' => __( 'Test Date/Time Picker Combo (UNIX timestamp)', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_datetime_timestamp',
'type' => 'text_datetime_timestamp',
),
// This text_datetime_timestamp_timezone field type
// is only compatible with PHP versions 5.3 or above.
// Feel free to uncomment and use if your server meets the requirement
// array(
// 'name' => __( 'Test Date/Time Picker/Time zone Combo (serialized DateTime object)', 'cmb' ),
// 'desc' => __( 'field description (optional)', 'cmb' ),
// 'id' => $prefix . 'test_datetime_timestamp_timezone',
// 'type' => 'text_datetime_timestamp_timezone',
// ),
array(
'name' => __( 'Test Money', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_textmoney',
'type' => 'text_money',
// 'before' => '£', // override '$' symbol if needed
// 'repeatable' => true,
),
array(
'name' => __( 'Test Color Picker', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_colorpicker',
'type' => 'colorpicker',
'default' => '#ffffff'
),
array(
'name' => __( 'Test Text Area', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_textarea',
'type' => 'textarea',
),
array(
'name' => __( 'Test Text Area Small', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_textareasmall',
'type' => 'textarea_small',
),
array(
'name' => __( 'Test Text Area for Code', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_textarea_code',
'type' => 'textarea_code',
),
array(
'name' => __( 'Test Title Weeeee', 'cmb' ),
'desc' => __( 'This is a title description', 'cmb' ),
'id' => $prefix . 'test_title',
'type' => 'title',
),
array(
'name' => __( 'Test Select', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_select',
'type' => 'select',
'options' => array(
'standard' => __( 'Option One', 'cmb' ),
'custom' => __( 'Option Two', 'cmb' ),
'none' => __( 'Option Three', 'cmb' ),
),
),
array(
'name' => __( 'Test Radio inline', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_radio_inline',
'type' => 'radio_inline',
'options' => array(
'standard' => __( 'Option One', 'cmb' ),
'custom' => __( 'Option Two', 'cmb' ),
'none' => __( 'Option Three', 'cmb' ),
),
),
array(
'name' => __( 'Test Radio', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_radio',
'type' => 'radio',
'options' => array(
'option1' => __( 'Option One', 'cmb' ),
'option2' => __( 'Option Two', 'cmb' ),
'option3' => __( 'Option Three', 'cmb' ),
),
),
/* array(
'name' => __( 'Test Taxonomy Radio', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'text_taxonomy_radio',
'type' => 'taxonomy_radio',
'taxonomy' => 'category', // Taxonomy Slug
// 'inline' => true, // Toggles display to inline
),
array(
'name' => __( 'Test Taxonomy Select', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'text_taxonomy_select',
'type' => 'taxonomy_select',
'taxonomy' => 'category', // Taxonomy Slug
),
array(
'name' => __( 'Test Taxonomy Multi Checkbox', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_multitaxonomy',
'type' => 'taxonomy_multicheck',
'taxonomy' => 'post_tag', // Taxonomy Slug
// 'inline' => true, // Toggles display to inline
),*/
array(
'name' => __( 'Test Checkbox', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_checkbox',
'type' => 'checkbox',
),
array(
'name' => __( 'Test Multi Checkbox', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_multicheckbox',
'type' => 'multicheck',
'options' => array(
'check1' => __( 'Check One', 'cmb' ),
'check2' => __( 'Check Two', 'cmb' ),
'check3' => __( 'Check Three', 'cmb' ),
),
// 'inline' => true, // Toggles display to inline
),
array(
'name' => __( 'Test wysiwyg', 'cmb' ),
'desc' => __( 'field description (optional)', 'cmb' ),
'id' => $prefix . 'test_wysiwyg',
'type' => 'wysiwyg',
'options' => array( 'textarea_rows' => 5, ),
),
array(
'name' => __( 'Test Image', 'cmb' ),
'desc' => __( 'Upload an image or enter a URL.', 'cmb' ),
'id' => $prefix . 'test_image',
'type' => 'file',
),
array(
'name' => __( 'Multiple Files', 'cmb' ),
'desc' => __( 'Upload or add multiple images/attachments.', 'cmb' ),
'id' => $prefix . 'test_file_list',
'type' => 'file_list',
'preview_size' => array( 100, 100 ), // Default: array( 50, 50 )
),
array(
'name' => __( 'oEmbed', 'cmb' ),
'desc' => __( 'Enter a youtube, twitter, or instagram URL. Supports services listed at http://codex.wordpress.org/Embeds.', 'cmb' ),
'id' => $prefix . 'test_embed',
'type' => 'oembed',
),
),
);
return $meta_boxes;
}
?>
/*
This is the taxonomy build, ready for copy pasting
Do you want to add a WordPress standard thumbnail, add the post type in config.php [Rule 14]
*/
add_action( 'init', 'inhuren_taxonomy_options' );
function inhuren_taxonomy_options() {
$name = 'inhuren';
$post_type = 'inhuren_posts';
//=============== Register custom post type - VOORBEELD ================
register_post_type( $post_type, // This will be the postype!
array( 'label' => __('Inhuren'),
'labels' => array( 'name' => __('Inhuren'),
'singular_name' => __('Inhuren'),
'add_new' => __('Bericht toevoegen'),
'add_new_item' => __('Nieuw bericht'),
'edit_item' => __('Wijzig bericht'),
'new_item' => __('Nieuw bericht'),
'all_items' => __('Alle berichten'),
'view_item' => __('Bekijk berichten'),
'search_items' => __('Zoek berichten'),
'not_found' => __('Er zijn geen berichten gevonden'),
'not_found_in_trash' => __('Geen berichten gevonden in de prullenbak')
),
'public' => true,
'can_export' => true,
'show_ui' => true,
'_builtin' => false,
'has_archive' => true,
'_edit_link' => 'post.php?post=%d',
'capability_type' => 'post',
//'menu_icon' => get_bloginfo('template_url').'/images/favicon.ico',
'hierarchical' => false,
'rewrite' => array( "slug" => "inhuren" ), // Permalinks
'supports' => array( 'title',
'editor',
'excerpt',
'thumbnail',
'author',
'comments',
'trackbacks',
'custom-fields',
'revisions'
),
'has_archive' => false,
'show_in_menu' => true,
'taxonomies' => array( 'inhurencat',
'inhurentag'
)
)
);
} // End custom taxonomy config
//=============== Register custom metaboxes ================
add_filter( 'cmb_meta_boxes', 'inhuren_meta_boxes' );
function inhuren_meta_boxes( array $meta_boxes ) {
$prefix = '';
$meta_boxes['test_metabox'] = array(
'id' => 'test_metabox',
'title' => __( 'Extra instellingen', 'cmb' ),
'pages' => array( 'inhuren_posts', ), // Post type
'context' => 'normal',
'priority' => 'high',
'show_names' => true, // Show field names on the left
// 'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend
'fields' => array(
array(
'name' => __( 'Doorstuur adres', 'cmb' ),
'desc' => __( 'Plaats hier het adres waar het bericht naar doorgestuurd mag worden.', 'cmb' ),
'id' => $prefix . 'redirect_url',
'type' => 'text',
// 'sanitization_cb' => 'my_custom_sanitization', // custom sanitization callback parameter
// 'escape_cb' => 'my_custom_escaping', // custom escaping callback parameter
// 'on_front' => false, // Optionally designate a field to wp-admin only
// 'repeatable' => true,
),
),
);
return $meta_boxes;
}
?>
/*
This is the taxonomy build, ready for copy pasting
Do you want to add a WordPress standard thumbnail, add the post type in config.php [Rule 14]
*/
add_action( 'init', 'advertenties_taxonomy_options' );
function advertenties_taxonomy_options() {
$name = 'advertenties';
$post_type = 'advertenties_posts';
//=============== Register custom post type - VOORBEELD ================
register_post_type( $post_type, // This will be the postype!
array( 'label' => __('Verkoopagina'),
'labels' => array( 'name' => __('Verkooppagina'),
'singular_name' => __('Verkooppagina'),
'add_new' => __('Item toevoegen'),
'add_new_item' => __('Nieuw item'),
'edit_item' => __('Wijzig item'),
'new_item' => __('Nieuw item'),
'all_items' => __('Alle items'),
'view_item' => __('Bekijk items'),
'search_items' => __('Zoek items'),
'not_found' => __('Er zijn geen items gevonden'),
'not_found_in_trash' => __('Geen items gevonden in de prullenbak')
),
'public' => true,
'can_export' => true,
'show_ui' => true,
'_builtin' => false,
'has_archive' => true,
'_edit_link' => 'post.php?post=%d',
'menu_icon' => 'dashicons-schedule',
'capability_type' => 'post',
//'menu_icon' => get_bloginfo('template_url').'/images/favicon.ico',
'hierarchical' => false,
'rewrite' => array( "slug" => "advertenties" ), // Permalinks
'supports' => array( 'title',
'editor',
'excerpt',
'thumbnail',
'author',
'comments',
'trackbacks',
'custom-fields',
'revisions'
),
'has_archive' => false,
'show_in_menu' => true,
'taxonomies' => array( 'advertentiescat',
'advertentiestag'
)
)
);
} // End custom taxonomy config
//=============== Register custom metaboxes ================
add_filter( 'cmb_meta_boxes', 'advertenties_meta_boxes' );
function advertenties_meta_boxes( array $meta_boxes ) {
$prefix = 'advertenties_';
$meta_boxes['advertenties_metabox'] = array(
'id' => 'advertenties_metabox',
'title' => __( 'Verkooppagina instellingen', 'cmb' ),
'pages' => array( 'advertenties_posts', ), // Post type
'context' => 'normal',
'priority' => 'high',
'show_names' => true, // Show field names on the left
'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend
'fields' => array(
array(
'name' => __( 'Doorstuuradres URL:', 'cmb' ),
'desc' => __( 'Plaats hier het adres waar het bericht naar doorgestuurd mag worden.', 'cmb' ),
'id' => $prefix . 'doorstuururl',
'type' => 'text'
),
array(
'name' => __( 'Doorstuuradres opschrift:', 'cmb' ),
'desc' => __( 'Plaats hier het opschrift van de doorstuuradres link, de link wordt altijd onder de hoofdtekst op de pagina in het midden getoond', 'cmb' ),
'id' => $prefix . 'doorstuuropschrift',
'type' => 'text'
),
array(
'name' => __( 'Lettergrootte in pixels voor de titel:', 'cmb' ),
'desc' => __( 'Vul een geheel getal in voor de lettergrootte', 'cmb' ),
'id' => $prefix . 'lettergrootte_titel',
'type' => 'text'
),
array(
'name' => __( 'Lettergrootte in pixels voor de inhoud tekst:', 'cmb' ),
'desc' => __( 'Vul een geheel getal in voor de lettergrootte', 'cmb' ),
'id' => $prefix . 'lettergrootte_tekst',
'type' => 'text'
),
array(
'name' => __( 'Lettergrootte H1 kop', 'cmb' ),
'desc' => __( '', 'cmb' ),
'id' => $prefix . 'lettergrootte_h1',
'type' => 'text'
),
array(
'name' => __( 'Lettergrootte H2 kop', 'cmb' ),
'desc' => __( '', 'cmb' ),
'id' => $prefix . 'lettergrootte_h2',
'type' => 'text'
),
array(
'name' => __( 'Lettergrootte H3 kop', 'cmb' ),
'desc' => __( '', 'cmb' ),
'id' => $prefix . 'lettergrootte_h3',
'type' => 'text'
),
array(
'name' => __( 'Lettergrootte H4 kop', 'cmb' ),
'desc' => __( '', 'cmb' ),
'id' => $prefix . 'lettergrootte_h4',
'type' => 'text'
),
array(
'name' => __( 'Lettergrootte H5 kop', 'cmb' ),
'desc' => __( '', 'cmb' ),
'id' => $prefix . 'lettergrootte_h5',
'type' => 'text'
),
array(
'name' => __( 'Lettergrootte H6 kop', 'cmb' ),
'desc' => __( '', 'cmb' ),
'id' => $prefix . 'lettergrootte_h6',
'type' => 'text'
),
),
);
return $meta_boxes;
}
?>