he `buddypress` CPT is set in the list of post types to be included.
( ! empty( $args['include'] ) && in_array( 'buddypress', $args['include'], true ) ) ||
// 2. If the current request is for the sitemap.
( ! empty( aioseo()->sitemap->filename ) && 'general' === ( aioseo()->sitemap->type ?? '' ) ) ||
// 3. If we're on the Search Appearance screen.
( $currentScreen && strpos( $currentScreen->id, 'aioseo-search-appearance' ) !== false ) ||
// 4. If we're on the BuddyPress component front-end screen.
BuddyPressIntegration::isComponentPage()
) {
$postTypes = array_merge( $postTypes, $fakePostTypes );
}
}
/**
* Get edit links for the SEO Preview data.
*
* @since 4.7.6
*
* @return array
*/
public function getVueDataSeoPreview() {
$data = [
'editGoogleSnippetUrl' => '',
'editObjectBtnText' => '',
'editObjectUrl' => '',
];
list( $postType, $suffix ) = explode( '_', aioseo()->standalone->buddyPress->component->templateType );
$bpFakePostTypes = $this->getFakePostTypes();
$fakePostTypeData = array_values( wp_list_filter( $bpFakePostTypes, [ 'name' => $postType ] ) );
$fakePostTypeData = $fakePostTypeData[0] ?? [];
if ( ! $fakePostTypeData ) {
return $data;
}
if ( 'single' === $suffix ) {
switch ( $postType ) {
case 'bp-activity':
$componentId = aioseo()->standalone->buddyPress->component->activity['id'];
break;
case 'bp-group':
$componentId = aioseo()->standalone->buddyPress->component->group['id'];
break;
case 'bp-member':
$componentId = aioseo()->standalone->buddyPress->component->author->ID;
break;
default:
$componentId = 0;
}
}
$scrollToId = 'aioseo-card-' . $postType . ( 'single' === $suffix ? 'SA' : 'ArchiveArchives' );
$data['editGoogleSnippetUrl'] = 'single' === $suffix
? admin_url( 'admin.php?page=aioseo-search-appearance' ) . '#/content-types'
: admin_url( 'admin.php?page=aioseo-search-appearance' ) . '#/archives';
$data['editGoogleSnippetUrl'] = add_query_arg( [
'aioseo-scroll' => $scrollToId,
'aioseo-highlight' => $scrollToId
], $data['editGoogleSnippetUrl'] );
$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' ),
'single' === $suffix ? $fakePostTypeData['singular'] : $fakePostTypeData['label']
);
list( , $component ) = explode( '-', $postType );
$data['editObjectUrl'] = 'single' === $suffix
? BuddyPressIntegration::getComponentEditUrl( $component, $componentId ?? 0 )
: BuddyPressIntegration::callFunc( 'bp_get_admin_url', add_query_arg( 'page', 'bp-rewrites', 'admin.php' ) );
return $data;
}
/**
* Retrieves the BuddyPress fake post types.
*
* @since 4.7.6
*
* @return array The BuddyPress fake post types.
*/
public function getFakePostTypes() {
return [
'bp-activity' => [
'name' => 'bp-activity',
'label' => sprintf(
// Translators: 1 - The hard coded string 'BuddyPress'.
_x( 'Activities (%1$s)', 'BuddyPress', 'all-in-one-seo-pack' ),
'BuddyPress'
),
'singular' => 'Activity',
'icon' => 'dashicons-buddicons-buddypress-logo',
'hasExcerpt' => false,
'hasArchive' => true,
'hierarchical' => false,
'taxonomies' => [],
'slug' => 'bp-activity',
'buddyPress' => true,
'defaultTags' => [
'postTypes' => [
'title' => [
'bp_activity_action',
'separator_sa',
'site_title',
],
'description' => [
'bp_activity_content',
'separator_sa'
]
]
],
'defaultTitle' => '#bp_activity_action #separator_sa #site_title',
'defaultDescription' => '#bp_activity_content',
],
'bp-group' => [
'name' => 'bp-group',
'label' => sprintf(
// Translators: 1 - The hard coded string 'BuddyPress'.
_x( 'Groups (%1$s)', 'BuddyPress', 'all-in-one-seo-pack' ),
'BuddyPress'
),
'singular' => 'Group',
'icon' => 'dashicons-buddicons-buddypress-logo',
'hasExcerpt' => false,
'hasArchive' => true,
'hierarchical' => false,
'taxonomies' => [],
'slug' => 'bp-group',
'buddyPress' => true,
'defaultTags' => [
'postTypes' => [
'title' => [
'bp_group_name',
'separator_sa',
'site_title',
],
'description' => [
'bp_group_description',
'separator_sa'
]
]
],
'defaultTitle' => '#bp_group_name #separator_sa #site_title',
'defaultDescription' => '#bp_group_description',
],
'bp-member' => [
'name' => 'bp-member',
'label' => sprintf(
// Translators: 1 - The hard coded string 'BuddyPress'.
_x( 'Members (%1$s)', 'BuddyPress', 'all-in-one-seo-pack' ),
'BuddyPress'
),
'singular' => 'Member',
'icon' => 'dashicons-buddicons-buddypress-logo',
'hasExcerpt' => false,
'hasArchive' => true,
'hierarchical' => false,
'taxonomies' => [],
'slug' => 'bp-member',
'buddyPress' => true,
'defaultTags' => [
'postTypes' => [
'title' => [
'author_name',
'separator_sa',
'site_title',
],
'description' => [
'author_bio',
'separator_sa'
]
]
],
'defaultTitle' => '#author_name #separator_sa #site_title',
'defaultDescription' => '#author_bio',
],
];
}
}
Fatal error: Uncaught Error: Class 'AIOSEO\Plugin\Common\Standalone\BuddyPress\BuddyPress' not found in /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Standalone/Standalone.php:119
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(398): 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.ph in /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Standalone/Standalone.php on line 119