Uoa_Helpers::get_recipes( string $label = null, string $option_code = 'UOARECIPE',  $any_option = false )


Parameters Parameters

$label

(string) (Optional)

Default value: null

$option_code

(string) (Optional)

Default value: 'UOARECIPE'


Top ↑

Return Return

(mixed)


Source Source

File: src/integrations/uncanny-automator/helpers/uoa-helpers.php

	public function get_recipes( $label = null, $option_code = 'UOARECIPE', $any_option = false ) {
		if ( ! $this->load_options ) {


			return Automator()->helpers->recipe->build_default_options_array( $label, $option_code );
		}

		if ( ! $label ) {
			$label = esc_attr__( 'Recipe', 'uncanny-automator' );
		}

		// post query arguments.
		$args = [
			'post_type'      => 'uo-recipe',
			'posts_per_page' => 999,
			'orderby'        => 'title',
			'order'          => 'ASC',
			'post_status'    => 'publish',

		];


		$options = Automator()->helpers->recipe->options->wp_query( $args, $any_option, esc_attr__( 'Any recipe', 'uncanny-automator' ) );

		$option = [
			'option_code'              => $option_code,
			'label'                    => $label,
			'input_type'               => 'select',
			'required'                 => true,
			'options'                  => $options,
			'custom_value_description' => esc_attr__( 'Recipe slug', 'uncanny-automator' ),
		];

		return apply_filters( 'uap_option_get_recipes', $option );
	}