id ) || ( '5ftf_pledge_page_5ftf_contributor_report' == $current_page->id ) ) { wp_enqueue_style( '5ftf-admin' ); } } } /** * Render results and download button. */ function render_company_report_page() { $status = sanitize_title( $_GET['status'] ); $pledge_limit = 500; if ( ! in_array( $status, array( 'draft', '5ftf-deactivated', 'publish' ) ) ) { $status = 'all'; } $pledges = get_posts( array( 'post_type' => '5ftf_pledge', 'post_status' => $status, 'posts_per_page' => $pledge_limit, // set to avoid unexpected memory overuse. 'orderby' => 'post_title', 'order' => 'ASC', ) ); // Add visible warning on page if we hit the upper limit of the query. if ( count( $pledges ) === $pledge_limit ) { echo '
WARNING: pledge limit reached, check the code query.
'; } ?>Total: Status: All Draft Publish Deactivated
Company | Status | Total Hours | Contributors | Usernames | Team(s) | URL | Pledge URL | Pledge created | Pledge updated | |
---|---|---|---|---|---|---|---|---|---|---|
' . esc_html( $pledge->post_title ) . ' | '; echo '' . esc_html( $pledge->post_status ) . ' | '; echo '' . esc_html( $hours ) . ' | '; echo '' . esc_html( $contributors ) . ' | '; echo '' . esc_html( $usernames ) . ' | '; echo '' . esc_html( $teams ) . ' | '; echo '' . esc_html( $company_url ) . ' | '; echo '' . esc_html( $pledge->guid ) . ' | '; echo '' . esc_html( $email ). ' | '; echo '' . esc_html( $date_created ) . ' | '; echo '' . esc_html( $date_modified ) . ' | '; echo '
Total contributors: ' . esc_html( $all_contributors ) . '
'; // Sets a transient to avoid double data lookup for export, might need to adjust timeout to longer. set_transient( 'wporg_5ftf_company_report_' . $status, $export_data, 60 ); } /** * Render results and download button. */ function render_contributor_report_page() { $status = sanitize_title( $_GET['status'] ?? '' ); $contributor_limit = 1500; if ( ! in_array( $status, array( 'pending', 'trash', 'publish' ) ) ) { $status = 'all'; } $contributors = get_posts( array( 'post_type' => '5ftf_contributor', 'post_status' => $status, 'posts_per_page' => $contributor_limit, // set to avoid unexpected memory overuse. 'orderby' => 'post_title', 'order' => 'ASC', ) ); // Add visible warning on page if we hit the upper limit of the query. if ( count( $contributors ) === $contributor_limit ) { echo 'WARNING: Contributor limit reached, check the code query.
'; } $all_contributor_data = XProfile\get_all_xprofile_contributors_indexed(); ?>Total: Status: All Pending Publish Trash
User id | Username | Company | Hours | Teams | Full Name | Last activity (log in or tracked activity) | Status | ||
---|---|---|---|---|---|---|---|---|---|
' . absint( $user_id ) . ' | '; echo '' . esc_html( $c->post_title ) . ' | '; echo '' . esc_html( $pledge_company_title ) . ' | '; echo '' . esc_html( $xprofile['hours_per_week'] ) . ' | '; echo '' . esc_html( $teams ) . ' | '; echo '' . esc_html( $user_display_name ) . ' | '; echo '' . esc_html( $user_email ) . ' | '; // Either output last activity or last login. if ( $last_activity > $last_login ) { echo '' . esc_html( $last_activity ) . ' | '; } else { echo '' . esc_html( $last_login ) . ' | '; } echo '' . esc_html( $c->post_status ) . ' | '; echo '