get current page wordpress code example
Example 1: get page name wp
$slug = basename(get_permalink());
//or
$wp_query->queried_object->post_name
Example 2: wordpress get page
get_post( int|WP_Post|null $post = null, string $output = OBJECT, string $filter = 'raw' )
#from: https://developer.wordpress.org/reference/functions/get_post/