Forum Replies Created
-
AuthorPosts
-
Ulysse
ParticipantThank you.
I was using "script organizer" and it didn't work. With code snippet, it works.I have another issue with the dates format.
I want to change the format and I failed.
I added a line to check the date: echo date('l jS \of F Y',$startdate)So now, it's like that:
add_shortcode( 'datesofevent', function() { $post_id = get_the_ID(); // Get the dates $startdate = get_post_field( 'ci_event_start_date', $post_id ); $enddate = get_post_field( 'ci_event_end_date', $post_id ); echo date('l jS \of F Y',$startdate); // return return "from $startdate to $enddate"; } );But the result is the following:
Thursday 1st of January 1970
from 2021-05-24 to 2021-05-18It's like $startdate was empty but it's not as it's well displayed in the following line.
My metabox is like that:
<?php add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'Fields for Events', 'your-text-domain' ), 'id' => 'fields_for_events', 'post_types' => ['event'], 'fields' => [ [ 'name' => __( 'Organizer', 'your-text-domain' ), 'id' => $prefix . 'ci_event_organizer', 'type' => 'text', ], [ 'name' => __( 'Start date', 'your-text-domain' ), 'id' => $prefix . 'ci_event_start_date', 'type' => 'date', 'timestamp' => true, ], [ 'name' => __( 'End date', 'your-text-domain' ), 'id' => $prefix . 'ci_event_end_date', 'type' => 'date', 'timestamp' => true, ], [ 'name' => __( 'Start Time', 'your-text-domain' ), 'id' => $prefix . 'ci_event_start_time', 'type' => 'time', ], [ 'name' => __( 'End time', 'your-text-domain' ), 'id' => $prefix . 'ci_event_end_time', 'type' => 'time', ], [ 'name' => __( 'Location name', 'your-text-domain' ), 'id' => $prefix . 'ci_event_location_name', 'type' => 'text', ], [ 'name' => __( 'Location website', 'your-text-domain' ), 'id' => $prefix . 'ci_event_location_website', 'type' => 'url', ], [ 'name' => __( 'Location address', 'your-text-domain' ), 'id' => $prefix . 'ci_event_location_address', 'type' => 'text', ], [ 'name' => __( 'Location map', 'your-text-domain' ), 'id' => $prefix . 'ci_event_location_map_osm', 'type' => 'map', 'api_key' => 'AIzaSyB10BYJnnZJ1WuLERm9IsGVD2xb0mPiFsk', 'address_field' => 'ci_event_location_address', ], [ 'name' => __( 'Website to buy ticket', 'your-text-domain' ), 'id' => $prefix . 'ci_event_website_to_buy_ticket', 'type' => 'url', ], [ 'name' => __( 'Performer name', 'your-text-domain' ), 'id' => $prefix . 'ci_event_performer_name', 'type' => 'text', ], [ 'name' => __( 'Event status', 'your-text-domain' ), 'id' => $prefix . 'ci_event_status', 'type' => 'checkbox_list', 'options' => [ 'EventCancelled' => __( 'EventCancelled', 'your-text-domain' ), 'EventMovedOnline' => __( 'EventMovedOnline', 'your-text-domain' ), 'EventPostponed' => __( 'EventPostponed', 'your-text-domain' ), 'EventRescheduled' => __( 'EventRescheduled', 'your-text-domain' ), 'EventScheduled' => __( 'EventScheduled', 'your-text-domain' ), ], 'inline' => true, ], [ 'name' => __( 'Event attendance mode', 'your-text-domain' ), 'id' => $prefix . 'ci_event_attendance_mode', 'type' => 'checkbox_list', 'options' => [ 'OfflineEventAttendanceMode' => __( 'OfflineEventAttendanceMode', 'your-text-domain' ), 'OnlineAttendanceMode' => __( 'OnlineAttendanceMode', 'your-text-domain' ), 'MixedEventAttendanceMode' => __( 'MixedEventAttendanceMode', 'your-text-domain' ), ], 'inline' => true, ], [ 'name' => __( 'Gallery', 'your-text-domain' ), 'id' => $prefix . 'ci_event_gallery', 'type' => 'image', 'label_description' => __( 'Upload up to 5 images', 'your-text-domain' ), 'max_file_uploads' => 5, 'force_delete' => true, 'upload_dir' => '/home/creativinn/public_html/\\events', ], ], ]; return $meta_boxes; }Ulysse
ParticipantThank you very much Kyle. I will try again !
Ulysse
Participant- You tried this? :
[mb_frontend_dashboard edit_page="1819" post_type="speaker-profile"]
be aware there is a difference between ' '' and "
- Try to use the shortcode on a page not edited with elementor.
Ulysse
ParticipantHi. Use double quotes instead of simple quotes and it should work.
Ulysse
ParticipantHello,
It's a good news that it's possible to create listing with MB.
The issue is that AUto-listing is too much specific to Auto. I don't want anything related to auto on my website. In addtion, I bought Metabox to avoid installing a listing plugin. I don't want to install a new plugin, just to buy an addon.Why don't you create a payment module for MB? (even as a premium addon)? or explain how to implement it as a complement to your case study: https://metabox.io/create-classified-ads-website-using-meta-box/?fbclid=IwAR0FkM0wiaqc52Nfj0YFtIGwwzcX3tRSTx_pqAS1zfFnaBaEs7ILZgFap9c
I think that I'm not alone to be interested by this feature.
https://www.facebook.com/groups/metaboxusers/permalink/825868601364119
Ulysse
ParticipantHi,
Thanks for your answer but you missed my point.
My point is that thanks to metabox, we can create custom listing website where the users can publish their listing.
It's great.
Now, what is missing is a way to make them pay to post their listing.You suggested a plugin which creates listing. What's the point of using metabox then?
Coming back to metabox, is there a way to add a payment module to the form we create? So the user can pay when he/she submits the post?
Ulysse
ParticipantHi,
thank you for your answer.
I'll be more clear with my request.
I followed your tuto to create of listing/ads website where the users can post and edit their listing/ads.
Now, I would like to charge them, either for each post, or with packages, or with memberships.There are membserhsips plugins which can do that, but they're not integrated with you (for example, WP-front-user-pro), so I cannot use them to charge the user for posting custom posts the plugin does not see.
Do you know if with woocomerce, I could charge the user to publish/edit posts?
Thank you.
Ulysse
ParticipantOK. Understood. It works when I add the parameter "location".
I only use the builder to create my metabox. You should add an asterix to tell the parameter "column position" is mandatory.April 16, 2021 at 2:29 AM in reply to: ✅How to Autofill the Title of the cutstom post with the value of the 2 fields #27297Ulysse
ParticipantI found it by looking at the code!
in the snippet, I put last_name as variable instead of last_name_agent, the same with first_name.It works! Thank you for your support!
Ulysse
ParticipantHere is the php code of the custom post:
<?php add_action( 'init', 'your_prefix_register_post_type' ); function your_prefix_register_post_type() { $labels = [ 'name' => esc_html__( 'Agents', 'your-textdomain' ), 'singular_name' => esc_html__( 'Agent', 'your-textdomain' ), 'add_new' => esc_html__( 'Add New', 'your-textdomain' ), 'add_new_item' => esc_html__( 'Add new agent', 'your-textdomain' ), 'edit_item' => esc_html__( 'Edit Agent', 'your-textdomain' ), 'new_item' => esc_html__( 'New Agent', 'your-textdomain' ), 'view_item' => esc_html__( 'View Agent', 'your-textdomain' ), 'view_items' => esc_html__( 'View Agents', 'your-textdomain' ), 'search_items' => esc_html__( 'Search Agents', 'your-textdomain' ), 'not_found' => esc_html__( 'No agents found', 'your-textdomain' ), 'not_found_in_trash' => esc_html__( 'No agents found in Trash', 'your-textdomain' ), 'parent_item_colon' => esc_html__( 'Parent Agent:', 'your-textdomain' ), 'all_items' => esc_html__( 'All Agents', 'your-textdomain' ), 'archives' => esc_html__( 'Agent Archives', 'your-textdomain' ), 'attributes' => esc_html__( 'Agent Attributes', 'your-textdomain' ), 'insert_into_item' => esc_html__( 'Insert into agent', 'your-textdomain' ), 'uploaded_to_this_item' => esc_html__( 'Uploaded to this agent', 'your-textdomain' ), 'featured_image' => esc_html__( 'Featured image', 'your-textdomain' ), 'set_featured_image' => esc_html__( 'Set featured image', 'your-textdomain' ), 'remove_featured_image' => esc_html__( 'Remove featured image', 'your-textdomain' ), 'use_featured_image' => esc_html__( 'Use as featured image', 'your-textdomain' ), 'menu_name' => esc_html__( 'Agents', 'your-textdomain' ), 'filter_items_list' => esc_html__( 'Filter agents list', 'your-textdomain' ), 'items_list_navigation' => esc_html__( 'Agents list navigation', 'your-textdomain' ), 'items_list' => esc_html__( 'Agents list', 'your-textdomain' ), 'item_published' => esc_html__( 'Agent published', 'your-textdomain' ), 'item_published_privately' => esc_html__( 'Agent published privately', 'your-textdomain' ), 'item_reverted_to_draft' => esc_html__( 'Agent reverted to draft', 'your-textdomain' ), 'item_scheduled' => esc_html__( 'Agent scheduled', 'your-textdomain' ), 'item_updated' => esc_html__( 'Agent updated', 'your-textdomain' ), 'text_domain' => esc_html__( 'your-textdomain', 'your-textdomain' ), ]; $args = [ 'label' => esc_html__( 'Agents', 'your-textdomain' ), 'labels' => $labels, 'description' => '', 'public' => true, 'hierarchical' => false, 'exclude_from_search' => false, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'show_in_rest' => true, 'menu_position' => 20, 'query_var' => true, 'can_export' => true, 'delete_with_user' => true, 'has_archive' => true, 'rest_base' => '', 'show_in_menu' => true, 'menu_icon' => 'dashicons-admin-generic', 'capability_type' => 'post', 'supports' => ['title', 'editor', 'thumbnail', 'custom-fields', 'revisions', 'author', 'post-formats', 'excerpt', 'trackbacks', 'comments'], 'taxonomies' => ['country-of-operation', 'location-of-agent', 'languages'], 'rewrite' => [ 'with_front' => false, ], ]; register_post_type( 'agent', $args ); }Ulysse
ParticipantHere is the php code of my metabox:
<?php add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'Fields for agent', 'your-text-domain' ), 'id' => 'fields-for-agent', 'post_types' => ['agent'], 'tab_style' => 'box', 'tab_default_active' => 'identity', 'geo' => [ 'api_key' => 'AIzaSyDdkC7vnU_nm-feorsOVR6FUWG_MCW3zzg', ], 'tabs' => [ 'identity' => [ 'label' => 'Identity', 'icon' => 'admin-users', ], 'location_and_languages' => [ 'label' => 'Location and Languages', 'icon' => 'admin-site', ], 'your_offer' => [ 'label' => 'Your offer', 'icon' => 'welcome-edit-page', ], ], 'fields' => [ [ 'name' => __( 'First name', 'your-text-domain' ), 'id' => $prefix . 'first_name_agent', 'type' => 'text', 'admin_columns' => [ 'position' => 'after', 'sort' => true, 'searchable' => true, 'filterable' => true, ], 'columns' => 6, 'visible' => [ 'when' => [['', '=', '']], 'relation' => 'or', ], 'tab' => 'identity', ], [ 'name' => __( 'Last name', 'your-text-domain' ), 'id' => $prefix . 'last_name_agent', 'type' => 'text', 'columns' => 6, 'tab' => 'identity', ], [ 'name' => __( 'Photo', 'your-text-domain' ), 'id' => $prefix . '_thumbnail_id', 'type' => 'image', 'label_description' => __( 'Photo which best promotes you', 'your-text-domain' ), 'max_file_uploads' => 1, 'admin_columns' => [ 'position' => 'before post_title', 'searchable' => true, ], 'tab' => 'identity', ], [ 'name' => __( 'Company', 'your-text-domain' ), 'id' => $prefix . 'company_agent', 'type' => 'text', 'columns' => 6, 'tab' => 'identity', ], [ 'name' => __( 'Website', 'your-text-domain' ), 'id' => $prefix . 'website_agent', 'type' => 'url', 'columns' => 6, 'tab' => 'identity', ], [ 'name' => __( 'Email', 'your-text-domain' ), 'id' => $prefix . 'email_agent', 'type' => 'email', 'columns' => 6, 'tab' => 'identity', ], [ 'name' => __( 'Tel', 'your-text-domain' ), 'id' => $prefix . 'tel_agent', 'type' => 'tel', 'columns' => 6, 'tab' => 'identity', ], [ 'name' => __( 'Address', 'your-text-domain' ), 'id' => $prefix . 'address_agent', 'type' => 'text', 'tab' => 'location_and_languages', ], [ 'name' => __( 'Country', 'your-text-domain' ), 'id' => $prefix . 'country_agent', 'type' => 'text', 'binding' => 'country', 'address_field' => 'address_agent', 'tab' => 'location_and_languages', ], [ 'name' => __( 'Map', 'your-text-domain' ), 'id' => $prefix . 'map_gm_agent', 'type' => 'map', 'api_key' => 'AIzaSyDdkC7vnU_nm-feorsOVR6FUWG_MCW3zzg', 'address_field' => 'address_agent', 'tab' => 'location_and_languages', ], [ 'name' => __( 'Language(s)', 'your-text-domain' ), 'id' => $prefix . 'languages', 'type' => 'taxonomy', 'taxonomy' => ['languages'], 'field_type' => 'select_advanced', 'add_new' => true, 'tab' => 'location_and_languages', ], [ 'name' => __( 'Countries of Operation', 'your-text-domain' ), 'id' => $prefix . 'countries_of_operation', 'type' => 'taxonomy', 'taxonomy' => ['country-of-operation'], 'field_type' => 'select_advanced', 'multiple' => true, 'add_new' => true, 'tab' => 'location_and_languages', ], [ 'name' => __( 'Background', 'your-text-domain' ), 'id' => $prefix . 'background_agent', 'type' => 'textarea', 'rows' => 10, 'tab' => 'your_offer', ], [ 'name' => __( 'Services', 'your-text-domain' ), 'id' => $prefix . 'services_agent', 'type' => 'textarea', 'rows' => 10, 'tab' => 'your_offer', ], [ 'name' => __( 'References', 'your-text-domain' ), 'id' => $prefix . 'references', 'type' => 'textarea', 'rows' => 10, 'tab' => 'your_offer', ], [ 'name' => __( 'Video Presentation', 'your-text-domain' ), 'id' => $prefix . 'video_presentation_agent', 'type' => 'url', 'std' => 'https://www.youtube.com/watch?v=ZRngEOnHnoc', 'tab' => 'your_offer', ], ], ]; return $meta_boxes;April 16, 2021 at 2:21 AM in reply to: ✅How to Autofill the Title of the cutstom post with the value of the 2 fields #27293Ulysse
ParticipantHere is a screenshot of my snippet: https://prnt.sc/11gopgk
April 16, 2021 at 2:16 AM in reply to: ✅How to Autofill the Title of the cutstom post with the value of the 2 fields #27292Ulysse
ParticipantWhen the snippet is activated:
- WHen I save a post, the title becomes empty (no title) and the slug url (post_name) becomes "_"
- So it means that the snippet does something. And because the post_name only becomes "_", it means that $t1 and $t2 are empty.
But I don't know why.
April 16, 2021 at 2:12 AM in reply to: ✅How to Autofill the Title of the cutstom post with the value of the 2 fields #27291Ulysse
ParticipantHere is the custom post:
<?php add_action( 'init', 'your_prefix_register_post_type' ); function your_prefix_register_post_type() { $labels = [ 'name' => esc_html__( 'Agents', 'your-textdomain' ), 'singular_name' => esc_html__( 'Agent', 'your-textdomain' ), 'add_new' => esc_html__( 'Add New', 'your-textdomain' ), 'add_new_item' => esc_html__( 'Add new agent', 'your-textdomain' ), 'edit_item' => esc_html__( 'Edit Agent', 'your-textdomain' ), 'new_item' => esc_html__( 'New Agent', 'your-textdomain' ), 'view_item' => esc_html__( 'View Agent', 'your-textdomain' ), 'view_items' => esc_html__( 'View Agents', 'your-textdomain' ), 'search_items' => esc_html__( 'Search Agents', 'your-textdomain' ), 'not_found' => esc_html__( 'No agents found', 'your-textdomain' ), 'not_found_in_trash' => esc_html__( 'No agents found in Trash', 'your-textdomain' ), 'parent_item_colon' => esc_html__( 'Parent Agent:', 'your-textdomain' ), 'all_items' => esc_html__( 'All Agents', 'your-textdomain' ), 'archives' => esc_html__( 'Agent Archives', 'your-textdomain' ), 'attributes' => esc_html__( 'Agent Attributes', 'your-textdomain' ), 'insert_into_item' => esc_html__( 'Insert into agent', 'your-textdomain' ), 'uploaded_to_this_item' => esc_html__( 'Uploaded to this agent', 'your-textdomain' ), 'featured_image' => esc_html__( 'Featured image', 'your-textdomain' ), 'set_featured_image' => esc_html__( 'Set featured image', 'your-textdomain' ), 'remove_featured_image' => esc_html__( 'Remove featured image', 'your-textdomain' ), 'use_featured_image' => esc_html__( 'Use as featured image', 'your-textdomain' ), 'menu_name' => esc_html__( 'Agents', 'your-textdomain' ), 'filter_items_list' => esc_html__( 'Filter agents list', 'your-textdomain' ), 'items_list_navigation' => esc_html__( 'Agents list navigation', 'your-textdomain' ), 'items_list' => esc_html__( 'Agents list', 'your-textdomain' ), 'item_published' => esc_html__( 'Agent published', 'your-textdomain' ), 'item_published_privately' => esc_html__( 'Agent published privately', 'your-textdomain' ), 'item_reverted_to_draft' => esc_html__( 'Agent reverted to draft', 'your-textdomain' ), 'item_scheduled' => esc_html__( 'Agent scheduled', 'your-textdomain' ), 'item_updated' => esc_html__( 'Agent updated', 'your-textdomain' ), 'text_domain' => esc_html__( 'your-textdomain', 'your-textdomain' ), ]; $args = [ 'label' => esc_html__( 'Agents', 'your-textdomain' ), 'labels' => $labels, 'description' => '', 'public' => true, 'hierarchical' => false, 'exclude_from_search' => false, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'show_in_rest' => true, 'menu_position' => 20, 'query_var' => true, 'can_export' => true, 'delete_with_user' => true, 'has_archive' => true, 'rest_base' => '', 'show_in_menu' => true, 'menu_icon' => 'dashicons-admin-generic', 'capability_type' => 'post', 'supports' => ['title', 'editor', 'thumbnail', 'custom-fields', 'revisions', 'author', 'post-formats', 'excerpt', 'trackbacks', 'comments'], 'taxonomies' => ['country-of-operation', 'location-of-agent', 'languages'], 'rewrite' => [ 'with_front' => false, ], ]; register_post_type( 'agent', $args ); }April 16, 2021 at 2:11 AM in reply to: ✅How to Autofill the Title of the cutstom post with the value of the 2 fields #27290Ulysse
ParticipantThank you.
Here are the custom fields:
<?php add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'Fields for agent', 'your-text-domain' ), 'id' => 'fields-for-agent', 'post_types' => ['agent'], 'tab_style' => 'box', 'tab_default_active' => 'identity', 'geo' => [ 'api_key' => 'AIzaSyDdkC7vnU_nm-feorsOVR6FUWG_MCW3zzg', ], 'tabs' => [ 'identity' => [ 'label' => 'Identity', 'icon' => 'admin-users', ], 'location_and_languages' => [ 'label' => 'Location and Languages', 'icon' => 'admin-site', ], 'your_offer' => [ 'label' => 'Your offer', 'icon' => 'welcome-edit-page', ], ], 'fields' => [ [ 'name' => __( 'First name', 'your-text-domain' ), 'id' => $prefix . 'first_name_agent', 'type' => 'text', 'admin_columns' => [ 'position' => 'after', 'sort' => true, 'searchable' => true, 'filterable' => true, ], 'columns' => 6, 'visible' => [ 'when' => [['', '=', '']], 'relation' => 'or', ], 'tab' => 'identity', ], [ 'name' => __( 'Last name', 'your-text-domain' ), 'id' => $prefix . 'last_name_agent', 'type' => 'text', 'columns' => 6, 'tab' => 'identity', ], [ 'name' => __( 'Photo', 'your-text-domain' ), 'id' => $prefix . '_thumbnail_id', 'type' => 'image', 'label_description' => __( 'Photo which best promotes you', 'your-text-domain' ), 'max_file_uploads' => 1, 'admin_columns' => [ 'position' => 'before post_title', 'searchable' => true, ], 'tab' => 'identity', ], [ 'name' => __( 'Company', 'your-text-domain' ), 'id' => $prefix . 'company_agent', 'type' => 'text', 'columns' => 6, 'tab' => 'identity', ], [ 'name' => __( 'Website', 'your-text-domain' ), 'id' => $prefix . 'website_agent', 'type' => 'url', 'columns' => 6, 'tab' => 'identity', ], [ 'name' => __( 'Email', 'your-text-domain' ), 'id' => $prefix . 'email_agent', 'type' => 'email', 'columns' => 6, 'tab' => 'identity', ], [ 'name' => __( 'Tel', 'your-text-domain' ), 'id' => $prefix . 'tel_agent', 'type' => 'tel', 'columns' => 6, 'tab' => 'identity', ], [ 'name' => __( 'Address', 'your-text-domain' ), 'id' => $prefix . 'address_agent', 'type' => 'text', 'tab' => 'location_and_languages', ], [ 'name' => __( 'Country', 'your-text-domain' ), 'id' => $prefix . 'country_agent', 'type' => 'text', 'binding' => 'country', 'address_field' => 'address_agent', 'tab' => 'location_and_languages', ], [ 'name' => __( 'Map', 'your-text-domain' ), 'id' => $prefix . 'map_gm_agent', 'type' => 'map', 'api_key' => 'AIzaSyDdkC7vnU_nm-feorsOVR6FUWG_MCW3zzg', 'address_field' => 'address_agent', 'tab' => 'location_and_languages', ], [ 'name' => __( 'Language(s)', 'your-text-domain' ), 'id' => $prefix . 'languages', 'type' => 'taxonomy', 'taxonomy' => ['languages'], 'field_type' => 'select_advanced', 'add_new' => true, 'tab' => 'location_and_languages', ], [ 'name' => __( 'Countries of Operation', 'your-text-domain' ), 'id' => $prefix . 'countries_of_operation', 'type' => 'taxonomy', 'taxonomy' => ['country-of-operation'], 'field_type' => 'select_advanced', 'multiple' => true, 'add_new' => true, 'tab' => 'location_and_languages', ], [ 'name' => __( 'Background', 'your-text-domain' ), 'id' => $prefix . 'background_agent', 'type' => 'textarea', 'rows' => 10, 'tab' => 'your_offer', ], [ 'name' => __( 'Services', 'your-text-domain' ), 'id' => $prefix . 'services_agent', 'type' => 'textarea', 'rows' => 10, 'tab' => 'your_offer', ], [ 'name' => __( 'References', 'your-text-domain' ), 'id' => $prefix . 'references', 'type' => 'textarea', 'rows' => 10, 'tab' => 'your_offer', ], [ 'name' => __( 'Video Presentation', 'your-text-domain' ), 'id' => $prefix . 'video_presentation_agent', 'type' => 'url', 'std' => 'https://www.youtube.com/watch?v=ZRngEOnHnoc', 'tab' => 'your_offer', ], ], ]; return $meta_boxes; } - You tried this? :
-
AuthorPosts