CMB2_Type_Title

CMB title field type.

Defined (1)

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

/includes/types/CMB2_Type_Title.php  
  1. class CMB2_Type_Title extends CMB2_Type_Base { 
  2.  
  3. /** 
  4. * Handles outputting an 'title' element 
  5. * @return string Heading element 
  6. */ 
  7. public function render() { 
  8. $a = $this->parse_args( 'title', array( 
  9. 'tag' => $this->field->object_type == 'post' ? 'h5' : 'h3',  
  10. 'class' => 'cmb2-metabox-title',  
  11. 'name' => $this->field->args( 'name' ),  
  12. 'desc' => $this->_desc( true ),  
  13. 'id' => str_replace( '_', '-', sanitize_html_class( $this->field->id() ) ),  
  14. ) ); 
  15.  
  16. return $this->rendered( 
  17. sprintf( 
  18. '<%1$s %2$s>%3$s</%1$s>%4$s',  
  19. $a['tag'],  
  20. $this->concat_attrs( $a, array( 'tag', 'name', 'desc' ) ),  
  21. $a['name'],  
  22. $a['desc'] 
  23. ); 
  24.