芝麻web文件管理V1.00
编辑当前文件:/home/ezdajrnh/test.ezed.pk/wp-content/plugins/wpforms-lite/src/Admin/Tools/Tools.php
is_tools_page() ) { return; } $this->init_view(); $this->hooks(); } /** * Check if we're on tools page. * * @since 1.6.6 * * @return bool */ private function is_tools_page() { // phpcs:ignore WordPress.Security.NonceVerification.Recommended $page = isset( $_GET['page'] ) ? sanitize_key( $_GET['page'] ) : ''; // Only load if we are actually on the settings page. return $page === self::SLUG; } /** * Init current view. * * @since 1.6.6 */ private function init_view() { $view_ids = array_keys( $this->get_views() ); // Determine the current active settings tab. // phpcs:ignore WordPress.Security.NonceVerification.Recommended $this->active_view_slug = ! empty( $_GET['view'] ) ? sanitize_key( $_GET['view'] ) : 'import'; // If the user tries to load an invalid view - fallback to the first available. if ( ! in_array( $this->active_view_slug, $view_ids, true ) && ! has_action( 'wpforms_tools_display_tab_' . $this->active_view_slug ) ) { $this->active_view_slug = reset( $view_ids ); } if ( isset( $this->views[ $this->active_view_slug ] ) ) { $this->view = $this->views[ $this->active_view_slug ]; $this->view->init(); } } /** * Get Views. * * @since 1.6.6 * * @return array */ public function get_views() { if ( empty( $this->views ) ) { $this->views = [ 'import' => new Views\Import(), 'importer' => new Views\Importer(), 'export' => new Views\Export(), 'entry-automation' => new Views\EntryAutomation(), 'system' => new Views\System(), 'action-scheduler' => new Views\ActionScheduler(), 'logs' => new Views\Logs(), 'wpcode' => new Views\CodeSnippets(), ]; } $this->views = apply_filters( 'wpforms_tools_views', $this->views ); return array_filter( $this->views, static function ( $view ) { return $view->check_capability(); } ); } /** * Register hooks. * * @since 1.6.6 */ public function hooks() { add_action( 'wpforms_admin_page', [ $this, 'output' ] ); // Hook for addons. do_action( 'wpforms_tools_init' ); } /** * Build the output for the Tools admin page. * * @since 1.6.6 */ public function output() { ?>
view && $this->view->show_nav() ) { echo '
'; foreach ( $this->views as $slug => $view ) { if ( $view->hide_from_nav() || ! $view->check_capability() ) { continue; } echo '
'; printf( '
%3$s
', esc_url( $view->get_link() ), sanitize_html_class( $this->active_view_slug === $slug ? 'active' : '' ), esc_html( $view->get_label() ) ); echo '
'; } echo '
'; } ?>
view ) { $this->view->display(); } else { do_action( 'wpforms_tools_display_tab_' . $this->active_view_slug ); } ?>