section = $section; $this->do_once(); add_action( beans_get( 'taxonomy' ). '_edit_form_fields', array( $this, 'fields' ) ); } /** * Trigger actions only once. */ private function do_once() { static $once = false; if ( !$once ) : add_action( beans_get( 'taxonomy' ). '_edit_form', array( $this, 'nonce' ) ); add_action( 'edit_term', array( $this, 'save' ) ); add_action( 'delete_term', array( $this, 'delete' ), 10, 3 ); $once = true; endif; } /** * Post meta nonce. */ public function nonce( $tag ) { echo ''; } /** * Fields content. */ public function fields( $tag ) { beans_remove_action( 'beans_field_label' ); beans_modify_action_hook( 'beans_field_description', 'beans_field_wrap_after_markup' ); beans_modify_markup( 'beans_field_description', 'p' ); beans_add_attribute( 'beans_field_description', 'class', 'description' ); foreach ( beans_get_fields( 'term_meta', $this->section ) as $field ) { echo '