Forum Replies Created
-
AuthorPosts
-
Graham Stanbury
ParticipantOkay, many thanks for your help Peter
Graham Stanbury
ParticipantApologies, I should have added the code...
function obr_custom_post_type_job() { $labels = array( 'name' => _x( 'Jobs', 'Post Type General Name', 'awaw' ), 'singular_name' => _x( 'Job', 'Post Type Singular Name', 'awaw' ), 'menu_name' => __( 'Jobs', 'awaw' ), 'name_admin_bar' => __( 'Job', 'awaw' ), 'parent_item_colon' => __( 'Parent Job:', 'awaw' ), 'all_items' => __( 'All Jobs', 'awaw' ), 'add_new_item' => __( 'Add New Job', 'awaw' ), 'add_new' => __( 'Add New', 'awaw' ), 'new_item' => __( 'New Job', 'awaw' ), 'edit_item' => __( 'Edit Job', 'awaw' ), 'update_item' => __( 'Update Job', 'awaw' ), 'view_item' => __( 'View Jobs', 'awaw' ), 'search_items' => __( 'Search Jobs', 'awaw' ), 'not_found' => __( 'Not found', 'awaw' ), 'not_found_in_trash' => __( 'Not found in Trash', 'awaw' ), ); $args = array( 'label' => __( 'Job', 'awaw' ), 'description' => __( 'Post Type Description', 'awaw' ), 'labels' => $labels, 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt' ), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 5, 'show_in_admin_bar' => true, 'menu_icon' => 'dashicons-list-view', 'show_in_nav_menus' => true, 'can_export' => true, 'has_archive' => 'jobs', //was true //'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'page', 'rewrite' => array( 'slug' => 'job', ), ); register_post_type( 'job', $args ); flush_rewrite_rules(); }Graham Stanbury
ParticipantThank you Peter
That's great for the specific fields.
Do I need to do something similar for the title, description, excerpt, etc, please? I can't see that in the documentation unfortunately.
Many thanks
MikeGraham Stanbury
ParticipantHi Peter
This is Mike, Graham's WP developer. Many thanks for your reply.
I can't export the field group unfortunately as the fields were created as part of a functionality plugin.
However, I can give you the code from the plugin:- the specific method which is called in that plugin, and which contains the fields from the screenshots, is in this pastebin -> https://pastebin.com/UGJQErsZ
- the method is called using
add_filter( 'rwmb_meta_boxes', array( $this, 'obr_register_meta_boxes' ) );in the__construct()
We have the translation domain "awaw" on some of the field definitions but not all of them. This was all working on Meta Box AIO v2.1.1 but if I need to update it for newer versions, do please let me know.
Many thanks for your assistance
MikeGraham Stanbury
ParticipantThank you Peter
v2.2.0 didn't work unfortunately, so I have submitted the requested details via your contact form.
Many thanks for your assistance.
Graham Stanbury
ParticipantThank you for your help Long
Graham Stanbury
ParticipantHi Long
Thank you for your reply.
That's a shame as I have the user experience working as I want it. Is there no hook that I can use at the point of saving?
Alternatively, would it be possible to have all the available options in the list of cities (i.e. all cities for all countries) and then hide some of them using jQuery depending on the country in the other select_advanced?
Or would it be better to have a separate select_advanced for each country, prepopulated with only the city options for that country and then hide it using conditional logic? This feels like it will work, but seems like a lot more work.
Many thanks for your assistance.
-
AuthorPosts