WordPress at a glance
function is not described

stick_post() WP 2.7.0

Make a post sticky.

Sticky posts should be displayed at the top of the front page.

Hooks in function
Return

Nothing (null).

Usage

stick_post( $post_id );
$post_id(int) (required)
Post ID.

Code of stick post: wp-includes/post.php WP 5.2.2

<?php
function stick_post( $post_id ) {
	$stickies = get_option( 'sticky_posts' );

	if ( ! is_array( $stickies ) ) {
		$stickies = array( $post_id );
	}

	if ( ! in_array( $post_id, $stickies ) ) {
		$stickies[] = $post_id;
	}

	$updated = update_option( 'sticky_posts', $stickies );

	if ( $updated ) {
		/**
		 * Fires once a post has been added to the sticky list.
		 *
		 * @since 4.6.0
		 *
		 * @param int $post_id ID of the post that was stuck.
		 */
		do_action( 'post_stuck', $post_id );
	}
}