Conditions | 3 |
Paths | 3 |
Total Lines | 33 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | protected function actions_section(){ |
||
26 | $html = ''; |
||
27 | |||
28 | // Loop through every post type available on the site |
||
29 | $post_types = get_post_types( array( 'public' => true ), 'objects' ); |
||
30 | |||
31 | foreach ( $post_types as $post_type ) : |
||
32 | |||
33 | $skipped_cpts = array( |
||
34 | 'attachment' |
||
35 | ); |
||
36 | |||
37 | // Skip banned cpts |
||
38 | if ( in_array( $post_type->name, $skipped_cpts ) ){ |
||
39 | continue; |
||
40 | } |
||
41 | |||
42 | $html .= "<div class='test-data-cpt'>"; |
||
43 | |||
44 | $html .= "<h3>"; |
||
45 | |||
46 | $html .= "<span class='label'>" . $post_type->labels->name . "</span>"; |
||
47 | $html .= $this->build_button( 'create', $post_type->name, __( 'Create Test Data', 'otm-test-content' ) ); |
||
48 | $html .= $this->build_button( 'delete', $post_type->name, __( 'Delete Test Data', 'otm-test-content' ) ); |
||
49 | |||
50 | $html .= "</h3>"; |
||
51 | |||
52 | $html .= "</div>"; |
||
53 | |||
54 | endforeach; |
||
55 | |||
56 | return $html; |
||
57 | } |
||
58 | |||
60 |