From c54d7f78eefe4d53e8b6df6cacbf4a4026928b9c Mon Sep 17 00:00:00 2001 From: Robin Cornett Date: Tue, 25 Jun 2019 12:35:58 -0400 Subject: [PATCH] Fix onchange value outside of widgets screen --- includes/widgets/fields/term-taxonomy.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/widgets/fields/term-taxonomy.php b/includes/widgets/fields/term-taxonomy.php index e8b438d..5f835bc 100644 --- a/includes/widgets/fields/term-taxonomy.php +++ b/includes/widgets/fields/term-taxonomy.php @@ -13,6 +13,8 @@ if ( empty( $instance ) ) { $instance = include 'term-defaults.php'; } +$onchange = is_callable( $this, 'get_field_id ' ) ? sprintf( 'term_postback(\'%s\', this.value );', esc_attr( $this->get_field_id( 'term' ) ) ) : ''; + /** * Define term specific taxonomy fields. */ @@ -23,7 +25,7 @@ return array( 'id' => 'taxonomy', 'label' => __( 'Taxonomy:', 'display-featured-image-genesis' ), 'flex' => true, - 'onchange' => sprintf( 'term_postback(\'%s\', this.value );', esc_attr( $this->get_field_id( 'term' ) ) ), + 'onchange' => '', 'choices' => $tax_options, ), ),