'' . __( 'Integrations', 'popup-maker' ) . '',
'settings' => '' . __( 'Settings', 'popup-maker' ) . '',
]
);
// TODO Rewrite this to take full advantage of our polyglot detection code in Alerts for translation requests.
if ( substr( get_locale(), 0, 2 ) !== 'en' ) {
$plugin_action_links = array_merge( [ 'translate' => '' . __( 'Translate', 'popup-maker' ) . '' ], $plugin_action_links );
}
foreach ( $plugin_action_links as $link ) {
array_unshift( $links, $link );
}
}
return $links;
}
/**
* Post-installation
*
* Runs just after plugin installation and exposes the
* popmake_after_install hook.
*
* @since 1.0
* @return void
*/
public static function after_install() {
if ( ! is_admin() ) {
return;
}
$already_installed = get_option( '_pum_installed' );
// Exit if not in admin or the transient doesn't exist
if ( false === $already_installed ) {
do_action( 'pum_after_install' );
update_option( '_pum_installed', true );
}
}
/**
* Cleans the UI area within our admin pages
*
* @since 1.12
*/
public static function clean_ui() {
// Elementor shows an upsell notice for their popup builder targeting only our admin area. This removes that.
if ( class_exists( 'Elementor\Plugin' ) && class_exists( 'Elementor\Core\Admin\Admin' ) && pum_is_admin_page() ) {
$instance = Elementor\Plugin::instance();
if ( isset( $instance->admin ) && is_a( $instance->admin, '\Elementor\Core\Admin\Admin' ) && method_exists( $instance->admin, 'get_component' ) ) {
$notices = $instance->admin->get_component( 'admin-notices' );
if ( false !== $notices && is_a( $notices, '\Elementor\Core\Admin\Admin_Notices' ) ) {
remove_action( 'admin_notices', [ $notices, 'admin_notices' ], 20 );
}
}
}
}
}