WordPress 4.7 Galery shortcode funktioniert nicht

meine Galerie shortcode funktioniert wp 4.00 Version aber Upgrade wp.4.7 funktioniert nicht wie kann ich beheben. Warum nicht arbeiten? Wenn ich diese function lösche, funktioniert die normale wp-Shortcode-function nicht. Das ist meine Shortcode-function:

remove_shortcode('gallery', 'gallery_shortcode'); add_shortcode('gallery', 'magicreche_post_gallery'); function magicreche_post_gallery($attr) { wp_enqueue_script('hoverdir'); $post = get_post(); static $instance = 0; $instance++; if ( ! empty( $attr['ids'] ) ) { // 'ids' is explicitly ordered, unless you specify otherwise. if ( empty( $attr['orderby'] ) ) $attr['orderby'] = 'post__in'; $attr['include'] = $attr['ids']; } // Allow plugins/themes to override the default gallery template. $output = apply_filters('post_gallery', '', $attr); // burası if ( $output != '' ) return $output; // We're trusting author input, so let's at least make sure it looks like a valid orderby statement if ( isset( $attr['orderby'] ) ) { $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] ); if ( !$attr['orderby'] ) unset( $attr['orderby'] ); } extract(shortcode_atts(array( 'order' => 'ASC', 'orderby' => 'menu_order ID', 'id' => $post ? $post->ID : 0, 'itemtag' => 'li', 'icontag' => '', 'captiontag' => 'span', 'columns' => 3, 'size' => 'gallery', 'include' => '', 'exclude' => '', 'link' => '' ), $attr, 'gallery')); $id = intval($id); if ( 'RAND' == $order ) $orderby = 'none'; if ( !empty($include) ) { $_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); $attachments = array(); foreach ( $_attachments as $key => $val ) { $attachments[$val->ID] = $_attachments[$key]; } } elseif ( !empty($exclude) ) { $attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); } else { $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); } if ( empty($attachments) ) return ''; if ( is_feed() ) { $output = "\n"; foreach ( $attachments as $att_id => $attachment ) $output .= wp_get_attachment_link($att_id, 'full', true); return $output; } $columns = intval($columns); switch ($columns) { case '10': case '9': case '8': case '7': case '6': case '5': case '4': $itemwidth = 'col-sm-3'; $row_break = 4; break; case '3': $itemwidth = 'col-sm-4'; $row_break = 3; break; case '2': case '1': $itemwidth = 'col-sm-6'; $row_break = 2; break; default: $itemwidth = 'col-sm-3'; $row_break = 3; break; } $selector = "gallery-{$instance}"; $size_class = sanitize_html_class( $size ); $gallery_div = ''; return $output; } 

Solutions Collecting From Web of "WordPress 4.7 Galery shortcode funktioniert nicht"