Hi,
Using this great plugin which is part of a theme – ViewTube – a little like YouTube in terms of video streaming.
I’m streaming video content from a third-party platform and it works very well
However, I wish to add three URL video fields, each containing the same video URL.
Should one URL source stop streaming from one third-party source such as Google Drive, one of the remaining two URLs would automatically take over.
Your plugin is being used to create a Video Metabox containing a video URL and and Ad Box to play an Ad.
I would like to add three video URL fields as opposed to just one for the purposes described earlier as ‘video URL fallbacks’.
Did that make any sense?
Thanks reading ??
Is this plugin suitable to add a dynamic availability_date for WooCommerce products in a google product feed (I use RexTheme Product Feed Manager) that are available on backorder?
I want the availability_date to be “today +3 weeks”, on a rolling window basis. See https://support.google.com/merchants/answer/6324470?hl=en
If that is possible, any example on how to do it?
?recently upgraded my PHP version to 8.3 and I have the?latest version of WordPress 6.6. Looks like plugin is not compatible with the latest versions. I am getting Fetal Error while editing page~
Uncaught Error: date() expects at most 2 arguments, 3 given
wp-content/plugins/cmb2/includes/CMB2_Base.php:315
Looks like it is not compatible with latest php version.
]]>I am getting this error and I’m unsure how to resolve it. I can’t edit the header or footer of my website using CMB2
0 /home2/ku9fyuz6/mysupercoolwebsite.com/wp-content/plugins/cmb2/includes/CMB2_Base.php(315): date(Array, Object(CMB2_Field), NULL) 1 /home2/ku9fyuz6/mysupercoolwebsite.com/wp-content/plugins/cmb2/includes/CMB2_Base.php(273): CMB2_Base->do_callback(‘date’) 2 /home2/ku9fyuz6/mysupercoolwebsite.com/wp-content/plugins/cmb2/includes/CMB2_Field.php(1345): CMB2_Base->get_param_callback_result(‘default_cb’) 3 /home2/ku9fyuz6/mysupercoolwebsite.com/wp-content/plugins/cmb2/includes/CMB2_Field.php(1298): CMB2_Field->get_default() 4 /home2/ku9fyuz6/mysupercoolwebsite.com/wp-content/plugins/cmb2/includes/CMB2_JS.php(69): CMB2_Field->js_data() 5 /home2/ku9fyuz6/mysupercoolwebsite.com/wp-content/plugins/cmb2/includes/CMB2_Field.php(1279): CMB2_JS::add_field_data(Object(CMB2_Field)) 6 /home2/ku9fyuz6/mysupercoolwebsite.com/wp-content/plugins/cmb2/includes/types/CMB2_Type_Base.php(65): CMB2_Field->register_js_data() 7 /home2/ku9fyuz6/mysupercoolwebsite.com/wp-content/plugins/cmb2/includes/types/CMB2_Type_Select.php(26): CMB2_Type_Base->rendered(‘
]]>Hey, love the plugin and been using it forever to make my life easier. I usually only need it for text fields or checkboxes, but with some recent development I need to use the select drop down box.
I realised after a lot of troublehooting, that values of the select (or radio) elements are not being saved to the database, making them return blank when called in the loop. They do not show up when trying to var_dump
in the loop, unlike all the other custom fields from CMB2 that show up just fine. Only when I manually update the select field using update_post_meta
, it updates the value and shows up.
This is my setup in functions.php:
add_action( 'cmb2_admin_init', 'cmb2_retreats_metaboxes' );
function cmb2_retreats_metaboxes() {
$prefix = '_retreats_';
$cmb_retreat = new_cmb2_box( array(
'id' => 'lesson_meta_retreat-info',
'title' => __( 'xxxxx', 'cmb2' ),
'object_types' => array( 'retreats', ), // Post type
'context' => 'normal',
'priority' => 'high',
'show_names' => true, // Show field names on the left
) );
$cmb_retreat->add_field( array(
'name' => 'Teaser Frame',
'desc' => 'xxxxxx',
'id' => $prefix . 'arch-type',
'type' => 'select',
'show_option_none' => false,
'default' => 'arch1',
'options' => array(
'arch1' => 'one',
'arch2' => 'two',
'arch3' => 'three',
'arch4' => 'four',
'arch5' => 'five',
'arch6' => 'six',
),
) );
}
This is a basic setup in the loop im using right now for testing:
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post();
$arch_type = get_post_meta( get_the_ID(), '_retreats_arch-type', true );
if ( 'arch1' === $arch_type ) {
echo 'it works';
} else {
// some other PHP code
}
<?php endwhile; ?>
<?php else : ?>
<article class="nothing"></article>
<?php endif; ?>
Can someone help me out figuring out what might be going wrong? Oh I already disabled all plugins to check for any interference.
Greetings!
]]>Hi,
This plugin is being used as part of a Theme called ViewTube which, without it, the theme does not work.
Are there plans to update date, please?
Many Thanks
]]>It seems that CMB is not compatible with latest version of WordPress and PHP 8.2.
]]>I appreciate the answer to the previous question: is this plugin still supported? Thrilled that the plugin continues to be supported.
The issue is where it says it was last updated 2 years ago. That will cause alarm to many potential users (and clients). Is there a way to update that?
Thank you very much!
]]>I need to create field that accept HTML code. And I need to make this field required
.
How to achieve that? Regular way with 'attributes' => ['required']
seems not work since it makes hidden textarea
required only. And this completely blocks the ability to create new posts because the user cannot fill the hidden textarea.
I love this plugin, but I read this message in the plugin repository:
This plugin hasn��t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Can I continue to use it without problems?
]]>I’m new to CMB2 and I’m trying to include a couple of CMB-fields on a custom pane of the WooCommerce product metabox.
I’ve successfully adapted the “display on front-end” approach described here – https://webdevstudios.com/2015/03/30/use-cmb2-to-create-a-new-post-submission-form/ – to show the CMB-fields within the product pane. I’m adapting parts of the form submission function explained in the post and the respective snippet and I’m using the hook ‘woocommerce_process_product_meta’ to save the meta values from the CMB-fields. I’m also using the helper function I found here – https://github.com/CMB2/CMB2-Snippet-Library/blob/master/helper-functions/modify-cmb2_metabox_form-output.php – to remove the default submit button from the form so only the default post update button will submit the post.
While this works I can’t help but wonder if I’m not missing a simpler, more standard way to display and submit a CMB2 field group in/from a different, non-cmb2 metabox if all fields are displayed on the same admin screen and will be submitted in the same $_POST?
Thanks for a brief tip (if there is one). Thanks for the great plugin!
I used below code for upload file from front end but when I update the form it disappear and not shown on the screen where I am displaying it. Can you help me? I would be very thankful for your valuable time.
“array(
‘name’ => __(‘Upload Files’, ‘wp-job-board-pro’),
‘id’ => $prefix . ‘upload_files’,
‘type’ => ‘file’,
‘options’ => array(
‘add_upload_file_text’ => __(‘Add or upload files’, ‘wp-job-board-pro’),
‘file_list’ => true, // Enable multiple file uploads
‘query_args’ => array(
‘type’ => array(‘image/jpeg’, ‘image/png’, ‘application/pdf’, ‘application/msword’, ‘application/vnd.openxmlformats-officedocument.wordprocessingml.document’), // Specify allowed file types
‘size’ => 5242880, // Set maximum file size (5 MB in bytes)
‘preview_size’ => ‘thumbnail’,
),
),
)”
Sorry to bother again. This is possibly related to my recent support thread about HPOS, in another bit of code I am using file_list
field type. It displays and works fine but does not appear to save the values.
I am using CMB2 develop (downloaded yesterday, 13 Sept) and the CMB2 WooCommerce HPOS Orders add-on.
Screenshot before saving, showing 2 image files (from media library) selected. And the tracking number field below has been updated.
Screenshot after save – no images, but tracking number change saved.
Blog post about the code: https://www.damiencarbery.com/2021/05/attach-files-to-woocommerce-order-email/
Any thoughts?
]]>Hello,
I have a custom plugin to insert products on my website. In it I enter versions of my products and when I create a new version, when entering the product ids it autocompletes automatically with awesomplete. A few days ago I updated cmb2 and the autocomplete stopped working. Does anyone have the same error and could tell me how to fix it, please? Thank you so much
]]>Hello guys,
I have a question according to the REST API for updating a cmb2 field value.
This is the code for the registration of he field and the box:
$cmb = new_cmb2_box(
array(
'id' => 'hd-object-viewer-mb',
'title' => __( '3D View Scene', 'hd-3d-viewer' ),
'object_types' => array( 'hd-object-viewer' ),
'context' => 'normal',
'priority' => 'high',
'show_names' => true,
'show_in_rest' => true
)
);
$cmb->add_field(
array(
'name' => 'Test Text Area',
'desc' => 'This is the json data',
'id' => 'hd-object-viewer-mb-scene-json',
'type' => 'textarea',
'sanitization_cb' => false,
'escape_cb' => false,
)
);
I registerd my CPT like this:
register_post_type(
'hd-object-viewer',
array(
'label' => __( '3D View', 'hd-3d-viewer' ),
'description' => 'Recipe custom post type.',
'public' => true,
'exclude_from_search' => true,
'show_in_rest' => true,
'supports' => array( 'title' ),
'menu_icon' => 'dashicons-admin-site',
)
);
I now want to update the field via the REST API. When i make a GET Request to /wp-json/cmb2/v1/boxes/hd-object-viewer-mb/fields/hd-object-viewer-mb-scene-json i get the field back (so the field is registered in the API)
But when i do a POST request to the same URL i get an error:
{
"code": "cmb2_rest_no_field_by_id_error",
"message": "No field found by that id.",
"data": {
"status": 403
}
}
My POST body is:
{
"object_id": 49,
"value": "other value test",
"object_type": "post"
}
I also tried it with the “hd-object-viewer
” (CPT) object_type which results in the same error.
What is the object_id anyways. I considered it as the post id, maybe this is not correct.
For Authentication i used a Application password with my admin User, so i am pretty sure i am authenticated at it would say otherwise. Maybe i don’t have the permission to change the metafield, which would be weird as this is the application password for the admin user.
Any help would be appreciated.
Thanks in Advance.
]]>My site has WooCommerce with HPOS enabled so the metabox object_type is ‘woocommerce_page_wc-order
‘ (with url admin.php). In non-HPOS it would be shop_order
and the url would include post.php
.
The metabox shows but the ‘cmb2_override_meta_value
‘ filter is not run. I am going to use this to retrieve the data from another table.
Similarly ‘cmb2_override_meta_save
‘ does not appear to run when the WooCommerce order is saved.
I am testing one of my plugins on a WooCommerce installation with HPOS enabled. This means that orders are no longer stored in wp_posts/postmeta
but in wp_wc_orders/wp_wc_orders_meta
.
My code, which works on normal WooCommerce, adds the metabox for order_types
of shop_order
. It is from my post: https://www.damiencarbery.com/2020/01/add-tracking-info-to-woocommerce-order/
'object_types' => array( 'shop_order', )
This object type doesn’t work now. Query Monitor does report that the post_type=shop_order in its Admin Screen tab/get_current_screen() section.
I did try adding ‘wc-orders
‘ to object_types but no change.
The order edit page url is like:
/wp-admin/admin.php?page=wc-orders&action=edit&id=47
Do you have any suggestions?
]]>I updated to WordPress and can no longer update my pages. I got the following error. How do I fix it?
WordPress version 6.2.2
Active theme: aala (version 1.0.0)
Current plugin: (version )
PHP version 7.4.30
]]>An error of type E_ERROR was caused in line 100 of the file /home/lorbus/aala.us/wp-content/themes/gorirra-aala/inc/aala-theme-options.php. Error message: Uncaught Error: Call to undefined function cmb2_metabox_form() in /home/lorbus/aala.us/wp-content/themes/gorirra-aala/inc/aala-theme-options.php:100
Stack trace:
#0 /home/lorbus/aala.us/wp-includes/class-wp-hook.php(308): AALA_Admin->admin_page_display(”)
#1 /home/lorbus/aala.us/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(”, Array)
#2 /home/lorbus/aala.us/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#3 /home/lorbus/aala.us/wp-admin/admin.php(259): do_action(‘toplevel_page_a…’)
#4 {main}
thrown
Hello,
do you have an wordpress 6.2 update planned? update PHP 8.1?
Regards
Rainer
Im using a cmb field to uploading zip fieles.
$cmb->add_field(
array(
'name' => __('Zip File', 'my_text_dom'),
'id' => $prefix . 'zip',
'type' => 'file',
'options' => array(
'url' => false,
),
'query_args' => array(
'type' => 'application/zip',
),
);
When I hit the upload button, the media library opens and I only see .zip files, while image files are filtered out, which is exactly what I want :).
But when I switch to the Upload tab in the media library and hit the upload button, my local file manager opens. Images are not filtered out here. Is there anything I can do to change this?
]]>When i change language of WordPress but language date of type “text_time” not change.
Pls guide me for this issue.
Thanks
]]>I’m having a weird edge case I could use some help to debug.
I have some post_meta on my attachments, and in almost every instance of the Media Modal it instantiates and saves fine, however, when opening the Add/Upload Media Window from a CMB2 File_List, and using the Upload Files tab, the custom post_meta doesn’t always show up consistently.
After the image is uploaded I can click another image, and then back to the image I uploaded and then it appears.
I’ve tried playing with the priority of the ‘attachment_fields_to_edit’ filter to no success.
It feels like it must be an order of operations issue, but I just can’t track down where this would be occuring.
any help would be super appreciated.
Hi there,
I have a plugin-option ‘numbering’, that can be set to ‘numeric’ or ‘alphanumeric’ and i like to set the value of the pattern attribute depending on the value this plugin option has been set to. Is that even possible? Here is one of my futile attempts:
public function register_metabox() {
...
$mb->add_field( array(
'name' => __( 'Number', 'digipano' ),
'id' => $prefix . 'tree_number',
'type' => 'text',
'attributes' => array(
'pattern' => 'pattern_cb',
),
) );
function pattern_cb() {
$settings = get_option( 'my-settings' );
$numbering = $settings['numbering'];
switch ( $numbering ) {
case 'numeric':
return '[1-9]\d*';
case 'alphanumeric':
return '[A-Z]{1}[1-9]\d*';
default:
return '.*';
}
}
...
}
The code above is inside a class and there is a namespace, just for the case, that is important here.
Thanks in advance!
]]>Hello, first of all thank you very much for this plugin. I have a question, the plugin has not been updated for more than a year, are you planning to abandon it? Or will they continue to make improvements? I’m concerned about compatibility with new versions with php.
Thank you so much
]]>I would like to have an upload field in the backend that allows logged in users to upload zip files that are then unzipped to a subdirectory in the upload folder.
Is this possible with CMB2 or generally in WordPress? Does anyone know of an example, additional CMB2 plugin or snippet for this?
The reason why I need this is the following: I want to create a custom post type for multiresolution panoramas (framework Marzipano).
Such panoramas are based on an image pyramid of tiles (similar to inactive maps like Google Maps or OpenStreetMap). Hundreds of image tiles quickly accumulate, so that a manual file upload is not an option.
Here is an example, how a muliresolution panorama looks like: https://www.marzipano.net/demos/cube-multi-res/
]]>When I change the sequence of fields, then the field values ??are removed
example on video https://youtu.be/mWeK_HtjKls
]]>Hey,
I have a website that uses a music player plugin that uses your custom field and its support referred me to you.
They say that “The group field is a repeater. You will need to extract the value of the repeater to reach each individual values”
I’m trying to upload a lot of products to the site at once via Google Sheet, I have a value for each product but it seems to be a problematic field because everything I tried to do didn’t work, all the normal values from WooCommerce or ACF work great, the problem is only here and I’m afraid maybe because I need to add A certain number or something like that, because the names and IDs there always look like alb_tracklist[0][stream_link]
I would appreciate any help, thank you very much
Dear Team,
As we going to use ‘Product Author for WooCommerce plugin’ on our platform so we want to know that your plugin is compatible with below standards.
1) NCA approved solution compliant with
?2) ISO – 9001 and 27001.
Thank You
]]>I have container of images and I want to post or page relevant to the image when the user click on the image.
Can I use this plugin to do it?
My developers are trying to include HTML for the weather app here inside the Listeo theme which uses CMB2. How can they add an option for HTML the drop down they showed me has Video, Event Details but nothing to just include an HTML script.
]]>