Image_Helper::get_attachment_id_from_settings()publicYoast 1.0

Retrieves an attachment ID for an image uploaded in the settings.

Due to self::get_attachment_by_url returning 0 instead of false.
0 is also a possibility when no ID is available.

Метод класса: Image_Helper{}

Хуков нет.


int|true|false. The attachment id, or false or 0 if no ID is available.


$Image_Helper = new Image_Helper();
$Image_Helper->get_attachment_id_from_settings( $setting );
$setting(строка) (обязательный)
The setting the image is stored in.

Код Image_Helper::get_attachment_id_from_settings() Yoast 22.1

public function get_attachment_id_from_settings( $setting ) {
	return WPSEO_Image_Utils::get_attachment_id_from_settings( $setting );