BDB_USERPOSTREPLYFORUM::load_options()

Contents


Return Return

(array[])


Source Source

File: src/integrations/buddyboss/triggers/bdb-userpostreplyforum.php

	public function load_options() {
		$args = array(
			'post_type'      => 'forum',
			'posts_per_page' => 999,
			'orderby'        => 'title',
			'order'          => 'ASC',
			'post_status'    => array( 'publish', 'private' ),
		);
		$options               = Automator()->helpers->recipe->options->wp_query( $args, true, __( 'Any forum', 'uncanny-automator' ) );
		$forum_relevant_tokens = array(
			'BDBFORUMS'     => __( 'Forum title', 'uncanny-automator' ),
			'BDBFORUMS_ID'  => __( 'Forum ID', 'uncanny-automator' ),
			'BDBFORUMS_URL' => __( 'Forum URL', 'uncanny-automator' ),
		);
		$relevant_tokens = array(
			$this->trigger_meta          => __( 'Topic title', 'uncanny-automator' ),
			$this->trigger_meta . '_ID'  => __( 'Topic ID', 'uncanny-automator' ),
			$this->trigger_meta . '_URL' => __( 'Topic URL', 'uncanny-automator' ),
		);
		return Automator()->utilities->keep_order_of_options(
			array(
				'options_group' => array(
					$this->trigger_meta => array(
						Automator()->helpers->recipe->field->select_field_ajax(
							'BDBFORUMS',
							__( 'Forum', 'uncanny-automator' ),
							$options,
							'',
							'',
							false,
							true,
							array(
								'target_field' => $this->trigger_meta,
								'endpoint'     => 'select_topic_from_forum_BDBTOPICREPLY',
							),
							$forum_relevant_tokens
						),
						Automator()->helpers->recipe->field->select_field( $this->trigger_meta, __( 'Topic', 'uncanny-automator' ), array(), false, false, false, $relevant_tokens ),
					),
				),
			)
		);
	}