Found the code that I think I needed to duplicate and change… But when I did I got fatal errors back on the lines that I had changed…
All the places that say “location-services” used to just say “services” and I appended the “location-” on to it… … Here is the code that I have… Any help would be huge… Thanks so much ??
add_action('init', location-services_custom_init');
/*-- Custom Post Init Begin --*/
function location-services_custom_init()
{
$labels = array(
'name' => _x('Items', 'post type general name', 'playne'),
'singular_name' => _x('Item', 'post type singular name', 'playne'),
'add_new' => _x('Add New', 'member', 'playne'),
'add_new_item' => __('Add New Item', 'playne'),
'edit_item' => __('Edit Item', 'playne'),
'new_item' => __('New Item', 'playne'),
'view_item' => __('View Item', 'playne'),
'search_items' => __('Search Items', 'playne'),
'not_found' => __('No Items found', 'playne'),
'not_found_in_trash' => __('No Items found in Trash', 'playne'),
'parent_item_colon' => '',
'menu_name' => 'Location Services'
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => true,
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','editor', 'thumbnail', 'custom-fields')
);
// The following is the main step where we register the post.
register_post_type('location-services',$args);
}
add_filter('post_updated_messages', 'services_updated_messages');
function services_updated_messages( $messages ) {
global $post, $post_ID;
$messages['services'] = array(
0 => '', // Unused. Messages start at index 1.
1 => sprintf( __('Service updated. <a href="%s">View service</a>'), esc_url( get_permalink($post_ID) ) ),
2 => __('Custom field updated.', 'playne'),
3 => __('Custom field deleted.', 'playne'),
4 => __('Service updated.', 'playne'),
/* translators: %s: date and time of the revision */
5 => isset($_GET['revision']) ? sprintf( __('Service restored to revision from %s', 'playne'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
6 => sprintf( __('Service published. <a href="%s">View item</a>'), esc_url( get_permalink($post_ID) ) ),
7 => __('Item saved.', 'playne'),
8 => sprintf( __('Service submitted. <a target="_blank" href="%s">Preview service</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),
9 => sprintf( __('Service scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview service</a>'),
// translators: Publish box date format, see https://php.net/date
date_i18n( __( 'M j, Y @ G:i', 'playne' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ) ),
10 => sprintf( __('Service draft updated. <a target="_blank" href="%s">Preview service</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),
);
return $messages;
}