WordPress как на ладони
Хостинг, VPS/VDS и отдельные сервера только на SSD дисках. 7 дней бесплатного тестирования.
событие не описано

the_post хук-событие . WP 2.8.0

Fires once the post data has been setup.

Использование

add_action( 'the_post', 'action_function_name_8961', 10, 2 );
function action_function_name_8961( $post, $this ){
	// action...
}
$post(WP_Post)
The Post object (passed by reference).
$this(WP_Query)
The current Query object (passed by reference).

Заметки

  • C версии 4.1.0 Introduced $this parameter.

Где используется хук

WP_Query::setup_postdata() остальные хуки:

Код хука

Фрагмент из: wp-includes/class-wp-query.php VER 4.9.8
...
			}
			$multipage = 1;
		} else {
	 		$multipage = 0;
	 	}

		/**
		 * Fires once the post data has been setup.
		 *
		 * @since 2.8.0
		 * @since 4.1.0 Introduced `$this` parameter.
		 *
		 * @param WP_Post  $post The Post object (passed by reference).
		 * @param WP_Query $this The current Query object (passed by reference).
		 */
		do_action_ref_array( 'the_post', array( &$post, &$this ) );

		return true;
	}
	/**
	 * After looping through a nested query, this function
	 * restores the $post global to the current post in this query.
	 *
	 * @since 3.7.0
	 *
	 * @global WP_Post $post
	 */
	public function reset_postdata() {
		if ( ! empty( $this->post ) ) {
			$GLOBALS['post'] = $this->post;
			$this->setup_postdata( $this->post );
...