/* ========================================================= * EXPORT PLUGINS + USERS CSV * ========================================================= */ /* --------------------------------------------------------- * PLUGINS PAGE - EXPORT BUTTON * --------------------------------------------------------- */ add_action( 'manage_plugins_extra_tablenav', 'rk_export_plugins_button' ); function rk_export_plugins_button( $which ) { if ( $which !== 'top' ) { return; } if ( ! current_user_can( 'activate_plugins' ) ) { return; } $url = wp_nonce_url( admin_url( 'admin-post.php?action=rk_export_plugins' ), 'rk_export_plugins' ); echo 'Export Plugins'; } /* --------------------------------------------------------- * USERS PAGE - EXPORT BUTTON * --------------------------------------------------------- */ add_action( 'restrict_manage_users', 'rk_export_users_button' ); function rk_export_users_button( $which ) { if ( $which !== 'top' ) { return; } if ( ! current_user_can( 'list_users' ) ) { return; } $url = wp_nonce_url( admin_url( 'admin-post.php?action=rk_export_users' ), 'rk_export_users' ); echo 'Export Users'; } /* ========================================================= * EXPORT PLUGINS * ========================================================= */ add_action( 'admin_post_rk_export_plugins', 'rk_do_export_plugins' ); function rk_do_export_plugins() { if ( ! current_user_can( 'activate_plugins' ) ) { wp_die( 'You do not have permission to export plugins.' ); } check_admin_referer( 'rk_export_plugins' ); if ( ! function_exists( 'get_plugins' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $plugins = get_plugins(); $active_plugins = (array) get_option( 'active_plugins', array() ); // Clean output buffer while ( ob_get_level() ) { ob_end_clean(); } $filename = 'plugins-export-' . date( 'Y-m-d-H-i-s' ) . '.csv'; header( 'Content-Type: text/csv; charset=utf-8' ); header( 'Content-Disposition: attachment; filename="' . $filename . '"' ); header( 'Pragma: no-cache' ); header( 'Expires: 0' ); $output = fopen( 'php://output', 'w' ); // Excel UTF-8 BOM fprintf( $output, chr(0xEF) . chr(0xBB) . chr(0xBF) ); // Headers fputcsv( $output, array( 'Plugin Name', 'Active / Deactivate Plugin' ) ); foreach ( $plugins as $plugin_file => $plugin_data ) { $plugin_name = isset( $plugin_data['Name'] ) ? $plugin_data['Name'] : ''; $status = in_array( $plugin_file, $active_plugins, true ) ? 'Active' : 'Deactivate'; fputcsv( $output, array( $plugin_name, $status ) ); } fclose( $output ); exit; } /* ========================================================= * EXPORT USERS * ========================================================= */ add_action( 'admin_post_rk_export_users', 'rk_do_export_users' ); function rk_do_export_users() { if ( ! current_user_can( 'list_users' ) ) { wp_die( 'You do not have permission to export users.' ); } check_admin_referer( 'rk_export_users' ); $users = get_users( array( 'orderby' => 'user_login', 'order' => 'ASC' ) ); // Clean output buffer while ( ob_get_level() ) { ob_end_clean(); } $filename = 'users-export-' . date( 'Y-m-d-H-i-s' ) . '.csv'; header( 'Content-Type: text/csv; charset=utf-8' ); header( 'Content-Disposition: attachment; filename="' . $filename . '"' ); header( 'Pragma: no-cache' ); header( 'Expires: 0' ); $output = fopen( 'php://output', 'w' ); // Excel UTF-8 BOM fprintf( $output, chr(0xEF) . chr(0xBB) . chr(0xBF) ); // Headers fputcsv( $output, array( 'Username', 'User Role' ) ); foreach ( $users as $user ) { $roles = array(); if ( ! empty( $user->roles ) ) { foreach ( $user->roles as $role ) { $wp_roles = wp_roles(); if ( isset( $wp_roles->roles[ $role ]['name'] ) ) { $roles[] = translate_user_role( $wp_roles->roles[ $role ]['name'] ); } else { $roles[] = $role; } } } $role_name = ! empty( $roles ) ? implode( ', ', $roles ) : 'No role'; fputcsv( $output, array( $user->user_login, $role_name ) ); } fclose( $output ); exit; } Harbor GO - Harbor.vet
  • Grow & Learn
    • For Students
      • On-Campus Student Representative
      • Monthly On-Campus Meetups
      • Externship
      • Harbor GO
    • For New Grads
      • Harbor GO
    • Explore Courses
      • Well-being Course
    • Explore Topics
  • Events
  • Log In
  • Grow & Learn
    • For Students
      • On-Campus Student Representative
      • Monthly On-Campus Meetups
      • Externship
      • Harbor GO
    • For New Grads
      • Harbor GO
    • Explore Courses
      • Well-being Course
    • Explore Topics
  • Events
  • Log In
JOIN
0 events found.

Harbor GO

  1. Events
  2. Harbor GO

Events

Notice
There were no results found.
Notice
There were no results found.

Events Search and Views Navigation

Event Views Navigation

  • List
  • Month
  • Day
Today
  • Previous Events
  • Today
  • Google Calendar
  • iCalendar
  • Outlook 365
  • Outlook Live
  • Export .ics file
  • Export Outlook .ics file
  • Home
  • Log In
  • Contact Us
  • Tell a Friend about Harbor Vet
  • Home
  • Log In
  • Contact Us
  • Tell a Friend about Harbor Vet

Explore Topics

  • Career Development
  • Diversity, Equity & Inclusion
  • Management and Leadership
  • Ownership
  • Well-being
  • Career Development
  • Diversity, Equity & Inclusion
  • Management and Leadership
  • Ownership
  • Well-being

STUDENT PROGRAMS

  • externSHIP
  • Harbor Business Experience
  • Harbor GO
  • Envoy
  • externSHIP
  • Harbor Business Experience
  • Harbor GO
  • Envoy

© Copyright Harbor.vet by Suveto. All rights reserved.

Facebook Linkedin Instagram
Harbor Communication Workshop

Report

There was a problem reporting this post.

Harassment or bullying behavior
Contains mature or sensitive content
Contains misleading or false information
Contains abusive or derogatory content
Contains spam, fake content or potential malware

Block Member?

Please confirm you want to block this member.

You will no longer be able to:

  • See blocked member's posts
  • Mention this member in posts
  • Invite this member to groups
  • Message this member
  • Add this member as a connection

Please note: This action will also remove this member from your connections and send a report to the site admin. Please allow a few minutes for this process to complete.

Report

You have already reported this .