Error stemming from this plugin
-
After updating site to php and WP 8 I get this warning on my local
Warning: Attempt to read property "cat_ID" on null and it’s coming from functions.php
here is the block of code:
add_action('pre_get_posts', 'pre_get_posts_mod1' ); function pre_get_posts_mod1( $wp_query ) { $excluded = get_resource_cat_ids(); //exclude podcast category by ID array_push($excluded, '9', '1691'); $page_object = get_queried_object(); $cat_ID = $page_object->cat_ID; //do we exclude anything from main loop? if (!in_array( $cat_ID , $excluded )) { //exclude categories set_query_var('category__not_in', $excluded); } }
Stack trace from debug log
[10-Jun-2022 13:18:20 UTC] PHP Stack trace: [10-Jun-2022 13:18:20 UTC] PHP 1. {main}() /Users/jasonsprague/Local Sites/marketsmart-site/app/public/wp-admin/admin-ajax.php:0 [10-Jun-2022 13:18:20 UTC] PHP 2. require_once() /Users/jasonsprague/Local Sites/marketsmart-site/app/public/wp-admin/admin-ajax.php:22 [10-Jun-2022 13:18:20 UTC] PHP 3. require_once() /Users/jasonsprague/Local Sites/marketsmart-site/app/public/wp-load.php:50 [10-Jun-2022 13:18:20 UTC] PHP 4. require_once() /Users/jasonsprague/Local Sites/marketsmart-site/app/public/wp-config.php:92 [10-Jun-2022 13:18:20 UTC] PHP 5. do_action() /Users/jasonsprague/Local Sites/marketsmart-site/app/public/wp-settings.php:620 [10-Jun-2022 13:18:20 UTC] PHP 6. WP_Hook->do_action() /Users/jasonsprague/Local Sites/marketsmart-site/app/public/wp-includes/plugin.php:476 [10-Jun-2022 13:18:20 UTC] PHP 7. WP_Hook->apply_filters() /Users/jasonsprague/Local Sites/marketsmart-site/app/public/wp-includes/class-wp-hook.php:331 [10-Jun-2022 13:18:20 UTC] PHP 8. wpDiscuzForm->initPersonalDataExporter() /Users/jasonsprague/Local Sites/marketsmart-site/app/public/wp-includes/class-wp-hook.php:307 [10-Jun-2022 13:18:20 UTC] PHP 9. wpdFormAttr\Tools\PersonalDataExporter::getInstance() /Users/jasonsprague/Local Sites/marketsmart-site/app/public/wp-content/plugins/wpdiscuz/forms/wpDiscuzForm.php:60 [10-Jun-2022 13:18:20 UTC] PHP 10. wpdFormAttr\Tools\PersonalDataExporter->__construct() /Users/jasonsprague/Local Sites/marketsmart-site/app/public/wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Tools/PersonalDataExporter.php:112 [10-Jun-2022 13:18:20 UTC] PHP 11. wpdFormAttr\Tools\PersonalDataExporter->initFormsFields() /Users/jasonsprague/Local Sites/marketsmart-site/app/public/wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Tools/PersonalDataExporter.php:16 [10-Jun-2022 13:18:20 UTC] PHP 12. get_posts() /Users/jasonsprague/Local Sites/marketsmart-site/app/public/wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Tools/PersonalDataExporter.php:21 [10-Jun-2022 13:18:20 UTC] PHP 13. WP_Query->query() /Users/jasonsprague/Local Sites/marketsmart-site/app/public/wp-includes/post.php:2410 [10-Jun-2022 13:18:20 UTC] PHP 14. WP_Query->get_posts() /Users/jasonsprague/Local Sites/marketsmart-site/app/public/wp-includes/class-wp-query.php:3586 [10-Jun-2022 13:18:20 UTC] PHP 15. do_action_ref_array() /Users/jasonsprague/Local Sites/marketsmart-site/app/public/wp-includes/class-wp-query.php:1805 [10-Jun-2022 13:18:20 UTC] PHP 16. WP_Hook->do_action() /Users/jasonsprague/Local Sites/marketsmart-site/app/public/wp-includes/plugin.php:524 [10-Jun-2022 13:18:20 UTC] PHP 17. WP_Hook->apply_filters() /Users/jasonsprague/Local Sites/marketsmart-site/app/public/wp-includes/class-wp-hook.php:331 [10-Jun-2022 13:18:20 UTC] PHP 18. pre_get_posts_mod1() /Users/jasonsprague/Local Sites/marketsmart-site/app/public/wp-includes/class-wp-hook.php:307 [10-Jun-2022 13:18:20 UTC] PHP Warning: Attempt to read prop
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Error stemming from this plugin’ is closed to new replies.