AnsPress_Admin::options_user_activity()

Description #

Register AnsPress user’s activity options.

Changelog #

VersionDescription
4.1.8Introduced.

Source #

File: admin/anspress-admin.php

	public static function options_user_activity() {
		global $wp_roles;
		$opt = ap_opt();

		$roles = array();
		foreach ( $wp_roles->roles as $key => $role ) {
			$roles[ $key ] = $role['name'];
		}

		$form = array(
			'fields' => array(
				'activity_exclude_roles' => array(
					'label'   => __( 'Select the roles to exclude in activity feed.', 'anspress-question-answer' ),
					'desc'    => __( 'Selected role\'s activities will be excluded in site activity feed.', 'anspress-question-answer' ),
					'type'    => 'checkbox',
					'value'   => $opt['activity_exclude_roles'],
					'options' => $roles,
				),
			),
		);

		/**
		 * Filter to user's activity option form.
		 *
		 * @param array $form Form arguments.
		 * @since 4.1.8
		 */
		return apply_filters( 'ap_options_form_user_activity', $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