AnsPress_Admin::options_uac_reading()

Description #

Register UAC reading options.

Changelog #

VersionDescription
4.1.0Introduced.

Source #

File: admin/anspress-admin.php

	public static function options_uac_reading() {
		$opt = ap_opt();

		$form = array(
			'fields' => array(
				'read_question_per' => array(
					'label'   => __( 'Who can read question?', 'anspress-question-answer' ),
					'desc'    => __( 'Set who can view or read a question.', 'anspress-question-answer' ),
					'type'    => 'select',
					'value'   => $opt['read_question_per'],
					'options' => array(
						'anyone'    => __( 'Anyone, including non-loggedin', 'anspress-question-answer' ),
						'logged_in' => __( 'Only logged in', 'anspress-question-answer' ),
						'have_cap'  => __( 'Only user having ap_read_question capability', 'anspress-question-answer' ),
					),
				),
				'read_answer_per'   => array(
					'label'   => __( 'Who can read answers?', 'anspress-question-answer' ),
					'desc'    => __( 'Set who can view or read a answer.', 'anspress-question-answer' ),
					'type'    => 'select',
					'value'   => $opt['read_answer_per'],
					'options' => array(
						'anyone'    => __( 'Anyone, including non-loggedin', 'anspress-question-answer' ),
						'logged_in' => __( 'Only logged in', 'anspress-question-answer' ),
						'have_cap'  => __( 'Only user having ap_read_answer capability', 'anspress-question-answer' ),
					),
				),
				'read_comment_per'  => array(
					'label'   => __( 'Who can read comment?', 'anspress-question-answer' ),
					'desc'    => __( 'Set who can view or read a comment.', 'anspress-question-answer' ),
					'type'    => 'select',
					'value'   => $opt['read_comment_per'],
					'options' => array(
						'anyone'    => __( 'Anyone, including non-loggedin', 'anspress-question-answer' ),
						'logged_in' => __( 'Only logged in', 'anspress-question-answer' ),
						'have_cap'  => __( 'Only user having ap_read_comment capability', 'anspress-question-answer' ),
					),
				),
			),
		);

		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