Meta Box
Support › Meta Box AIO › error
https://pinyoung.com.tw/
錯誤詳細資料 ================== 檔案 /home/pinyoun1/public_html/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-views/src/Renderer.php 的第 141 行發生錯誤 (錯誤類型: E_ERROR)。錯誤訊息: Uncaught TypeError: Argument 1 passed to MBViews\Renderer::create_post_object() must be an instance of WP_Post, instance of stdClass given in /home/pinyoun1/public_html/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-views/src/Renderer.php:141 Stack trace: #0 [internal function]: MBViews\Renderer->create_post_object(Object(stdClass)) #1 /home/pinyoun1/public_html/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-views/src/Renderer.php(124): array_map(Array, Array) #2 /home/pinyoun1/public_html/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-views/src/Renderer.php(108): MBViews\Renderer->get_post_data() #3 /home/pinyoun1/public_html/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-views/src/Renderer.php(70): MBViews\Renderer->get_data() #4 /home/pinyoun1/public_html/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-views/src/Shortcode.php(28): MBViews\Renderer->render('inner_slider', Array) #5 /home/pinyoun1/public_html/wp-includes/shortcodes.php(434): MBViews\Shortcode->render(Array, '', 'mbv') #6 [
目前使用的外掛:Meta Box AIO 3.8.0 版 PHP 7.4.33 版
Hello,
Thanks for reaching out.
Can you please re-apply the workaround that I shared with you previously to fix the issue?
Add the code
$posts = array_filter( array_map( function( $p ) { return get_post( $p->ID ); }, $posts ) );
to the function get_post_data() on line 123, before the code
get_post_data()
$posts = array_map( [ $this, 'create_post_object' ], $posts );
file /wp-content/plugins/meta-box-aio/vendor/meta-box/mb-views/src/Renderer.php