• Resolved Ati74

    (@ati74)


    Hello,

    i have create an own Widget. After the Update at Saturday this Widget doesn´t show on my Page and i can´t find the issue. Can you help me.
    Here is the Code

    <?php
    class reklamation_widget extends WP_Widget {
    
    	public function __construct() {
    		// Instantiate the parent object
    		parent::__construct( false, 'Offene Reklamationen' );
    	}
    
    	function widget( $args, $instance ) {
    		// Widget output
    		global $wpdb;
    		if ( is_user_logged_in() ) {
    		$table_logistik = $wpdb->prefix . "za_logistikbereich";
    
    		?>
    		<aside class="widget">
    		<?php echo '<h3 class="widget-title">Offene Reklamationen</h3>';?>
    		<table class="widget-table">
    		<?php
    
    		$logistiken = $wpdb->get_results ( "select logistikbereich from $table_logistik WHERE aktiv='ja' ORDER BY logistikbereich ASC");
    		foreach ( $logistiken as $logistik ) {
    
    		$meta_query = array();
    
    			$meta_query[] = array(
    			'key' => '_logistik',
    			'value' => $logistik->logistikbereich ,
    			'compare' => '='
    				);
    			$meta_query[] = array(
    			'key' => '_bearbeitet',
    			'value' => 'nein' ,
    			'compare' => '='
    				);
    			$argus=array(
    				'post_type' => 'reklamation',
    				'meta_query' => $meta_query
    			);
    		$wp_query = new WP_Query($argus);
    		$count = $wp_query->found_posts;
    		echo'<tr><td>' . $logistik->logistikbereich .'</td>';
    		echo'<td>' . $count .'</td></tr>';
    
    		}
    
    		?>
    		</table>
    		</aside>
    		<?php
    	}
    	}
    
    	function update( $new_instance, $old_instance ) {
    		// Save widget options
    	}
    
    	function form( $instance ) {
    		// Output admin widget options form
    	}
    }
    
    function reklamation_widgets() {
    	register_widget( 'reklamation_widget' );
    }
    
    add_action( 'widgets_init', 'reklamation_widgets' );
    
    ?>

    Thanks
    Ati

Viewing 1 replies (of 1 total)
  • Thread Starter Ati74

    (@ati74)

    $instance = array();
    return $instance;

    This in the update-Function resolved the Problem

    Ati

Viewing 1 replies (of 1 total)
  • The topic ‘Own Widget doesn´t show after Update 4.3’ is closed to new replies.