defaults = array( 'title' => '', 'items_number' => 1, 'layout' => 'one-column', 'enable_hide_404' => 1, ); $widget_ops = array( 'classname' => 'ct-advertisement-image ctadvertisement', 'description' => __( 'Use this widget to add Image as Advertisement', 'automobile' ), ); $control_ops = array( 'id_base' => 'ct-advertisement-image', ); parent::__construct( 'ct-advertisement-image', // Base ID __( 'CT: Advertisement Images', 'automobile' ), // Name $widget_ops, $control_ops ); } /** * Creates the form for the widget in the back-end which includes the Title , adcode, image, alt * $instance Current settings */ function form($instance) { //* Merge with defaults $instance = wp_parse_args( (array) $instance, $this->defaults ); ?>
id="get_field_id( 'target' . '_' . $i ); ?>" name="get_field_name( 'target' . '_' . $i ); ?>" />
id="get_field_id('enable_hide_404'); ?>" name="get_field_name('enable_hide_404'); ?>" />
defaults ); if ( $instance['enable_hide_404'] && is_404() ) { //Bail Early if the page is 404 error page and the widget is set to be hidden in that page return; } echo $args['before_widget']; // Set up the author bio if ( ! empty( $instance['title'] ) ) { echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $args['after_title']; } echo '