I18n
1 day ago
Migrate-ACF
1 day ago
Migrate-CPTUI
1 day ago
Migrate-PHP
1 day ago
Migrate-Packages
1 day ago
Roles
1 day ago
Templates
1 day ago
Advanced-Content-Types.php
1 day ago
Advanced-Relationships.php
1 day ago
Markdown.php
1 day ago
Pages.php
1 day ago
Table-Storage.php
1 day ago
Advanced-Content-Types.php
63 lines
| 1 | <?php |
| 2 | |
| 3 | // Don't load directly. |
| 4 | if ( ! defined( 'ABSPATH' ) ) { |
| 5 | die( '-1' ); |
| 6 | } |
| 7 | |
| 8 | /** |
| 9 | * Name: Advanced Content Types |
| 10 | * |
| 11 | * 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. |
| 12 | * |
| 13 | * Version: 2.3 |
| 14 | * |
| 15 | * Category: Advanced |
| 16 | * |
| 17 | * Tableless Mode: No |
| 18 | * |
| 19 | * @package Pods\Components |
| 20 | * @subpackage Advanced Content Types |
| 21 | */ |
| 22 | |
| 23 | if ( class_exists( 'Pods_Advanced_Content_Types' ) ) { |
| 24 | return; |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * Class Pods_Advanced_Content_Types |
| 29 | */ |
| 30 | class Pods_Advanced_Content_Types extends PodsComponent { |
| 31 | |
| 32 | /** |
| 33 | * {@inheritdoc} |
| 34 | */ |
| 35 | public function init() { |
| 36 | // Bypass if Pods is in types-only mode. |
| 37 | if ( pods_is_types_only() ) { |
| 38 | return; |
| 39 | } |
| 40 | |
| 41 | // Bypass if Pods is in tableless mode. |
| 42 | if ( pods_tableless() ) { |
| 43 | return; |
| 44 | } |
| 45 | |
| 46 | add_filter( 'pods_admin_setup_add_create_pod_type', array( $this, 'add_pod_type' ) ); |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Enable Advanced Content Type option in setup-add.php |
| 51 | * |
| 52 | * @param array $data Pod Type options |
| 53 | * |
| 54 | * @return array |
| 55 | */ |
| 56 | public function add_pod_type( $data ) { |
| 57 | $data['pod'] = __( 'Advanced Content Type (separate from WP, blank slate, in its own table)', 'pods' ); |
| 58 | |
| 59 | return $data; |
| 60 | } |
| 61 | |
| 62 | } |
| 63 |