compatibility
4 months ago
access.php
4 months ago
classes.php
4 months ago
compatibility.php
4 months ago
data.php
4 months ago
forms.php
4 months ago
general.php
4 months ago
media.php
4 months ago
compatibility.php
42 lines
| 1 | <?php |
| 2 | |
| 3 | // Don't load directly. |
| 4 | if ( ! defined( 'ABSPATH' ) ) { |
| 5 | die( '-1' ); |
| 6 | } |
| 7 | |
| 8 | /** |
| 9 | * @package Pods\Global\Functions\Compatibility |
| 10 | */ |
| 11 | |
| 12 | // Add backwards compatibility for tribe() for old add-ons that may still call it. |
| 13 | if ( |
| 14 | ! function_exists( 'tribe_is_not_min_php_version' ) |
| 15 | && ! function_exists( 'tribe' ) |
| 16 | && ! doing_action( 'activate_plugin' ) |
| 17 | && ! did_action( 'activate_plugin' ) |
| 18 | && ( |
| 19 | ! defined( 'WP_SANDBOX_SCRAPING' ) |
| 20 | || ! WP_SANDBOX_SCRAPING |
| 21 | ) |
| 22 | && 'activate' !== pods_v( 'action' ) |
| 23 | ) { |
| 24 | /** |
| 25 | * Compatibility function for Pods 2.x add-ons that may still call tribe(). |
| 26 | * |
| 27 | * @since 3.0.5 |
| 28 | * |
| 29 | * @param string|null $slug_or_class Either the slug of a binding previously registered using singleton or |
| 30 | * register or the full class name that should be automagically created or |
| 31 | * `null` to get the container instance itself. |
| 32 | * |
| 33 | * @return mixed|null The pods_container() object or null if the function does not exist yet. |
| 34 | */ |
| 35 | // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound |
| 36 | function tribe( $slug_or_class = null ) { |
| 37 | _doing_it_wrong( 'tribe', 'tribe() is no longer included in Pods Framework directly. Please use pods_container() instead.', '3.0' ); |
| 38 | |
| 39 | return pods_container( $slug_or_class ); |
| 40 | } |
| 41 | } |
| 42 |