bp_email_tax_type_metabox

Display metabox for email taxonomy type.

Description

bp_email_tax_type_metabox( (WP_Post) $post, (array) $box ); 

Shows the term description in a list, rather than the term name itself.

Parameters (2)

0. $post (WP_Post)
Post object.
1. $box (array)
Tags meta box arguments.

Options

  • id (string) => ''

    Meta box ID.

  • title (string) => ''

    Meta box title.

array(

    /**
     * Meta box ID.
     *
     * @type string
     * @default ''
     */
    'id' => '',

    /**
     * Meta box title.
     *
     * @type string
     * @default ''
     */
    'title' => ''
);        


Usage

  1. if ( !function_exists( 'bp_email_tax_type_metabox' ) ) { 
  2. require_once '/bp-core/admin/bp-core-admin-functions.php'; 
  3.  
  4. // Post object. 
  5. $post = null; 
  6.  
  7. // Tags meta box arguments. 
  8. $box = array( 
  9. 'id' => '', 
  10. 'title' => '' 
  11. ); 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = bp_email_tax_type_metabox($post, $box); 
  15.  

Defined (1)

The function is defined in the following location(s).

/bp-core/admin/bp-core-admin-functions.php  
  1. function bp_email_tax_type_metabox( $post, $box ) { 
  2. $r = array( 
  3. 'taxonomy' => bp_get_email_tax_type() 
  4. ); 
  5.  
  6. $tax_name = esc_attr( $r['taxonomy'] ); 
  7. $taxonomy = get_taxonomy( $r['taxonomy'] ); 
  8. ?> 
  9. <div id="taxonomy-<?php echo $tax_name; ?>" class="categorydiv"> 
  10. <div id="<?php echo $tax_name; ?>-all" class="tabs-panel"> 
  11. <?php 
  12. $name = ( $tax_name == 'category' ) ? 'post_category' : 'tax_input[' . $tax_name . ']'; 
  13. echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks. 
  14. ?> 
  15. <ul id="<?php echo $tax_name; ?>checklist" data-wp-lists="list:<?php echo $tax_name; ?>" class="categorychecklist form-no-clear"> 
  16. <?php wp_terms_checklist( $post->ID, array( 'taxonomy' => $tax_name, 'walker' => new BP_Walker_Category_Checklist ) ); ?> 
  17. </ul> 
  18. </div> 
  19.  
  20. <p><?php esc_html_e( 'Choose when this email will be sent.', 'buddypress' ); ?></p> 
  21. </div> 
  22. <?php