Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
PUM_Utils_Alerts::integration_alerts( array $alerts = array() )
Description Description
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Parameters Parameters
- $alerts
-
(Optional)
Default value: array()
Return Return
(array)
Source Source
File: classes/Utils/Alerts.php
public static function integration_alerts( $alerts = array() ) { $integrations = array( 'buddypress' => array( 'label' => __( 'BuddyPress', 'buddypress' ), 'learn_more_url' => 'https://wppopupmaker.com/works-with/buddypress/', 'conditions' => ! class_exists( 'PUM_BuddyPress' ) && ( function_exists( 'buddypress' ) || class_exists( 'BuddyPress' ) ), 'slug' => 'popup-maker-buddypress-integration', 'name' => 'Popup Maker - BuddyPress Integration', 'free' => true, ), ); foreach ( $integrations as $key => $integration ) { if ( $integration['conditions'] ) { $path = "{$integration['slug']}/{$integration['slug']}.php"; $plugin_data = file_exists( WP_PLUGIN_DIR . '/' . $path ) ? get_plugin_data( WP_PLUGIN_DIR . '/' . $path, false, false ) : false; $installed = $plugin_data && ! empty( $plugin_data['Name'] ) && $plugin_data['Name'] === $integration['name']; $text = $installed ? __( 'activate it now', 'popup-maker' ) : __( 'install it now', 'popup-maker' ); $url = $installed ? esc_url( wp_nonce_url( admin_url( 'plugins.php?action=activate&plugin=' . $path ), 'activate-plugin_' . $path ) ) : esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=popup-maker-buddypress-integration' ), 'install-plugin_popup-maker-buddypress-integration' ) ); $alerts[] = array( 'code' => $key . '_integration_available', 'message' => sprintf( __( '%sDid you know:%s Popup Maker has custom integrations with %s, %slearn more%s or %s%s%s!', 'popup-maker' ), '<strong>', '</strong>', $integration['label'], '<a href="' . $integration['learn_more_url'] . '" target="_blank">', '</a>', '<a href="' . $url . '">', $text, '</a>' ), 'dismissible' => true, 'global' => false, 'type' => $installed ? 'warning' : 'info', ); } } return $alerts; }
Expand full source code Collapse full source code View on Trac