true, 'show_ui' => true, ) ) as $taxonomy ) { add_action( $taxonomy . '_edit_form', array( $this, 'render' ), 20, 2 ); } } /** * Renders the SEO section. * * @param WP_Term $term Term being edited. * @param string $taxonomy Taxonomy. */ public function render( $term, $taxonomy ): void { if ( ! $term instanceof WP_Term || ! current_user_can( Capabilities::EDIT_SEO ) ) { return; } MediaField::enqueue(); $settings = MetaModule::taxonomy( Plugin::instance()->options(), (string) $taxonomy ); $value = static fn( string $key ) => Meta::term( (int) $term->term_id, $key ); $noindex = (string) $value( 'noindex' ); wp_nonce_field( self::NONCE, self::NONCE . '_nonce' ); ?>

$spec ) { if ( array_key_exists( $key, $_POST['wpiseo_term'] ) ) { // Sanitized by the field's spec as it is read. $value = Fields::sanitize( $spec, wp_unslash( $_POST['wpiseo_term'][ $key ] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Fields::sanitize(). Meta::write( 'term', (int) $term_id, $key, $value ); } } } }