UM_API

The Ultimate Member UM API class.

Defined (1)

The class is defined in the following location(s).

/um-init.php  
  1. class UM_API { 
  2.  
  3. public $is_filtering; 
  4.  
  5. public $addons = null; 
  6.  
  7. function __construct() { 
  8.  
  9. $this->is_filtering = 0; 
  10.  
  11. require_once um_path . 'core/um-short-functions.php'; 
  12.  
  13. if (is_admin()) { 
  14. require_once um_path . 'admin/core/um-admin-upgrade.php'; 
  15. require_once um_path . 'admin/um-admin-init.php'; 
  16.  
  17. add_action('init', array(&$this, 'init'), 0); 
  18.  
  19. add_action('init', array(&$this, 'load_addons')); 
  20.  
  21. $this->honeypot = 'request'; 
  22.  
  23. $this->available_languages = array( 
  24. 'en_US' => 'English (US)',  
  25. 'es_ES' => 'Espaol',  
  26. 'es_MX' => 'Espaol (Mxico)',  
  27. 'fr_FR' => 'Franais',  
  28. 'it_IT' => 'Italiano',  
  29. 'de_DE' => 'Deutsch',  
  30. 'nl_NL' => 'Nederlands',  
  31. 'pt_BR' => 'Portugus do Brasil',  
  32. 'fi_FI' => 'Suomi',  
  33. 'ro_RO' => 'Romn*',  
  34. 'da_DK' => 'Dansk',  
  35. 'sv_SE' => 'Svenska',  
  36. 'pl_PL' => 'Polski',  
  37. 'cs_CZ' => 'Czech',  
  38. 'el' => 'Greek',  
  39. 'id_ID' => 'Indonesian',  
  40. 'zh_CN' => '****',  
  41. 'ru_RU' => '*******',  
  42. 'tr_TR' => 'Trke',  
  43. 'fa_IR' => 'Farsi',  
  44. 'he_IL' => 'Hebrew',  
  45. 'ar' => '*******',  
  46. ); 
  47.  
  48. $this->addons['bp_avatar_transfer'] = array( 
  49. __('BuddyPress Avatar Transfer', 'ultimatemember'),  
  50. __('This add-on enables you to migrate your custom user photos from BuddyPress to use with Ultimate Member.', 'ultimatemember'),  
  51. ); 
  52.  
  53. $this->addons['gravatar_transfer'] = array( 
  54. __('Gravatar Transfer', 'ultimatemember'),  
  55. __('This add-on enables you to link gravatar photos to user accounts with their email address.', 'ultimatemember'),  
  56. ); 
  57.  
  58. $this->addons['generate_random_users'] = array( 
  59. __('Generate Dummies', 'ultimatemember'),  
  60. __('This add-on enables you to generate dummies.', 'ultimatemember'),  
  61. ); 
  62.  
  63. $this->addons['system_info'] = array( 
  64. __('System Info', 'ultimatemember'),  
  65. __('This add-on enables you to download system information file.', 'ultimatemember'),  
  66. ); 
  67.  
  68. // include widgets 
  69. require_once um_path . 'core/widgets/um-search-widget.php'; 
  70.  
  71. // init widgets 
  72. add_action( 'widgets_init', array(&$this, 'widgets_init' ) ); 
  73.  
  74.  
  75. /*** 
  76. *** @Load add-ons 
  77. */ 
  78. function load_addons() { 
  79. global $ultimatemember; 
  80. if ( isset( $ultimatemember->addons ) && is_array( $ultimatemember->addons ) ) { 
  81. foreach ( $ultimatemember->addons as $addon => $name ) { 
  82. if ( um_get_option('addon_' . $addon) == 1 ) { 
  83. if( file_exists( um_path . 'addons/' . $addon . '.php' ) ) { 
  84. include_once um_path . 'addons/' . $addon . '.php'; 
  85.  
  86. /*** 
  87. *** @Init 
  88. */ 
  89. function init() { 
  90.  
  91. ob_start(); 
  92.  
  93. require_once um_path . 'core/um-api.php'; 
  94. require_once um_path . 'core/um-rewrite.php'; 
  95. require_once um_path . 'core/um-setup.php'; 
  96. require_once um_path . 'core/um-uninstall.php'; 
  97. require_once um_path . 'core/um-fonticons.php'; 
  98. require_once um_path . 'core/um-login.php'; 
  99. require_once um_path . 'core/um-register.php'; 
  100. require_once um_path . 'core/um-enqueue.php'; 
  101. require_once um_path . 'core/um-shortcodes.php'; 
  102. require_once um_path . 'core/um-account.php'; 
  103. require_once um_path . 'core/um-password.php'; 
  104. require_once um_path . 'core/um-fields.php'; 
  105. require_once um_path . 'core/um-form.php'; 
  106. require_once um_path . 'core/um-user.php'; 
  107. require_once um_path . 'core/um-user-posts.php'; 
  108. require_once um_path . 'core/um-profile.php'; 
  109. require_once um_path . 'core/um-query.php'; 
  110. require_once um_path . 'core/um-datetime.php'; 
  111. require_once um_path . 'core/um-chart.php'; 
  112. require_once um_path . 'core/um-builtin.php'; 
  113. require_once um_path . 'core/um-files.php'; 
  114. require_once um_path . 'core/um-taxonomies.php'; 
  115. require_once um_path . 'core/um-validation.php'; 
  116. require_once um_path . 'core/um-navmenu.php'; 
  117. require_once um_path . 'core/um-menu.php'; 
  118. require_once um_path . 'core/um-access.php'; 
  119. require_once um_path . 'core/um-permalinks.php'; 
  120. require_once um_path . 'core/um-mail.php'; 
  121. require_once um_path . 'core/um-members.php'; 
  122. require_once um_path . 'core/um-logout.php'; 
  123. require_once um_path . 'core/um-modal.php'; 
  124. require_once um_path . 'core/um-cron.php'; 
  125. require_once um_path . 'core/um-tracking.php'; 
  126.  
  127. if ( ! class_exists('Mobile_Detect') ) { 
  128. require_once um_path . 'core/lib/mobiledetect/Mobile_Detect.php'; 
  129.  
  130. require_once um_path . 'core/um-actions-form.php'; 
  131. require_once um_path . 'core/um-actions-access.php'; 
  132. require_once um_path . 'core/um-actions-wpadmin.php'; 
  133. require_once um_path . 'core/um-actions-core.php'; 
  134. require_once um_path . 'core/um-actions-ajax.php'; 
  135. require_once um_path . 'core/um-actions-login.php'; 
  136. require_once um_path . 'core/um-actions-register.php'; 
  137. require_once um_path . 'core/um-actions-profile.php'; 
  138. require_once um_path . 'core/um-actions-account.php'; 
  139. require_once um_path . 'core/um-actions-password.php'; 
  140. require_once um_path . 'core/um-actions-members.php'; 
  141. require_once um_path . 'core/um-actions-global.php'; 
  142. require_once um_path . 'core/um-actions-user.php'; 
  143. require_once um_path . 'core/um-actions-save-profile.php'; 
  144. require_once um_path . 'core/um-actions-modal.php'; 
  145. require_once um_path . 'core/um-actions-misc.php'; 
  146.  
  147. require_once um_path . 'core/um-filters-language.php'; 
  148. require_once um_path . 'core/um-filters-login.php'; 
  149. require_once um_path . 'core/um-filters-fields.php'; 
  150. require_once um_path . 'core/um-filters-files.php'; 
  151. require_once um_path . 'core/um-filters-navmenu.php'; 
  152. require_once um_path . 'core/um-filters-avatars.php'; 
  153. require_once um_path . 'core/um-filters-arguments.php'; 
  154. require_once um_path . 'core/um-filters-user.php'; 
  155. require_once um_path . 'core/um-filters-members.php'; 
  156. require_once um_path . 'core/um-filters-profile.php'; 
  157. require_once um_path . 'core/um-filters-account.php'; 
  158. require_once um_path . 'core/um-filters-misc.php'; 
  159. require_once um_path . 'core/um-filters-addons.php'; 
  160. require_once um_path . 'core/um-filters-commenting.php'; 
  161.  
  162. /** initialize UM */ 
  163. $this->api = new UM_REST_API(); 
  164. $this->rewrite = new UM_Rewrite(); 
  165. $this->setup = new UM_Setup(); 
  166. $this->uninstall = new UM_Uninstall(); 
  167. $this->icons = new UM_FontIcons(); 
  168. $this->styles = new UM_Enqueue(); 
  169. $this->shortcodes = new UM_Shortcodes(); 
  170. $this->account = new UM_Account(); 
  171. $this->password = new UM_Password(); 
  172. $this->login = new UM_Login(); 
  173. $this->register = new UM_Register(); 
  174. $this->fields = new UM_Fields(); 
  175. $this->user = new UM_User(); 
  176. $this->user_posts = new UM_User_Posts(); 
  177. $this->profile = new UM_Profile(); 
  178. $this->datetime = new UM_DateTime(); 
  179. $this->chart = new UM_Chart(); 
  180. $this->builtin = new UM_Builtin(); 
  181. $this->form = new UM_Form(); 
  182. $this->files = new UM_Files(); 
  183. $this->taxonomies = new UM_Taxonomies(); 
  184. $this->validation = new UM_Validation(); 
  185. $this->query = new UM_Query(); 
  186. $this->menu = new UM_Menu(); 
  187. $this->access = new UM_Access(); 
  188. $this->permalinks = new UM_Permalinks(); 
  189. $this->mail = new UM_Mail(); 
  190. $this->members = new UM_Members(); 
  191. $this->logout = new UM_Logout(); 
  192. $this->modal = new UM_Modal(); 
  193. $this->cron = new UM_Cron(); 
  194. $this->tracking = new UM_Tracking(); 
  195.  
  196. $this->mobile = new Mobile_Detect; 
  197.  
  198. $this->options = get_option('um_options'); 
  199.  
  200. $language_domain = 'ultimatemember'; 
  201. $language_domain = apply_filters("um_language_textdomain", $language_domain ); 
  202.  
  203. $language_locale = ( get_locale() != '' ) ? get_locale() : 'en_US'; 
  204. $language_locale = apply_filters("um_language_locale", $language_locale ); 
  205.  
  206. $language_file = WP_LANG_DIR . '/plugins/' . $language_domain . '-' . $language_locale . '.mo'; 
  207. $language_file = apply_filters("um_language_file", $language_file ); 
  208.  
  209. load_textdomain( $language_domain, $language_file ); 
  210.  
  211. if ( ! get_option('show_avatars') ) { 
  212. update_option('show_avatars', 1); 
  213.  
  214.  
  215. function widgets_init() { 
  216. register_widget( 'um_search_widget' ); 
  217.