-
-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move tribe() compatibility into a file that loads during plugins_load…
…ed and add additional checks to prevent loading during plugin activation
- Loading branch information
1 parent
cbad523
commit b825eee
Showing
3 changed files
with
37 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
/** | ||
* @package Pods\Global\Functions\Compatibility | ||
*/ | ||
|
||
// Add backwards compatibility for tribe() for old add-ons that may still call it. | ||
if ( | ||
! function_exists( 'tribe_is_not_min_php_version' ) | ||
&& ! function_exists( 'tribe' ) | ||
&& ! doing_action( 'activate_plugin' ) | ||
&& ! did_action( 'activate_plugin' ) | ||
&& ( | ||
! defined( 'WP_SANDBOX_SCRAPING' ) | ||
|| ! WP_SANDBOX_SCRAPING | ||
) | ||
&& 'activate' !== pods_v( 'action' ) | ||
) { | ||
/** | ||
* Compatibility function for Pods 2.x add-ons that may still call tribe(). | ||
* | ||
* @since 3.0.5 | ||
* | ||
* @param string|null $slug_or_class Either the slug of a binding previously registered using singleton or | ||
* register or the full class name that should be automagically created or | ||
* `null` to get the container instance itself. | ||
* | ||
* @return mixed|null The pods_container() object or null if the function does not exist yet. | ||
*/ | ||
function tribe( $slug_or_class = null ) { | ||
_doing_it_wrong( 'tribe', 'tribe() is no longer included in Pods Framework directly. Please use pods_container() instead.', '3.0' ); | ||
|
||
return pods_container( $slug_or_class ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters