If page parent equals ID (number)?

I have an if statement that is checking the ID of the page, using the following:

<?php if ( is_page(10) ) { ?>

How can I do something like if page parent is 10?

Related posts

Leave a Reply

3 comments

  1. Get the current page object, then get its parent ID:

    global $wp_query;
    
    $currentPage = get_page($wp_query->get_queried_object_id());
    
    if (is_page($currentPage['post_parent'])) {
    
    }