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
2 years ago
Advanced-Content-Types.php
3 years ago
Advanced-Relationships.php
3 years ago
Markdown.php
2 years ago
Pages.php
3 years ago
Table-Storage.php
4 years ago
Table-Storage.php
48 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Name: Table Storage |
| 4 | * |
| 5 | * Description: Enable a custom database table for your custom fields on Post Types, Media, Taxonomies, Users, and Comments. |
| 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_Table_Storage' ) ) { |
| 18 | return; |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * Class Pods_Table_Storage |
| 23 | */ |
| 24 | class Pods_Table_Storage 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_storage', '__return_true' ); |
| 41 | add_filter( 'pods_admin_setup_add_create_taxonomy_storage', '__return_true' ); |
| 42 | |
| 43 | add_filter( 'pods_admin_setup_add_extend_storage', '__return_true' ); |
| 44 | add_filter( 'pods_admin_setup_add_extend_taxonomy_storage', '__return_true' ); |
| 45 | } |
| 46 | |
| 47 | } |
| 48 |