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
Table-Storage.php
54 lines
| 1 | <?php |
| 2 | |
| 3 | // Don't load directly. |
| 4 | if ( ! defined( 'ABSPATH' ) ) { |
| 5 | die( '-1' ); |
| 6 | } |
| 7 | |
| 8 | /** |
| 9 | * Name: Table Storage |
| 10 | * |
| 11 | * Description: Enable a custom database table for your custom fields on Post Types, Media, Taxonomies, Users, and Comments. |
| 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_Table_Storage' ) ) { |
| 24 | return; |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * Class Pods_Table_Storage |
| 29 | */ |
| 30 | class Pods_Table_Storage 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_storage', '__return_true' ); |
| 47 | add_filter( 'pods_admin_setup_add_create_taxonomy_storage', '__return_true' ); |
| 48 | |
| 49 | add_filter( 'pods_admin_setup_add_extend_storage', '__return_true' ); |
| 50 | add_filter( 'pods_admin_setup_add_extend_taxonomy_storage', '__return_true' ); |
| 51 | } |
| 52 | |
| 53 | } |
| 54 |