Description
Register custom post type "oik_testimonials"The description is the content field – the testimonial The title should contain the testimonial's author name _oik_testimonial_name should also be the Author name
Usage
oik_register_oik_testimonials();Parameters
Returns
voidSource
File name: oik-testimonials/oik-testimonials.phpLines:
1 to 14 of 14
function oik_register_oik_testimonials() { $post_type = 'oik_testimonials'; $post_type_args = array(); $post_type_args['label'] = __( 'Testimonials', "oik-testimonials" ); $post_type_args['description'] = __( 'Testimonials', "oik-testimonials" ); $post_type_args['taxonomies'] = array( "testimonial_type" ); $post_type_args['has_archive'] = true; $post_type_args['show_in_rest'] = true; bw_register_post_type( $post_type, $post_type_args ); bw_register_field( "_oik_testimonials_name", "text", __( "Author name", "oik-testimonials" ), array( "#required" => true ) ); bw_register_field_for_object_type( "_oik_testimonials_name", $post_type ); add_filter( "manage_edit-${post_type}_columns", "oik_testimonials_columns", 10, 2 ); add_action( "manage_${post_type}_posts_custom_column", "bw_custom_column_admin", 10, 2 ); }View on GitHub
Called by
1 to 1 of 1
