Ameliabooking_Helpers::get_services_categories()

Get amelia services categories.


Return Return

(array) The amelia services categories.


Source Source

File: src/integrations/ameliabooking/helpers/ameliabooking-helpers.php

	public function get_services_categories() {

		global $wpdb;

		$items = array();

		$categories = $wpdb->get_results(
			$wpdb->prepare(
				"SELECT id, name FROM {$wpdb->prefix}amelia_categories WHERE status = %s ORDER BY name ASC LIMIT 100",
				'visible'
			),
			OBJECT
		);

		if ( ! empty( $categories ) ) {
			foreach ( $categories as $category ) {
				$items[ $category->id ] = $category->name;
			}
		}

		return $items;

	}