BP_Members_Admin::signups_admin_load()
Set up the signups admin page.
Description
Loaded before the page is rendered, this function does all initial setup, including: processing form requests, registering contextual help, and setting up screen options.
Source
File: bp-members/classes/class-bp-members-admin.php
1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 | public function signups_admin_load() { global $bp_members_signup_list_table ; // Build redirection URL. $redirect_to = remove_query_arg( array ( 'action' , 'error' , 'updated' , 'activated' , 'notactivated' , 'deleted' , 'notdeleted' , 'resent' , 'notresent' , 'do_delete' , 'do_resend' , 'do_activate' , '_wpnonce' , 'signup_ids' ), $_SERVER [ 'REQUEST_URI' ] ); $doaction = bp_admin_list_table_current_bulk_action(); /** * Fires at the start of the signups admin load. * * @since BuddyPress 2.0.0 * * @param string $doaction Current bulk action being processed. * @param array $_REQUEST Current $_REQUEST global. */ do_action( 'bp_signups_admin_load' , $doaction , $_REQUEST ); /** * Filters the allowed actions for use in the user signups admin page. * * @since BuddyPress 2.0.0 * * @param array $value Array of allowed actions to use. */ $allowed_actions = apply_filters( 'bp_signups_admin_allowed_actions' , array ( 'do_delete' , 'do_activate' , 'do_resend' ) ); // Prepare the display of the Community Profile screen. if ( ! in_array( $doaction , $allowed_actions ) || ( -1 == $doaction ) ) { if ( is_network_admin() ) { $bp_members_signup_list_table = self::get_list_table_class( 'BP_Members_MS_List_Table' , 'ms-users' ); } else { $bp_members_signup_list_table = self::get_list_table_class( 'BP_Members_List_Table' , 'users' ); } // The per_page screen option. add_screen_option( 'per_page' , array ( 'label' => __( 'Pending Accounts' , 'buddyboss' ) ) ); get_current_screen()->add_help_tab( array ( 'id' => 'bp-signups-overview' , 'title' => __( 'Overview' , 'buddyboss' ), 'content' => '<p>' . __( 'This is the administration screen for pending accounts on your site.' , 'buddyboss' ) . '</p>' . '<p>' . __( 'From the screen options, you can customize the displayed columns and the pagination of this screen.' , 'buddyboss' ) . '</p>' . '<p>' . __( 'You can reorder the list of your pending accounts by clicking on the Username, Email or Registered column headers.' , 'buddyboss' ) . '</p>' . '<p>' . __( 'Using the search form, you can find pending accounts more easily. The Username and Email fields will be included in the search.' , 'buddyboss' ) . '</p>' ) ); get_current_screen()->add_help_tab( array ( 'id' => 'bp-signups-actions' , 'title' => __( 'Actions' , 'buddyboss' ), 'content' => '<p>' . __( 'Hovering over a row in the pending accounts list will display action links that allow you to manage pending accounts. You can perform the following actions:' , 'buddyboss' ) . '</p>' . '<ul><li>' . __( '"Email" takes you to the confirmation screen before being able to send the activation link to the desired pending account. You can only send the activation email once per day.' , 'buddyboss' ) . '</li>' . '<li>' . __( '"Delete" allows you to delete a pending account from your site. You will be asked to confirm this deletion.' , 'buddyboss' ) . '</li></ul>' . '<p>' . __( 'By clicking on a Username you will be able to activate a pending account from the confirmation screen.' , 'buddyboss' ) . '</p>' . '<p>' . __( 'Bulk actions allow you to perform these 3 actions for the selected rows.' , 'buddyboss' ) . '</p>' ) ); // Help panel - sidebar links. get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' , 'buddyboss' ) . '</strong></p>' . '<p>' . __( '<a href="https://www.buddyboss.com/resources/">Documentation</a>' , 'buddyboss' ) . '</p>' ); // Add accessible hidden headings and text for the Pending Users screen. get_current_screen()->set_screen_reader_content( array ( /* translators: accessibility text */ 'heading_views' => __( 'Filter users list' , 'buddyboss' ), /* translators: accessibility text */ 'heading_pagination' => __( 'Pending users list navigation' , 'buddyboss' ), /* translators: accessibility text */ 'heading_list' => __( 'Pending users list' , 'buddyboss' ), ) ); } else { if ( ! empty ( $_REQUEST [ 'signup_ids' ] ) ) { $signups = wp_parse_id_list( $_REQUEST [ 'signup_ids' ] ); } // Handle resent activation links. if ( 'do_resend' == $doaction ) { // Nonce check. check_admin_referer( 'signups_resend' ); $resent = BP_Signup::resend( $signups ); if ( empty ( $resent ) ) { $redirect_to = add_query_arg( 'error' , $doaction , $redirect_to ); } else { $query_arg = array ( 'updated' => 'resent' ); if ( ! empty ( $resent [ 'resent' ] ) ) { $query_arg [ 'resent' ] = count ( $resent [ 'resent' ] ); } if ( ! empty ( $resent [ 'errors' ] ) ) { $query_arg [ 'notsent' ] = count ( $resent [ 'errors' ] ); set_transient( '_bp_admin_signups_errors' , $resent [ 'errors' ], 30 ); } $redirect_to = add_query_arg( $query_arg , $redirect_to ); } bp_core_redirect( $redirect_to ); // Handle activated accounts. } elseif ( 'do_activate' == $doaction ) { // Nonce check. check_admin_referer( 'signups_activate' ); $activated = BP_Signup::activate( $signups ); if ( empty ( $activated ) ) { $redirect_to = add_query_arg( 'error' , $doaction , $redirect_to ); } else { $query_arg = array ( 'updated' => 'activated' ); if ( ! empty ( $activated [ 'activated' ] ) ) { $query_arg [ 'activated' ] = count ( $activated [ 'activated' ] ); } if ( ! empty ( $activated [ 'errors' ] ) ) { $query_arg [ 'notactivated' ] = count ( $activated [ 'errors' ] ); set_transient( '_bp_admin_signups_errors' , $activated [ 'errors' ], 30 ); } $redirect_to = add_query_arg( $query_arg , $redirect_to ); } bp_core_redirect( $redirect_to ); // Handle sign-ups delete. } elseif ( 'do_delete' == $doaction ) { // Nonce check. check_admin_referer( 'signups_delete' ); $deleted = BP_Signup:: delete ( $signups ); if ( empty ( $deleted ) ) { $redirect_to = add_query_arg( 'error' , $doaction , $redirect_to ); } else { $query_arg = array ( 'updated' => 'deleted' ); if ( ! empty ( $deleted [ 'deleted' ] ) ) { $query_arg [ 'deleted' ] = count ( $deleted [ 'deleted' ] ); } if ( ! empty ( $deleted [ 'errors' ] ) ) { $query_arg [ 'notdeleted' ] = count ( $deleted [ 'errors' ] ); set_transient( '_bp_admin_signups_errors' , $deleted [ 'errors' ], 30 ); } $redirect_to = add_query_arg( $query_arg , $redirect_to ); } bp_core_redirect( $redirect_to ); // Plugins can update other stuff from here. } else { $this ->redirect = $redirect_to ; /** * Fires at end of signups admin load if doaction does not match any actions. * * @since BuddyPress 2.0.0 * * @param string $doaction Current bulk action being processed. * @param array $_REQUEST Current $_REQUEST global. * @param string $redirect Determined redirect url to send user to. */ do_action( 'bp_members_admin_update_signups' , $doaction , $_REQUEST , $this ->redirect ); bp_core_redirect( $this ->redirect ); } } } |
Changelog
Version | Description |
---|---|
BuddyPress 2.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.