Giter Club home page Giter Club logo

cmb2-taxonomy's People

Contributors

jcchavezs avatar joshuadavidnelson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cmb2-taxonomy's Issues

Is there a way to use get_terms and filter by custom taxonomy field?

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);

1.0.2 Breaks WP 4.4

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.

Error on line 68 of plugin

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

Image filed for taxonomy not shwing on front end

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';

    /**

    • Sample metabox to demonstrate each field type included
      */
      $meta_boxes['taxonomy_metabox'] = array(
      'id' => 'taxonomy_metabox',
      'title' => __( 'Taxonomy Metabox', 'cmb2' ),
      'object_types' => array( 'collection_category', ), // Taxonomy
      'context' => 'normal',
      'priority' => 'high',
      'show_names' => true, // Show field names on the left
      // 'cmb_styles' => false, // false to disable the CMB stylesheet
      'fields' => array(
      array(
      'name' => __( 'Collection Banner', 'cmb2' ),
      'desc' => __( 'Upload an image or enter a URL.', 'cmb2' ),
      'id' => $prefix . 'collection_banner',
      'type' => 'file',
      ),
      ),
      );

    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?

Taxonomy Metabox Position

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 );

cant use without create wp_termmeta first

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;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.