Tribe__Admin__Activation_Page::update_complete_actions( array $actions, string $plugin )
Filter the Default WordPress actions when updating the plugin to prevent users to be redirected if they have an specific intention of going back to the plugins page.
Contents
Parameters
- $actions
-
(array) (Required) The Array of links (html)
- $plugin
-
(string) (Required) Which plugins are been updated
Return
(array) The filtered Links
Source
File: src/Tribe/Admin/Activation_Page.php
public function update_complete_actions( $actions, $plugin ) { $plugins = array(); if ( ! empty( $_GET['plugins'] ) ) { $plugins = explode( ',', esc_attr( $_GET['plugins'] ) ); } if ( ! in_array( $this->args['plugin_path'], $plugins ) ) { return $actions; } if ( isset( $actions['plugins_page'] ) ) { $actions['plugins_page'] = '<a href="' . esc_url( self_admin_url( 'plugins.php?tribe-skip-welcome' ) ) . '" title="' . esc_attr__( 'Go to plugins page', 'tribe-common' ) . '" target="_parent">' . esc_html__( 'Return to Plugins page' ) . '</a>'; if ( ! current_user_can( 'activate_plugins' ) ) { unset( $actions['plugins_page'] ); } } if ( isset( $actions['updates_page'] ) ) { $actions['updates_page'] = '<a href="' . esc_url( self_admin_url( 'update-core.php?tribe-skip-welcome' ) ) . '" title="' . esc_attr__( 'Go to WordPress Updates page', 'tribe-common' ) . '" target="_parent">' . esc_html__( 'Return to WordPress Updates' ) . '</a>'; } return $actions; }