__( 'Adsense for Authors Plugin(AFA) Widget', 'afawidget_ad' ), ) ); } // Creating widget front-end | This is where the action happens public function widget( $args, $instance ) { echo $args['before_widget']; if ( ! empty( $instance['title'] ) ) { echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ). $args['after_title']; } // before and after widget arguments are defined by themes | This is where you run the code and display the output $addimensions = explode ("x", $instance['widgetads']); echo adsensewidgetad($addimensions[0], $addimensions[1]); echo $args['after_widget']; global $post; $authorId = $post->post_author; } // Widget Backend public function form( $instance ) { $title = ! empty( $instance['title'] ) ? $instance['title'] : __( '', 'afawidget_ad' ); $widgetads = ! empty( $instance['widgetads'] ) ? $instance['widgetads'] : __( '', 'afawidget_ad' ); // Widget admin form ?>
post_author; $flag = get_the_author_meta( 'afa_adslot_id', $authorId ); $ad_content = '