Questions tagged [cmb2]

CMB2 is a Wordpress library to facilitate creation of custom meta-values and meta-boxes.

CMB2 is a WP library/toolkit to ease the repetitive task of meta-boxes and meta-values definition (that will blow your mind).

47 questions
13
votes
8 answers

Which WordPress hook fires after save all post data and post meta?

I have a custom post type crm, and i need to send a mail after each crm saved or updated. i user cmb2 for some custom meta like subject, to users etc. I know the save_post hook fires after post save (according to WordPress codex) in my case when i…
M. K Hossain
  • 807
  • 1
  • 12
  • 28
5
votes
1 answer

Multi-hierarchy categories are not showing third level hierarchy in wordpress taxonomy

I have 3 levels of categories, categories, sub categories and sub sub categories for custom post type. i am trying to show these categories in dropdown using cmb2, my code is only showing 2 levels of the categories and missing third level. Category…
Muzammil Hussain
  • 107
  • 1
  • 12
3
votes
4 answers

WordPress CMB2 - Get Option Value

I am using the example from the CMB2 snippets library to add a theme options page in WordPress /** * Hook in and register a metabox to handle a theme options page and adds a menu item. */ function yourprefix_register_main_options_metabox() { …
fightstarr20
  • 11,682
  • 40
  • 154
  • 278
3
votes
1 answer

CMB2 option-page parameter

CMB2 has an option to use as an option page. I'm looking in the example files, and on the wiki page but even copying and pasting the example on the files it not work. I'm probably missing something, but I can't find what it is, I already spent two…
Mateus Silva
  • 756
  • 2
  • 8
  • 20
2
votes
1 answer

CMB2 Attachment image output not works

I used CMB2 in my custom theme and I want to upload custom image in default categories page with CMB2. Text field are correctly displayed on the front. But wp_get_attachment_image not works correctly. What's wrong goes here? CMB meta box register: …
Jojo Jiji
  • 21
  • 3
2
votes
3 answers

Wordpress meta_query an array of values when metadata to compare is serialized array?

I am trying to run a meta_query with an array of values and have it search if all are present in the meta value which is stored in a serialized array. Is this possible? My arguments for the query is as follows (note that this is nested in a…
Derek Gutierrez
  • 628
  • 1
  • 6
  • 16
1
vote
0 answers

Rank Math metabox preview for custom field

I've created a custom field in Rank Math... add_action( 'rank_math/vars/register_extra_replacements', function(){ rank_math_register_var_replacement( 'op_shortcode', [ 'name' => esc_html__( 'OP ACF Field', 'rank-math' ), 'description' =>…
1
vote
1 answer

Looping through CMB2 attached posts

I've set up two different custom post types – one for categories and one for posts. I've attached the posts to the categories with the CMB2 plugin. I now want to display all the attached/related posts on each category page. I'm able to display the…
1
vote
2 answers

Access with wordpress query to meta_key is in other meta_key (with cmb2 plugin)

First i tried to create a filter with ( pre_get_posts ) but finally i decided to create a page archive for my custom post (date); I take the classic loop of archive page Wordpress and had $args $args = array( 'post_type' => 'date', …
1
vote
0 answers

CMB2 Encrypt field data

I'm using the CMB2 library for my wordpress system and we will be requesting users to input some personal data. Is it possible to somehow encrypt the data posted into certain custom-fields? Thanks in advance!
nexus_one
  • 11
  • 2
1
vote
0 answers

How to add cmb2 settings in WooCommerce

I have a small problem creating the settings panel in WordPress with the cmb2 plugin. I want to create a field in the WooCommerce post type called course headings where each course headings can have a number of Have a title. and display the product…
1
vote
0 answers

CMB2 repeatable file_list type

I am searching everywhere for an example of how to populate/access images entered inside of repeatable file-list group in CMB2. All the examples I could find is only for a single image: here is the link…
Refael
  • 145
  • 2
  • 12
1
vote
0 answers

How to Add CMB2 fields in my custom cmb2 field..?

I'm create my own cmb2 custom field. I want to add another custom field or default CMB2 fields in my custom field... it is possible ? I created and render the custom field using cmb2 documentation and render the field like this…
Shahid Mulani
  • 71
  • 1
  • 13
1
vote
1 answer

CMB2 - Get the first image from file_list

I am using CMB2 file_list for uploading photos e.g. photo gallery. On the home page I need to get only the first photo and not the entire gallery. Below is the function to get all the photo. How can i retrieve only the first photo in the…
Refael
  • 145
  • 2
  • 12
1
vote
1 answer

How to check all child checkboxes

I am using cmb2 taxonomy_multicheck_hierarchical field type to display my categories in a hierarchical format, however I have a lot of terms and they are currently 3 levels deep in the hierarchy. I would like to check all child terms if the parent…
1
2 3 4