Builder
3 years ago
I18n
3 years ago
Migrate-ACF
3 years ago
Migrate-CPTUI
3 years ago
Migrate-Packages
2 years ago
Roles
4 years ago
Templates
1 year ago
Advanced-Content-Types.php
3 years ago
Advanced-Relationships.php
3 years ago
Markdown.php
2 years ago
Pages.php
1 year ago
Table-Storage.php
4 years ago
Advanced-Content-Types.php
57 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Name: Advanced Content Types |
| 4 | * |
| 5 | * Description: A content type that exists outside of the WordPress post and postmeta table and uses custom tables instead. You most likely don't need these and we strongly recommend that you use Custom Post Types or Custom Taxonomies instead. FOR ADVANCED USERS ONLY. |
| 6 | * |
| 7 | * Version: 2.3 |
| 8 | * |
| 9 | * Category: Advanced |
| 10 | * |
| 11 | * Tableless Mode: No |
| 12 | * |
| 13 | * @package Pods\Components |
| 14 | * @subpackage Advanced Content Types |
| 15 | */ |
| 16 | |
| 17 | if ( class_exists( 'Pods_Advanced_Content_Types' ) ) { |
| 18 | return; |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * Class Pods_Advanced_Content_Types |
| 23 | */ |
| 24 | class Pods_Advanced_Content_Types extends PodsComponent { |
| 25 | |
| 26 | /** |
| 27 | * {@inheritdoc} |
| 28 | */ |
| 29 | public function init() { |
| 30 | // Bypass if Pods is in types-only mode. |
| 31 | if ( pods_is_types_only() ) { |
| 32 | return; |
| 33 | } |
| 34 | |
| 35 | // Bypass if Pods is in tableless mode. |
| 36 | if ( pods_tableless() ) { |
| 37 | return; |
| 38 | } |
| 39 | |
| 40 | add_filter( 'pods_admin_setup_add_create_pod_type', array( $this, 'add_pod_type' ) ); |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Enable Advanced Content Type option in setup-add.php |
| 45 | * |
| 46 | * @param array $data Pod Type options |
| 47 | * |
| 48 | * @return array |
| 49 | */ |
| 50 | public function add_pod_type( $data ) { |
| 51 | $data['pod'] = __( 'Advanced Content Type (separate from WP, blank slate, in its own table)', 'pods' ); |
| 52 | |
| 53 | return $data; |
| 54 | } |
| 55 | |
| 56 | } |
| 57 |