error when CPT does not have metabox
-
ErrorException thrown with message “Trying to get property ‘advanced’ of non-object”
Stacktrace:
#8 ErrorException in /srv/www/bedrock/current/web/app/plugins/all-in-one-seo-pack-pro/app/Common/Admin/Admin.php:999
#7 Illuminate\Foundation\Bootstrap\HandleExceptions:handleError in /srv/www/bedrock/current/web/app/plugins/all-in-one-seo-pack-pro/app/Common/Admin/Admin.php:999
#6 AIOSEO\Plugin\Common\Admin\Admin:addPublishScore in /srv/www/bedrock/current/web/wp/wp-includes/class-wp-hook.php:292
#5 WP_Hook:apply_filters in /srv/www/bedrock/current/web/wp/wp-includes/class-wp-hook.php:316
#4 WP_Hook:do_action in /srv/www/bedrock/current/web/wp/wp-includes/plugin.php:484
#3 do_action in /srv/www/bedrock/current/web/wp/wp-admin/includes/meta-boxes.php:312
#2 post_submit_meta_box in /srv/www/bedrock/current/web/wp/wp-admin/includes/template.php:1389
#1 do_meta_boxes in /srv/www/bedrock/current/web/wp/wp-admin/edit-form-advanced.php:681
#0 require in /srv/www/bedrock/current/web/wp/wp-admin/post-new.php:75/srv/www/bedrock/current/web/app/plugins/all-in-one-seo-pack-pro/app/Common/Admin/Admin.php } /** * Renders the Score button in the publish metabox. * * @since 4.0.0 * * @param WP_Post $postObj The post object. * @return void */ public function addPublishScore( $postObj ) { $pageAnalysisCapability = aioseo()->access->hasCapability( 'aioseo_page_analysis' ); if ( empty( $pageAnalysisCapability ) || ( aioseo()->helpers->isWooCommerceActive() && 'product' === $postObj->post_type ) ) { return; } $postTypes = aioseo()->helpers->getPublicPostTypes(); $showTruSeo = aioseo()->options->advanced->truSeo; $isSpecialPage = aioseo()->helpers->isSpecialPage( $postObj->ID ); $currentPostType = $postObj->post_type; $showMetabox = aioseo()->options->searchAppearance->dynamic->postTypes->$currentPostType->advanced->showMetaBox; $postTypesMB = []; foreach ( $postTypes as $pt ) { if ( class_exists( 'bbPress' ) ) {
Wordpress Version: 5.7
Theme: Sage
Plugin version: 4.1.0 Pro.
- The topic ‘error when CPT does not have metabox’ is closed to new replies.