'] = get_edit_term_link( $queriedObject, $queriedObject->taxonomy );
} else {
$wpObject = aioseo()->helpers->getPost();
if ( is_a( $wpObject, 'WP_Post' ) ) {
$labels = get_post_type_labels( get_post_type_object( $wpObject->post_type ) );
$data['editObjectUrl'] = get_edit_post_link( $wpObject, 'url' );
if (
! aioseo()->helpers->isSpecialPage( $wpObject->ID ) &&
'attachment' !== $templateType
) {
$aioseoPost = Models\Post::getPost( $wpObject->ID );
$data['page_analysis'] = Models\Post::getPageAnalysisDefaults( $aioseoPost->page_analysis );
$data['keyphrases'] = Models\Post::getKeyphrasesDefaults( $aioseoPost->keyphrases );
}
}
}
// At this point if `$wpObject` is not an instance of WP_Term nor WP_Post, then we can't have the URLs.
if (
is_object( $wpObject ) &&
is_object( $labels )
) {
$data['editObjectBtnText'] = sprintf(
// Translators: 1 - A noun for something that's being edited ("Post", "Page", "Article", "Product", etc.).
esc_html__( 'Edit %1$s', 'all-in-one-seo-pack' ),
$labels->singular_name
);
$data['editGoogleSnippetUrl'] = $this->getEditSnippetUrl( $templateType, 'google', $wpObject );
$data['editFacebookSnippetUrl'] = $this->getEditSnippetUrl( $templateType, 'facebook', $wpObject );
$data['editTwitterSnippetUrl'] = $this->getEditSnippetUrl( $templateType, 'twitter', $wpObject );
}
}
if (
'archive' === $templateType ||
'author' === $templateType ||
'date' === $templateType ||
'search' === $templateType
) {
if ( is_a( $queriedObject, 'WP_User' ) ) {
$data['editObjectUrl'] = get_edit_user_link( $queriedObject->ID );
$data['editObjectBtnText'] = esc_html__( 'Edit User', 'all-in-one-seo-pack' );
}
$data['editGoogleSnippetUrl'] = $this->getEditSnippetUrl( $templateType, 'google' );
}
if ( 'dynamic_home' === $templateType ) {
$data['editGoogleSnippetUrl'] = $this->getEditSnippetUrl( $templateType, 'google' );
$data['editFacebookSnippetUrl'] = $this->getEditSnippetUrl( $templateType, 'facebook' );
$data['editTwitterSnippetUrl'] = $this->getEditSnippetUrl( $templateType, 'twitter' );
}
return $data;
}
/**
* 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 .= '';
return [
'id' => 'aioseo-seo-preview',
'parent' => 'aioseo-main',
'title' => $title,
'href' => '#',
];
}
}
Fatal error: Uncaught Error: Class 'AIOSEO\Plugin\Common\Standalone\SeoPreview' not found in /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Standalone/Standalone.php:115
Stack trace:
#0 /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(325): AIOSEO\Plugin\Common\Standalone\Standalone->__construct()
#1 /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(106): AIOSEO\Plugin\AIOSEO->load()
#2 /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(85): AIOSEO\Plugin\AIOSEO->init()
#3 /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(397): AIOSEO\Plugin\AIOSEO::instance()
#4 /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php(98): aioseo()
#5 /home/kordian1/domains/ostrabrama.pl/public_html/wp-settings.php(545): inc in /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Standalone/Standalone.php on line 115