by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Justin Sternberg
@jtsternberg
Sorry, it's not clear what you are asking
amit648
@amit648
Simply , i want to get one field of metabox in register form and that field save it that metabox .
Ian Barker
@iantbarker
Anyone know how I can retrieve a specific value from my repeatable field group? Essentially, how do I get a specific value from an array?
Justin Sternberg
@jtsternberg
@iantbarker like a specific value from an specific row, or a specific field from all rows?
Ian Barker
@iantbarker
@jtsternberg Good question... Specific value (first is fine) from the specific row (first is fine)
Justin Sternberg
@jtsternberg
@iantbarker have you seen the docs for it? https://github.com/CMB2/CMB2/wiki/Field-Types#css-field-class-32
Ian Barker
@iantbarker
@jtsternberg I looked through those but didn't see anything but am probably missing something. I know how to loop through and get all the values.
Justin Sternberg
@jtsternberg
@iantbarker using that example in the wiki, something like this:
Ian Barker
@iantbarker
Ohhh... I see it now. That link went to WYSIWYG section for some reason so didn't understand the connection. Now I see. Thanks so much!
Ashiqur Rahman
@ashiq35
How display all the users in a dropdown option
Justin Sternberg
@jtsternberg
You would likely use an example similar to this one, but updating to use the user query methods: https://github.com/CMB2/CMB2/wiki/Adding-your-own-field-types#example-2-posts-or-other-post_type-dropdown-store-post_id
Rich Deane
@QTRichieRich
Hi - has anyone tried to export CMB2 settings to json to then import? I get a type error on the import side, looks like some data is lost through the unserialise > json > serialise...
Justin Sternberg
@jtsternberg
Can’t say I have. Curious, what are you using to do the import/export?
Munkhbayar
@munkhbayaryo

Hello,
I'm using cmb object type as page, purpose for theme option.
'object_types' => array( 'page' ),

But can't display in post loop.
if ( have_posts() ) : while ( have_posts() ) : the_post(); if(get_post_meta( get_the_ID(), 'CUSTOM FIELD', 1 )) { echo "YES!"; } endwhile; endif;

Outside of post loop works ok, anyone please help me.

Jeremy Turowetz
@jerturowetz
Hey gang, just wondering if there's an option for the file type to turn off the preview. Can't find it in the docs.
Justin Sternberg
@jtsternberg
there is no such option
Matthew Aubie
@matthewaubie
Hey everyone -- is there a way to set the metabox attribute based on the user role?
Justin Sternberg
@jtsternberg
I might need you clarify. Which attribute?
Matthew Aubie
@matthewaubie
readonly
I want some metaboxes to be editable by admins, but not editable by authors
Justin Sternberg
@jtsternberg
Have you seen these examples? https://github.com/CMB2/CMB2/wiki/Adding-your-own-show_on-filters They demonstrate how to conditionally show a metabox, though makeing it readonly would require some different code.
valanarasug
@valanarasug
how to change button caption on add or upload file button
Iisakki Ronkainen
@IisakkiR_twitter
Hey, is it possible to put repeatable group inside repeatable group?
Justin Sternberg
@jtsternberg
Unfortunately it’s not.
Bizzy81
@Bizzy81
Does this plugin send any info it shares with third parties? Many free plugins does that, so I am just wondering.
Justin Sternberg
@jtsternberg
It does not.
Elmadi
@Elmadi
Hi. I am working on wordPress plugins. Since the last times i am looking for how can i add a metabox to one front-page but i still have not been able to do it. i had this error "call to undefined function add_meta_box(). in the template where i wand add the meta i have this: <?php do_action('dcd_h', $object_id); ?> and in my plugin i have add_action('dcd_h','fun_dcd_settings'); function fun_dcd_settings(){ add_meta_box('id_dcd', __('DCD - Settings '),'dcd_basic_metabox', 'product', 'normal', 'high');} function dcd_basic_metabox(){echo '<input type="text" />';}
Elmadi
@Elmadi
i passed more han one week on this topic please help me. Thanks
Justin Sternberg
@jtsternberg
Please open a support request on the plugin’s Wordpress.org support forums.
Justin Sternberg
@jtsternberg
Ravi Gehlot
@ravigehlot
How can I enable revisions for repeaters?
SAMEH ELSHAL
@samehelshal_twitter
i created many custom types using cmb2 but there an error when show single post type it redirect me to the error page
abayomiabayomi
@abayomiabayomi
Hello all
how can I sum 2 meta_value(s) to get a result list for a column in my post list?
i do not want to display the meta values in 2 separate columns, i want the two values(numbers) summed up for one single column
Sebastillar
@sebastillar_twitter

Hi everybody. I've already implements this code:
function cmb2_post_search_ajax_metaboxes_example() {

$example_meta = new_cmb2_box( array(
'id' => 'cmb2_post_search_ajax_field',
'title' => __( 'Related Posts', 'cmb2' ),
'object_types' => array( 'movie' ), // Post type
'context' => 'normal',
'priority' => 'high',
'show_names' => true, // Show field names on the left
) );

$example_meta->add_field( array(
'name' => ( 'Example Multiple', 'cmb2' ),
'id' => 'cmb2_post_search_ajax_demo_multiple',
'type' => 'post_search_ajax',
'desc' =>
( '(Start typing post title)', 'cmb2' ),
// Optional :
'limit' => 10, // Limit selection to X items only (default 1)
'sortable' => true, // Allow selected items to be sortable (default false)
'query_args' => array(
'post_type' => array( 'movie' ),
'post_status' => array( 'publish' ),
'posts_per_page' => -1
)
) );

$example_meta->add_field( array(
'name' => ( 'Example Single', 'cmb2' ),
'id' => 'cmb2_post_search_ajax_demo_single',
'type' => 'post_search_ajax',
'desc' =>
( '(Start typing post title)', 'cmb2' ),
// Optional :
'limit' => 1, // Limit selection to X items only (default 1)
'sortable' => false, // Allow selected items to be sortable (default false)
'query_args' => array(
'post_type' => array( 'movie' ),
'post_status' => array( 'publish' ),
'posts_per_page' => -1
)
) );

}
add_action( 'cmb2_init', 'cmb2_post_search_ajax_metaboxes_example' );

But WordPress admin doesn't render the input fields
somebody with same issue?
Sebastillar
@sebastillar_twitter
I resolve this issue!
For work with cmb2 ajax, required this plugin https://github.com/alexis-magina/cmb2-field-post-search-ajax
Sebastillar
@sebastillar_twitter
Oh, this plugin doesn't work in group fields :(
Please, any solution or suggestion?
Raymacz
@raymacz_twitter
Hi! just used CMB2 today, I have been reading the documentation but couldn't find the topic I'm searching for. Can anyone point the link on how to hide on screen - Box Support (similar to ACF)? thanks,
like this ->> https://www.screencast.com/t/6lsOzz9nGOF
microcol
@microcol
hi
i want to add custom filed for Relationships between 2 post
Jeremy Turowetz
@jerturowetz
Hi @microcol, this seems like something covered by the docs & 3rd party resources. Can you check there please https://cmb2.io/#cmb2-3rd-party-resources
@raymacz_twitter I am pretty sure there is no point and click for engaging with cmb2. When you add new meta boxes you explicitly define where you want them to appear (in the code).