I18n
4 months ago
Migrate-ACF
4 months ago
Migrate-CPTUI
4 months ago
Migrate-PHP
4 months ago
Migrate-Packages
4 months ago
Roles
4 months ago
Templates
4 months ago
Advanced-Content-Types.php
4 months ago
Advanced-Relationships.php
4 months ago
Markdown.php
4 months ago
Pages.php
4 months ago
Table-Storage.php
4 months 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 |