/**
  * initialize
  */
 public function initialize()
 {
     $contact_data_post_types = MW_WP_Form_Contact_Data_Setting::get_posts();
     if (!isset($_GET['post_type'])) {
         exit;
     }
     $this->post_type = $_GET['post_type'];
     if (!in_array($this->post_type, $contact_data_post_types)) {
         exit;
     }
     $CSV = new MW_WP_Form_CSV($this->post_type);
     $CSV->download();
     add_action('pre_get_posts', array($this, 'pre_get_posts'));
     add_action('admin_head', array($this, 'add_columns'));
     add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
     add_action('admin_print_styles', array($this, 'admin_print_styles'));
     add_action('in_admin_footer', array($this, 'add_csv_download_button'));
     add_filter('wp_count_posts', array($this, 'wp_count_posts'), 10, 2);
 }
Esempio n. 2
0
 /**
  * @group get_paged
  */
 public function test_get_paged_全件表示のときは1()
 {
     $_GET['paged'] = 2;
     $_POST['download-all'] = 'true';
     $this->assertEquals(1, $this->CSV->get_paged());
 }