wpObject ); $editFacebookSnippetUrl = $this->getEditSnippetUrl( $templateType, 'facebook', $wpObject ); $editTwitterSnippetUrl = $this->getEditSnippetUrl( $templateType, 'twitter', $wpObject ); } } elseif ( 'archive' === $templateType || 'author' === $templateType || 'date' === $templateType || 'search' === $templateType ) { if ( is_a( $queriedObject, 'WP_User' ) ) { $editObjectUrl = get_edit_user_link( $queriedObject->ID ); $editObjectBtnText = esc_html__( 'Edit User', 'all-in-one-seo-pack' ); } $editGoogleSnippetUrl = $this->getEditSnippetUrl( $templateType, 'google' ); } elseif ( 'dynamic_home' === $templateType ) { $editGoogleSnippetUrl = $this->getEditSnippetUrl( $templateType, 'google' ); $editFacebookSnippetUrl = $this->getEditSnippetUrl( $templateType, 'facebook' ); $editTwitterSnippetUrl = $this->getEditSnippetUrl( $templateType, 'twitter' ); } return [ 'editGoogleSnippetUrl' => $editGoogleSnippetUrl ?? '', 'editFacebookSnippetUrl' => $editFacebookSnippetUrl ?? '', 'editTwitterSnippetUrl' => $editTwitterSnippetUrl ?? '', 'editObjectBtnText' => $editObjectBtnText ?? '', 'editObjectUrl' => $editObjectUrl ?? '', 'keyphrases' => $keyphrases ?? '', 'page_analysis' => $pageAnalysis ?? '', 'urls' => [ 'home' => home_url(), 'domain' => aioseo()->helpers->getSiteDomain(), 'mainSiteUrl' => aioseo()->helpers->getSiteUrl(), ], 'mainAssetCssQueue' => aioseo()->core->assets->getJsAssetCssQueue( $this->mainAssetRelativeFilename ), 'data' => [ 'isDev' => aioseo()->helpers->isDev(), 'siteName' => aioseo()->helpers->getWebsiteName() ] ]; } /** * Get the URL to the place where the snippet details can be edited. * * @since 4.2.8 * * @param string $templateType The WP template type {@see WpContext::getTemplateType}. * @param string $snippet 'google', 'facebook' or 'twitter'. * @param \WP_Post|\WP_Term|null $object Post or term object. * @return string The URL. Returns an empty string if nothing matches. */ private function getEditSnippetUrl( $templateType, $snippet, $object = null ) { $url = ''; // Bail if `$snippet` doesn't fit requirements. if ( ! in_array( $snippet, [ 'google', 'facebook', 'twitter' ], true ) ) { return $url; } // If we're in a post/page/term (not an attachment) we'll have a URL directly to the meta box. if ( in_array( $templateType, [ 'single', 'page', 'attachment', 'taxonomy' ], true ) ) { $url = 'taxonomy' === $templateType ? get_edit_term_link( $object, $object->taxonomy ) . '#aioseo-term-settings-field' : get_edit_post_link( $object, 'url' ) . '#aioseo-settings'; $queryArgs = [ 'aioseo-tab' => 'general' ]; if ( in_array( $snippet, [ 'facebook', 'twitter' ], true ) ) { $queryArgs = [ 'aioseo-tab' => 'social', 'social-tab' => $snippet ]; } return add_query_arg( $queryArgs, $url ); } // If we're in any sort of archive let's point to the global archive editing. if ( in_array( $templateType, [ 'archive', 'author', 'date', 'search' ], true ) ) { return admin_url( 'admin.php?page=aioseo-search-appearance' ) . '#/archives'; } // If homepage is set to show the latest posts let's point to the global home page editing. if ( 'dynamic_home' === $templateType ) { // Default `$url` for 'google' snippet. $url = add_query_arg( [ 'aioseo-scroll' => 'home-page-settings' ], admin_url( 'admin.php?page=aioseo-search-appearance' ) . '#/global-settings' ); if ( in_array( $snippet, [ 'facebook', 'twitter' ], true ) ) { $url = admin_url( 'admin.php?page=aioseo-social-networks' ) . '#/' . $snippet; } return $url; } return $url; } /** * Returns the "SEO Preview" submenu item data ("node" as WP calls it). * * @since 4.2.8 * * @return array The admin bar menu item data or an empty array if this feature is disabled. */ public function getAdminBarMenuItemNode() { if ( ! $this->enable ) { return []; } $title = esc_html__( 'SEO Preview', 'all-in-one-seo-pack' ); // @TODO Remove 'NEW' after a couple months. $title .= ''; $title .= esc_html__( 'NEW', 'all-in-one-seo-pack' ) . '!'; $title .= ''; return [ 'id' => 'aioseo-seo-preview', 'parent' => 'aioseo-main', 'title' => $title, 'href' => '#', ]; } }
Fatal error: Uncaught Error: Class "AIOSEO\Plugin\Common\Standalone\SeoPreview" not found in /htdocs/wp-content/plugins/all-in-one-seo-pack/app/Common/Standalone/Standalone.php:92 Stack trace: #0 /htdocs/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(316): AIOSEO\Plugin\Common\Standalone\Standalone->__construct() #1 /htdocs/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(97): AIOSEO\Plugin\AIOSEO->load() #2 /htdocs/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(76): AIOSEO\Plugin\AIOSEO->init() #3 /htdocs/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(414): AIOSEO\Plugin\AIOSEO::instance() #4 /htdocs/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php(96): aioseo() #5 /htdocs/wp-settings.php(526): include_once('/htdocs/wp-cont...') #6 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #7 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #8 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #9 /htdocs/index.php(17): require('/htdocs/wp-blog...') #10 {main} thrown in /htdocs/wp-content/plugins/all-in-one-seo-pack/app/Common/Standalone/Standalone.php on line 92