Builder
3 days ago
I18n
3 days ago
Migrate-CPTUI
3 days ago
Migrate-Packages
3 days ago
Roles
3 days ago
Templates
3 days ago
Advanced-Content-Types.php
3 days ago
Advanced-Relationships.php
3 days ago
Helpers.php
3 days ago
Markdown.php
3 days ago
Pages.php
3 days ago
Table-Storage.php
3 days ago
Table-Storage.php
59 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 | |
| 31 | if ( ! pods_tableless() ) { |
| 32 | add_filter( 'pods_admin_setup_add_create_storage', '__return_true' ); |
| 33 | add_filter( 'pods_admin_setup_add_create_taxonomy_storage', '__return_true' ); |
| 34 | |
| 35 | add_filter( 'pods_admin_setup_add_extend_storage', '__return_true' ); |
| 36 | add_filter( 'pods_admin_setup_add_extend_taxonomy_storage', '__return_true' ); |
| 37 | |
| 38 | if ( ! function_exists( 'get_term_meta' ) ) { |
| 39 | add_filter( 'pods_admin_setup_add_extend_pod_type', array( $this, 'add_pod_type' ) ); |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Enable Taxonomy extending option in setup-add.php |
| 46 | * |
| 47 | * @param array $data Pod Type options |
| 48 | * |
| 49 | * @return array |
| 50 | */ |
| 51 | public function add_pod_type( $data ) { |
| 52 | |
| 53 | $data['taxonomy'] = __( 'Taxonomies (Categories, Tags, etc..)', 'pods' ); |
| 54 | |
| 55 | return $data; |
| 56 | } |
| 57 | |
| 58 | } |
| 59 |