Changeset 2632041
- Timestamp:
- 11/18/2021 11:40:41 AM (4 years ago)
- File:
-
- 1 edited
-
crypto-voucher-widget/trunk/cv_widget_image.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
crypto-voucher-widget/trunk/cv_widget_image.php
r2632036 r2632041 61 61 */ 62 62 public function form( $instance ) { 63 if ( isset( $instance[ 'label' ] ) ) { 64 $label = esc_attr($instance[ 'label' ]); 65 } 66 else { 67 $label = __( 'Buy Cryptocurrency Directly', 'text_domain' ); 68 } 63 $label = ! empty( $instance['label'] ) ? $instance['label'] : __( 'Buy Cryptocurrency Directly', 'text_domain' ); 64 $referenceId = ! empty( $instance['referenceId'] ) ? $instance['referenceId'] : ''; 69 65 70 if ( isset( $istance[ 'referenceId'] ) ) { 71 $referenceId = esc_attr($instance[ 'referenceId' ]); 72 } else { 73 $referenceId = null; 74 } 66 67 register_setting( 'first_tab_options', 'first_tab_items' ); 75 68 ?> 76 69 <div … … 121 114 */ 122 115 public function update( $new_instance, $old_instance ) { 123 $instance = array();124 $instance['title'] = ( !empty( $ new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : 'Buy Cryptocurrency Directly';125 $instance['referenceId'] = ( !empty( $new_instance['referenceId'] ) ) ? strip_tags( $new_instance['referenceId'] ) : 'null';126 $instance['primaryColor'] = ( !empty( $new_instance['primaryColor'] ) ) ? strip_tags( $new_instance['primaryColor'] ) : 'null';127 $instance['logo'] = ( !empty( $new_instance['logo'] ) ) ? strip_tags( $new_instance['logo'] ) : 'null';116 $instance = $old_instance; 117 $instance['title'] = ( !empty( $$new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : 'Buy Cryptocurrency Directly'; 118 $instance['referenceId'] = strip_tags( $new_instance['referenceId'] ); 119 $instance['primaryColor'] = strip_tags( $new_instance['primaryColor'] ); 120 $instance['logo'] = strip_tags( $new_instance['logo'] ); 128 121 129 122 return $instance;
Note: See TracChangeset
for help on using the changeset viewer.