WPSEO_Primary_Term_Admin::get_current_id()
Gets the current post ID.
Метод класса: WPSEO_Primary_Term_Admin{}
Хуков нет.
Возвращает
int
. The post ID.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_current_id();
Код WPSEO_Primary_Term_Admin::get_current_id() WPSEO Primary Term Admin::get current id Yoast 23.5
protected function get_current_id() { // phpcs:ignore WordPress.Security.NonceVerification.Recommended,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are not processing form information, We are casting to an integer. $post_id = isset( $_GET['post'] ) && is_string( $_GET['post'] ) ? (int) wp_unslash( $_GET['post'] ) : 0; if ( $post_id === 0 && isset( $GLOBALS['post_ID'] ) ) { $post_id = (int) $GLOBALS['post_ID']; } return $post_id; }