Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Oscar Castañeda
@ojcastaneda_gitlab
@Jtsternberg_twitter thanks
Shahadat Hossain
@sdtHossain
is it possible to create admin theme option with CMB2? Please help
ashvin
@monparaashvin
hi
hello i active plugin repo but not display in pages..
giftGYDE
@giftGYDE_twitter
Hi there, I am trying to create a taxonomy term field group for CPT "recipe" and taxonomy "category", but I can't seem to figure it out. I noticed I have to set 'object_types', but can I set it to have 2 conditions, CPT and taxonomy? Thanks!
ashvin
@monparaashvin

function example_cb() {
$cmb_rest = new_cmb2_box( array(
'id' => 'yourprefix_demo_metabox',
'title' => esc_html__( 'Test Metabox', 'cmb2' ),
'object_types' => array( 'post', 'term' ), // Post type
'taxonomies' => array( 'category' ),
) );

$cmb_rest->add_field( array(
    'name'       => esc_html__( 'Test', 'pluginname' ),
    'id'         => 'test',
    'type'       => 'text',
) );

}
add_action( 'cmb2_admin_init', 'example_cb' );

giftGYDE
@giftGYDE_twitter
Thank you, but that adds the field to all the CPT's that have the taxonomy "category". I only want to add the fields to the "recipe" taxonomy.
Justin Sternberg
@jtsternberg
above, you said you have a CPT "recipe", but now you're saying "recipe" taxonomy. Can you explain more clearly?
to only show on term-edit for "recipe" taxonomy:
function example_cb() {
    $cmb = new_cmb2_box( array(
        'id'           => 'yourprefix_demo_metabox',
        'title'        => esc_html__( 'Test Metabox', 'cmb2' ),
        'object_types' => array( 'term' ), // Post type
        'taxonomies'   => array( 'recipe' ),
    ) );
    $cmb->add_field( array(
        'name'       => esc_html__( 'Test', 'pluginname' ),
        'id'         => 'test',
        'type'       => 'text',
    ) );
}
add_action( 'cmb2_admin_init', 'example_cb' );
Eslam Foula
@efoula
Hello, how to retrieve the attachment sizes/id in response, while using "file_list" - WP Rest API? Thank you!
Sagor Khan
@sagork
Hi, How can I show shortocode on cmb2 Like contact form 7 shortcoe? Can you please help?
9 replies
Juan Pablo
@jupa8712_twitter
Hi Guy, Is there a way to limit images in file_list field in admin?
Khaled Fathy
@kfathy194
Hi Guys, is nested groups possible with CMB2?
Carlos Herrera
@cehojac
Hello
thanks for join this chat
i have a question. is possible change the money format response?.
i need display european money format
Justin Sternberg
@jtsternberg
@cehojac yes, there's an example for doing that in the wiki: https://github.com/CMB2/CMB2/wiki/Field-Types#text_money
Carlos Herrera
@cehojac
TY @Jtsternberg_twitter !!!
Justin Sternberg
@jtsternberg
👍
Arya Sutrisna Putra
@AryaSutrisnaP_twitter
hi anyone is here ?
*in
I need help to get each group list id , is that possible ?
rcarrascopr
@rcarrascopr
I need help to incorporate conditional in wordpress
James Auble
@james0r
When i create parent box for the options-page i get that title as the parent menu item and also as a child
there a way to surpress this coming up twice?
rcm27
@rcm27
hi
I have a question...
how can I add or use Shamsi calendar during working with cmb2?
sanaullahraiss
@sanaullahraiss
Hi
My theme developer using this code to call CMB2 meta fields
<?php
echo cmb2_get_metabox_form( $metaboxes_form, $post_id, array(
'form_format' => '<form action="' . esc_url(WP_Job_Board_Mixes::get_full_current_url()) . '" class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="object_id" value="%2$s">%3$s<input type="submit" name="submit-cmb-profile" value="%4$s" class="button-primary"></form>',
'save_button' => esc_html__( 'Save Profile', 'workup' ),
) );
?>
I am unable to understand, where I can find it, to edit these fields?
Can you please help?
Thank you./
arafat362
@arafat362
Hello!
Christophe Rudyj
@kuipou
Hi it's not much of question more than would I need help to make it more DRY https://gist.github.com/kuipou/6ddd8f713a760367c49337387d7a74e4
if someone would like to take stab at it would be awesome
ONNsl
@JosMbomio_twitter
hi hoow can i display pdf files for metabox in frontend
??
Justin Sternberg
@jtsternberg
Techn0J03
@Techn0J03
CM2 throwing warnings when changing from version 2.2.2.1 to 2.7.0
Here is one warning
Warning: include_once(/mnt/data/vhosts/casite-1301570.cloudaccess.net/httpdocs/wp-content/plugins/b2i-investor-tools/vendor/cmb2/includes/CMB2_Hookup.php): failed to open stream: No such file or directory in /mnt/data/vhosts/casite-1301570.cloudaccess.net/httpdocs/wp-content/plugins/b2i-investor-tools/vendor/cmb2/includes/helper-functions.php on line 44
Techn0J03
@Techn0J03
This line in version 2.7.0 was not in 2.2.2.0
if ( 'CMB2_REST' === $class_name || 0 === strpos( $class_name, 'CMB2REST' ) ) {
$path .= '/rest-api';
}
Justin Sternberg
@jtsternberg
@Techn0J03 the hookup.php error is this: CMB2/CMB2#1333 Just rename the file on your server from CMB2_hookup.php to CMB2_Hookup.php
Techn0J03
@Techn0J03
thank you for the info.
Meo Huynh
@meo8
Hello! I'm trying to embed an iframe within a WYSIWYG. It appears once the iframe is added, but when I save and preview, it doesn't show up on the frontend. Once I go into the backend, the iframe also disappears.

$cmb = new_cmb2_box( array(
'id' => $prefix . '09b_metabox',
'title' => __( '09B - WYSIWYG', 'cmb2' ),
'object_types' => array( 'page', ), // Post type
'show_on' => array( 'key' => 'page-template', 'value' => 'templates/uikit.php' ),
'context' => 'advanced',
'priority' => 'high',
'show_names' => true, // Show field names on the left
) );

// Regular text field
$cmb->add_field( array(
'name' => __( '', 'cmb2' ),
'id' => $prefix . '09B_wysiwyg_content',
'type' => 'wysiwyg',
) );

$cmb->add_field( array(
'name' => __( 'Remove padding', 'cmb2' ),
'id' => $prefix . '9B_less_padding',
'type' => 'checkbox',
) );

Jarius John
@jjohn198_gitlab
Hi, I was recently having issues with the newest update crashing my website with a "critical error" and wanted to know if this was an issue that has occurred before and how to fix it?
ashvin
@monparaashvin
i have 4+ exp theme customize and theme devlopment any work send me msg
fixed issues and error ping me...
Minimal.
@minimal-wbd
Hi everyone, i looking for method how to bound two group fields, I mean if I add new field to first group this field must be shown in second group, it's realy to make?