当前位置: 首页>>代码示例>>PHP>>正文


PHP MS_Model_Member::get_members方法代码示例

本文整理汇总了PHP中MS_Model_Member::get_members方法的典型用法代码示例。如果您正苦于以下问题:PHP MS_Model_Member::get_members方法的具体用法?PHP MS_Model_Member::get_members怎么用?PHP MS_Model_Member::get_members使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MS_Model_Member的用法示例。


在下文中一共展示了MS_Model_Member::get_members方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: prepare_items

 /**
  * Prepare list items.
  *
  * @since  1.0.0
  */
 public function prepare_items()
 {
     $this->_column_headers = array($this->get_columns(), array(), $this->get_sortable_columns());
     $per_page = apply_filters('ms_helper_listtable_member_items_per_page', self::DEFAULT_PAGE_SIZE);
     $current_page = $this->get_pagenum();
     $args = array('number' => $per_page, 'offset' => ($current_page - 1) * $per_page);
     // Prepare the filter details.
     $args = $this->prepare_query_args($args);
     $total_items = MS_Model_Member::get_members_count($args);
     $this->items = MS_Model_Member::get_members($args);
     $this->set_pagination_args(array('total_items' => $total_items, 'per_page' => $per_page));
     do_action('ms_helper_listtable_member_prepare_items', $args, $this);
 }
开发者ID:jsandlin85,项目名称:SkylineSports,代码行数:18,代码来源:class-ms-helper-listtable-member.php

示例2: process

 /**
  * Main entry point: Handles the export action.
  *
  * This task will exit the current request as the result will be a download
  * and no HTML page that is displayed.
  *
  * @since  1.0.0
  */
 public function process()
 {
     $data = (object) array();
     $data->source_key = self::KEY;
     $data->source = 'Membership2';
     $data->plugin_version = MS_PLUGIN_VERSION;
     $data->export_time = date('Y-m-d H:i');
     $data->notes = array(__('Exported data:', MS_TEXT_DOMAIN), __('- Memberships (without protection rules)', MS_TEXT_DOMAIN), __('- Members (including Stripe/Authorize payment settings)', MS_TEXT_DOMAIN), __('- Subscriptions (link between Members and Memberships)', MS_TEXT_DOMAIN), __('- Invoices', MS_TEXT_DOMAIN));
     $data->memberships = array();
     // Export the base membership (i.e. the Membership2 settings)
     $membership = MS_Model_Membership::get_base();
     $data->memberships[] = $this->export_membership($membership->id);
     // Export all memberships.
     $memberships = MS_Model_Membership::get_memberships(array('post_parent' => 0));
     foreach ($memberships as $membership) {
         $data->memberships[] = $this->export_membership($membership->id);
     }
     // Export the members.
     $members = MS_Model_Member::get_members();
     $data->members = array();
     foreach ($members as $member) {
         if (!$member->is_member) {
             continue;
         }
         $data->members[] = $this->export_member($member->id);
     }
     // Export plugin settings.
     $obj = array();
     $data->settings = $this->export_settings();
     // Export Coupons.
     $data->coupons = array();
     lib2()->net->file_download(json_encode($data), 'membership2-export.json');
 }
开发者ID:klgrimley,项目名称:mzf,代码行数:41,代码来源:class-ms-model-import-export.php

示例3: cleanup_db

 /**
  * Completely whipe all Membership data from Database.
  *
  * Note: This function is not used currently...
  *
  * @since  1.0.0
  */
 private static function cleanup_db()
 {
     global $wpdb;
     $sql = array();
     $trash_ids = array();
     // Delete membership meta-data from users.
     $users = MS_Model_Member::get_members();
     foreach ($users as $user) {
         $user->delete_all_membership_usermeta();
         $user->save();
     }
     // Determine IDs of Membership Pages.
     $page_types = MS_Model_Pages::get_page_types();
     foreach ($page_types as $type => $name) {
         $page_id = MS_Model_Pages::get_setting($type);
         $trash_ids[] = $page_id;
     }
     /**
      * Delete all plugin settings.
      * Settings are saved by classes that extend MS_Model_option
      */
     foreach (MS_Model_Gateway::get_gateways() as $option) {
         $option->delete();
     }
     MS_Factory::load('MS_Model_Addon')->delete();
     MS_Factory::load('MS_Model_Pages')->delete();
     MS_Factory::load('MS_Model_Settings')->delete();
     /**
      * Delete transient data
      * Transient data is saved by classed that extend MS_Model_Transient
      */
     MS_Factory::load('MS_Model_Simulate')->delete();
     /**
      * Delete all plugin content.
      * Content is saved by classes that extend MS_Model_CustomPostType
      */
     $ms_posttypes = array(MS_Model_Communication::get_post_type(), MS_Model_Event::get_post_type(), MS_Model_Invoice::get_post_type(), MS_Model_Transactionlog::get_post_type(), MS_Model_Membership::get_post_type(), MS_Model_Relationship::get_post_type(), MS_Addon_Coupon_Model::get_post_type(), MS_Addon_Invitation_Model::get_post_type());
     foreach ($ms_posttypes as $type) {
         $sql[] = $wpdb->prepare("DELETE FROM {$wpdb->posts} WHERE post_type = %s;", $type);
     }
     // Remove orphaned post-metadata.
     $sql[] = "\n\t\tDELETE FROM {$wpdb->postmeta}\n\t\tWHERE NOT EXISTS (\n\t\t\tSELECT 1 FROM {$wpdb->posts} tmp WHERE tmp.ID = post_id\n\t\t);\n\t\t";
     // Clear all WP transient cache.
     $sql[] = "\n\t\tDELETE FROM {$wpdb->options}\n\t\tWHERE option_name LIKE '_transient_%';\n\t\t";
     foreach ($sql as $s) {
         $wpdb->query($s);
     }
     // Move Membership pages to trash.
     foreach ($trash_ids as $id) {
         wp_delete_post($id, true);
     }
     // Clear all data from WP Object cache.
     wp_cache_flush();
     // Redirect to the main page.
     wp_safe_redirect(MS_Controller_Plugin::get_admin_url());
     exit;
 }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:64,代码来源:class-ms-model-upgrade.php


注:本文中的MS_Model_Member::get_members方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。