AnsPress_Category::load_options()

Description #

Register Categories options

Source #

File: addons/free/category.php

	public static function load_options() {
		$opt = ap_opt();
		$form = array(
			'fields' => array(
				'form_category_orderby' => array(
					'label'             => __( 'Ask form category order', 'anspress-question-answer' ),
					'description'       => __( 'Set how you want to order categories in form.', 'anspress-question-answer' ),
					'type'              => 'select',
					'options'			=> array(
						'ID' 			       => __( 'ID', 'anspress-question-answer' ),
						'name' 			     => __( 'Name', 'anspress-question-answer' ),
						'slug' 			     => __( 'Slug', 'anspress-question-answer' ),
						'count' 		     => __( 'Count', 'anspress-question-answer' ),
						'term_group' 	   => __( 'Group', 'anspress-question-answer' ),
					),
					'value' => $opt['form_category_orderby'],
				),
				'categories_page_orderby' => array(
					'label'             => __( 'Categries page order by', 'anspress-question-answer' ),
					'description'       => __( 'Set how you want to order categories in categories page.', 'anspress-question-answer' ),
					'type'              => 'select',
					'options'			=> array(
						'ID' 			       => __( 'ID', 'anspress-question-answer' ),
						'name' 			     => __( 'Name', 'anspress-question-answer' ),
						'slug' 			     => __( 'Slug', 'anspress-question-answer' ),
						'count' 		     => __( 'Count', 'anspress-question-answer' ),
						'term_group' 	   => __( 'Group', 'anspress-question-answer' ),
					),
					'value' => $opt['categories_page_orderby'],
				),
				'categories_page_order' => array(
					'label'             => __( 'Categries page order', 'anspress-question-answer' ),
					'description'       => __( 'Set how you want to order categories in categories page.', 'anspress-question-answer' ),
					'type'              => 'select',
					'options'			=> array(
						'ASC' 			=> __( 'Ascending', 'anspress-question-answer' ),
						'DESC' 			=> __( 'Descending', 'anspress-question-answer' ),
					),
					'value' => $opt['categories_page_order'],
				),
				'category_page_slug' => array(
					'label' 	      => __( 'Category page slug', 'anspress-question-answer' ),
					'desc' 		      => __( 'Slug for category page', 'anspress-question-answer' ),
					'value'         => $opt['category_page_slug'],
				),
				'categories_per_page' => array(
					'label'   => __( 'Category per page', 'anspress-question-answer' ),
					'desc'    => __( 'Category to show per page', 'anspress-question-answer' ),
					'subtype' => 'number',
					'value'   => $opt['categories_per_page'],
				),
				'categories_image_height' => array(
					'label' 	  => __( 'Categories image height', 'anspress-question-answer' ),
					'desc' 		  => __( 'Image height in categories page', 'anspress-question-answer' ),
					'subtype' 	=> 'number',
					'value'     => $opt['categories_image_height'],
				),
			)
		);

		return $form;
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment