WP_Customize_Selective_Refresh::handle_error() WordPress Method

The WP_Customize_Selective_Refresh::handle_error() method is used to handle errors when a selective refresh request fails. This method is called when the WP_Customize_Selective_Refresh::selective_refresh() method returns false.

WP_Customize_Selective_Refresh::handle_error( int $errno, string $errstr, string $errfile = null, int $errline = null ) #

Handles PHP errors triggered during rendering the partials.


Description

These errors will be relayed back to the client in the Ajax response.


Top ↑

Parameters

$errno

(int)(Required)Error number.

$errstr

(string)(Required)Error string.

$errfile

(string)(Optional)Error file.

Default value: null

$errline

(int)(Optional)Error line.

Default value: null


Top ↑

Return

(true) Always true.


Top ↑

Source

File: wp-includes/customize/class-wp-customize-selective-refresh.php

	public function handle_error( $errno, $errstr, $errfile = null, $errline = null ) {
		$this->triggered_errors[] = array(
			'partial'      => $this->current_partial_id,
			'error_number' => $errno,
			'error_string' => $errstr,
			'error_file'   => $errfile,
			'error_line'   => $errline,
		);
		return true;
	}

Top ↑

Changelog

Changelog
VersionDescription
4.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.