403Webshell
Server IP : 172.67.147.195  /  Your IP : 216.73.216.142
Web Server : Apache/2
System : Linux hosting8537.lvs 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : mienphi ( 1014)
PHP Version : 8.2.14
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/mienphi/public_html/wp-content/plugins/buddypress/bp-messages/actions/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/mienphi/public_html/wp-content/plugins/buddypress/bp-messages/actions/bulk-manage-star.php
<?php
/**
 * Messages: Bulk-manage star action handler.
 *
 * @package BuddyPress
 * @subpackage MessageActions
 * @since 3.0.0
 */

/**
 * Bulk manage handler to set the star status for multiple messages.
 *
 * @since 2.3.0
 */
function bp_messages_star_bulk_manage_handler() {
	if ( empty( $_POST['messages_bulk_nonce' ] ) ) {
		return;
	}

	// Check the nonce.
	if ( ! wp_verify_nonce( $_POST['messages_bulk_nonce'], 'messages_bulk_nonce' ) ) {
		return;
	}

	// Check capability.
	if ( ! is_user_logged_in() || ! bp_core_can_edit_settings() ) {
		return;
	}

	$action  = ! empty( $_POST['messages_bulk_action'] ) ? $_POST['messages_bulk_action'] : '';
	$threads = ! empty( $_POST['message_ids'] ) ? $_POST['message_ids'] : '';
	$threads = wp_parse_id_list( $threads );

	// Bail if action doesn't match our star actions or no IDs.
	if ( false === in_array( $action, array( 'star', 'unstar' ), true ) || empty( $threads ) ) {
		return;
	}

	// It's star time!
	switch ( $action ) {
		case 'star' :
			$count = count( $threads );

			// If we're starring a thread, we only star the first message in the thread.
			foreach ( $threads as $thread ) {
				$thread = new BP_Messages_thread( $thread );
				$mids = wp_list_pluck( $thread->messages, 'id' );

				bp_messages_star_set_action( array(
					'action'     => 'star',
					'message_id' => $mids[0],
				) );
			}

			/* translators: %s: number of starred messages */
			bp_core_add_message( sprintf( _n( '%s message was successfully starred', '%s messages were successfully starred', $count, 'buddypress' ), $count ) );
			break;

		case 'unstar' :
			$count = count( $threads );

			foreach ( $threads as $thread ) {
				bp_messages_star_set_action( array(
					'action'    => 'unstar',
					'thread_id' => $thread,
					'bulk'      => true
				) );
			}

			/* translators: %s: number of unstarred messages */
			bp_core_add_message( sprintf( _n( '%s message was successfully unstarred', '%s messages were successfully unstarred', $count, 'buddypress' ), $count ) );
			break;
	}

	$path_chunks = bp_members_get_path_chunks( array( bp_get_messages_slug(), bp_current_action() ) );
	$redirect    = bp_displayed_user_url( $path_chunks );

	// Redirect back to message box.
	bp_core_redirect( $redirect );
	die();
}
add_action( 'bp_actions', 'bp_messages_star_bulk_manage_handler', 5 );

Youez - 2016 - github.com/yon3zu
LinuXploit