bp_core_on_directory_page_delete( int $post_id )

Remove the entry from bp_pages when the corresponding WP page is deleted.


Description Description

Bails early on multisite installations when not viewing the root site.


Parameters Parameters

$post_id

(Required) Post ID.


Top ↑

Source Source

File: bp-core/bp-core-functions.php

function bp_core_on_directory_page_delete( $post_id ) {

	// Stop if we are not on the main BP root blog.
	if ( ! bp_is_root_blog() ) {
		return;
	}

	$page_ids       = bp_core_get_directory_page_ids( 'all' );
	$component_name = array_search( $post_id, $page_ids );

	if ( ! empty( $component_name ) ) {
		unset( $page_ids[ $component_name ] );
	}

	bp_core_update_directory_page_ids( $page_ids );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.