Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

WP_USERCREATESPOST::get_recipes_post_type_matches( $recipes,  $required_post_type,  $post )

Identify recipes that match criteria based on post type


Parameters Parameters

$recipes

(Required)

$required_post_type

(Required)

$post

(Required)


Top ↑

Return Return

(array)


Source Source

File: src/integrations/wp/triggers/wp-usercreatespost.php

	private function get_recipes_post_type_matches( $recipes, $required_post_type, $post ) {
		$matched = array();
		foreach ( $recipes as $recipe_id => $recipe ) {
			foreach ( $recipe['triggers'] as $trigger ) {
				$trigger_id = absint( $trigger['ID'] );
				// required post type
				if ( '0' === (string) $required_post_type[ $recipe_id ][ $trigger_id ] || (string) $post->post_type === (string) $required_post_type[ $recipe_id ][ $trigger_id ] ) {
					$matched[]                           = $recipe_id;
					$this->matched_recipes[ $recipe_id ] = $recipe;
				}
			}
		}
		return array_unique( $matched );
	}