Function Reference: geodir_buddypress_record_geodir_post_types

Summary

register activity post type.

Package

GeoDirectory_BuddyPress_Integration

Parameters

$post_types
(array) (required) post_types of the listing.

Default: None

Return Values

(array)
  • Post types array.

Change Log

Since: 1.0.0

Source File

geodir_buddypress_record_geodir_post_types() is located in geodir_buddypress/includes/gdbuddypress_functions.php [Line: 951]

Source Code

function geodir_buddypress_record_geodir_post_types( $post_types = array() ) {
	$post_types = is_array( $post_types ) && !empty( $post_types ) ? $post_types : array();
	
	$listing_post_types = get_option( 'geodir_buddypress_activity_listing' );
	if ( !empty( $listing_post_types ) ) {
		$gd_post_types = geodir_get_posttypes( 'array' );
		
		foreach ( $listing_post_types as $post_type ) {
			if ( array_key_exists( $post_type, $gd_post_types ) ) {
				$post_types[] = $post_type;
			}
		}
	}
	
	return $post_types;
}