jcchavezs / cmb2-taxonomy Goto Github PK
View Code? Open in Web Editor NEWCustom metaboxes for taxonomies
License: GNU General Public License v2.0
Custom metaboxes for taxonomies
License: GNU General Public License v2.0
Is there a way to use get_terms and filter by custom taxonomy field?
Something like that :
$args = array(
'hide_empty' => false,
'meta_query' =>
array(
'key' => 'segment',
'value' => 'chemicals',
'compare' => 'LIKE'
)
);
$product_groups = get_terms('product_group', $args);
Just updated a (staging) site to WP 4.4. It looks like your function_exists
statements are not in the current plugin repo version. This is a fatal error, so you might want to update that asap, as today is the new WP version release.
Hey i just implemented this onto my current site. I currently have CMB2 plugin and the cmb2 taxonomy plugin, and this example metaboxes just to get it going:
add_filter('cmb2-taxonomy_meta_boxes', 'cmb2_taxonomy_sample_metaboxes');
function cmb2_taxonomy_sample_metaboxes()
{
// Start with an underscore to hide fields from custom fields list
$prefix = '_cmb2_';
$meta_boxes = new_cmb2_box(array(
'id' => 'test_metabox',
'title' => __('Test Metabox', 'cmb2'),
'object_types' => array('page',), // Post type
'context' => 'normal',
'priority' => 'high',
'show_names' => true, // Show field names on the left
));
$meta_boxes->add_field(array(
'desc' => __('Insert tables for this product here', 'cmb2'),
'id' => $prefix . 'text_wysiwyg',
'type' => 'text',
));
}
im getting an error on my taxonomy pages:
Warning: Invalid argument supplied for foreach() in /plugins/cmb2-taxonomy/includes/CMB2_Taxonomy.php on line 68
Is this plugin under active development?
Is there any plans to use the _termmeta table now that WordPress natively supports Term Meta?
Is there a compelling reason why I would use this plugin instead of the Taxonomy_MetaData helper class? In CMB2/CMB2@09d6c56, @jtsternberg writes that this is
Similar to Taxonomy_MetaData, but uses a custom table for taxonomy term meta storage.
Why would I care about using a custom table or not?
Im removing this, I posted this on the wrong plugin.
The issue is relative to the version on WordPress repository, please update the plugin in the repo with this version on github (they are not sync)
https://wordpress.org/support/topic/doesnt-work-on-44?replies=2#post-7786491
Hey having trouble getting the image to show up on the front end using cmb2 taxonomy. I have used regular cmb2 for other stuff and it works great. I have a custom taxonomy for a custom post type and i need to get the image of the taxonomy and display it as a banner for each of my post types. but its not coming up. Its saving to the DB but not getting displayed on the front end when i use
`add_filter('cmb2-taxonomy_meta_boxes', 'cmb2_taxonomy_metaboxes');
/**
Define the metabox and field configurations.
@param array $meta_boxes
@return array
*/
function cmb2_taxonomy_metaboxes( array $meta_boxes ) {
// Start with an underscore to hide fields from custom fields list
$prefix = 'cmb2_taxonomy';
/**
return $meta_boxes;
}`
that saves the meta box and it is saving to the db then to display it i have
$bannerImg = get_term_meta(get_the_ID(), '_cmb2_taxonomy_collection_banner',true);?>
<div class="col-xs-12 banner-image" style="background-image: url('<?php echo $bannerImg?>');"></div>
but don't see it on the front end.
I see you refer to the basic usage for cmb2 but none of that is working. So can you give me an example of how to add an image field and display that image on the front end using cmb2 taxonomy?
A Category is a taxonomy type. Tested it with category listed as the object type, and it does not render any inputs.
Looks like you're using the deprecated filter. Can you please update to use the new API. It is demonstrated in the example-functions.php file. Related: CMB2/CMB2#397
Let me know you have any questions.
It will be great to have the ability to set position for metabox.
add_action( "{$taxonomy_name}_edit_form", array($this, 'render_meta_fields_edit_form'), 10, 2 );
i have try it, and realise there is no wp_termmeta on my database. so anyone who want to try this need to create their custom database first like:
CREATE TABLE `wp_termmeta` (
`meta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`term_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`meta_key` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`meta_value` longtext COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (`meta_id`),
KEY `term_id` (`term_id`),
KEY `meta_key` (`meta_key`(191))
) ENGINE=InnoDB AUTO_INCREMENT=3255 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
hi
wysiwyg field dont work in term insert page and content dont insert to database
but in edit page it is ok and when update term content of wysiwyg insert to database
where is problem?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.