Wednesday, November 23, 2022
HomeWordPress Development500 Inside Server Error PHP 8.1 Array with wordpress

500 Inside Server Error PHP 8.1 Array with wordpress


Jut up to date wordpress and woocommerce to the most recent variations. Sadly im getting a 500 Inside Server someplace within the following traces:

add_action( 'woocommerce_before_shop_loop_item', 'attribute_img_loop', 20 );
perform attribute_img_loop() {
        international $publish;
        $attribute_names = array( 'pa_sertifikalar' ); // Add attribute names right here and bear in mind so as to add the pa_ prefix to the attribute title
        // echo '<script>alert('.$attribute_names.');</script>';

            
        foreach ( $attribute_names as $attribute_name ) {
            $taxonomy = get_taxonomy( $attribute_name );
            
            if ( $taxonomy && ! is_wp_error( $taxonomy ) ) {
                $phrases = wp_get_post_terms( $post->ID, $attribute_name );
                $terms_array = array();
            
                if ( ! empty( $phrases ) ) {
                    
                    echo '
                            <desk class="combs" cellspacing="0">
                                <tbody>
                                        <tr>                        
                                            <td>                            
                                                <ul class="nm-variation-control ul-control-certificate">';                                                  
                                                    foreach ( $phrases as $time period ) {
                                                        $thumb_id = get_woocommerce_term_meta( $term->term_id, 'thumbnail_id', true );
                                                        $image_id = absint( get_term_meta( $term->term_id, 'nm_pa_image_thumbnail_id', true ) );
                                                        $img_src = ( $image_id ) ? wp_get_attachment_url( $image_id ) : '';         
                                                        $archive_link = get_term_link( $term->slug, $attribute_name );
                                                        $full_line="<li><div class="lcrap"><img id="c". $image_id .'" data-src="'. $img_src .'" alt="" class="lazyload" alt="'. $term->title .'" /></div></li>';
                                                        array_push( $terms_array, $full_line );
                                                    }
                                                    // echo $taxonomy->labels->title . ' ' . implode( $terms_array, '-- ' );
                                                    echo implode( $terms_array, '');
                                                    
                                          echo '</ul>
                                            </td>
                                        </tr>
                                </tbody>
                            </desk>';                                                  
                                                    
                }
                            
            }
        }
}

Simply added echo '<script>alert('.$attribute_names.');</script>'; to examine the output from the $attribute_names = array( 'pa_sertifikalar' );
half and noticed it returns a

perform Array() {
    [native code]
}

Any concept whats occurring right here?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments