views/noticias/wp-content/themes/supermag/acmethemes/sidebar-widget/acme-ad.php
/**

         * Function to Creating widget front-end. This is where the action happens

         *

         * @access public

         * @since 1.0

         *

         * @param array $args widget setting

         * @param array $instance saved values

         * @return void

         *

         */
Function to Creating widget front-end. This is where the action happens



@param array $args widget setting
@param array $instance saved values
@return void
Function to Creating widget front - end . This is where the action happens @param array $args widget setting @param array $instance saved values @return void
function widget( $args, $instance ) {
            $instance = wp_parse_args( (array) $instance, $this->defaults);
            $supermag_ad_title = apply_filters( 'widget_title', $instance['supermag_ad_title'], $instance, $this->id_base );
            $supermag_ad_image          = esc_url( $instance['supermag_ad_image'] );
            $supermag_ad_link           = esc_url( $instance['supermag_ad_link'] );
            $supermag_ad_new_window = esc_attr( $instance['supermag_ad_new_window'] );
            $supermag_ad_img_alt           = esc_attr( $instance['supermag_ad_img_alt'] );
            echo $args['before_widget'];
            if ( !empty($supermag_ad_title) ) {
                echo $args['before_title'] . $supermag_ad_title . $args['after_title'];
            }
            $ad_content_image = '';
            if ( ! empty( $supermag_ad_image ) ) {
                $img_html = '<img src="' . $supermag_ad_image . '" alt="'.$supermag_ad_img_alt . '" />';
                $link_open = '';
                $link_close = '';
                if ( ! empty( $supermag_ad_link ) ) {
                    $target_text = ( 1 == $supermag_ad_new_window ) ? ' target="_blank" ' : '';
                    $link_open = '<a href="' . esc_url( $supermag_ad_link ) . '" ' . $target_text . '>';
                    $link_close = '</a>';
                }
                $ad_content_image = $link_open . $img_html .  $link_close;
            }
            if ( !empty( $ad_content_image ) ) {
                echo '<div class="supermag-ainfo-widget">';
                echo $ad_content_image;
                echo '</div>';
            }
            echo $args['after_widget'];
        }
function widget ( $ args , $ instance ) { $ instance = wp_parse_args ( ( array ) $ instance , $ this -> defaults ) ; $ supermag_ad_title = apply_filters ( 'widget_title' , $ instance [ 'supermag_ad_title' ] , $ instance , $ this -> id_base ) ; $ supermag_ad_image = esc_url ( $ instance [ 'supermag_ad_image' ] ) ; $ supermag_ad_link = esc_url ( $ instance [ 'supermag_ad_link' ] ) ; $ supermag_ad_new_window = esc_attr ( $ instance [ 'supermag_ad_new_window' ] ) ; $ supermag_ad_img_alt = esc_attr ( $ instance [ 'supermag_ad_img_alt' ] ) ; echo $ args [ 'before_widget' ] ; if ( ! empty ( $ supermag_ad_title ) ) { echo $ args [ 'before_title' ] . $ supermag_ad_title . $ args [ 'after_title' ] ; } $ ad_content_image = '' ; if ( ! empty ( $ supermag_ad_image ) ) { $ img_html = '<img src="' . $ supermag_ad_image . '" alt="' . $ supermag_ad_img_alt . '" />' ; $ link_open = '' ; $ link_close = '' ; if ( ! empty ( $ supermag_ad_link ) ) { $ target_text = ( 1 == $ supermag_ad_new_window ) ? ' target="_blank" ' : '' ; $ link_open = '<a href="' . esc_url ( $ supermag_ad_link ) . '" ' . $ target_text . '>' ; $ link_close = '</a>' ; } $ ad_content_image = $ link_open . $ img_html . $ link_close ; } if ( ! empty ( $ ad_content_image ) ) { echo '<div class="supermag-ainfo-widget">' ; echo $ ad_content_image ; echo '</div>' ; } echo $ args [ 'after_widget' ] ; }
Function to Creating widget front-end.
Function to Creating widget front - end .
/*creating add*/