plugin = $plugin; } /** * Registers hooks once taxonomies exist. */ public function register() { add_action( 'admin_init', array( $this, 'hook_taxonomies' ) ); } /** * Hooks the form and save action of each managed taxonomy. */ public function hook_taxonomies() { foreach ( array_keys( $this->plugin->types->taxonomies() ) as $taxonomy ) { add_action( "{$taxonomy}_edit_form_fields", array( $this, 'render' ), 20 ); add_action( "edited_{$taxonomy}", array( $this, 'save' ), 10, 1 ); } } /** * Renders the fields as table rows. * * @param WP_Term $term Term being edited. */ public function render( $term ) { $meta = $this->plugin->meta; $s = $this->plugin->settings; ?>