Answers for "wordpress get current page id in functions php"

PHP
0

get_the_id wordpress

function get_the_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    $post = get_post();
    return ! empty( $post ) ? $post->ID : false;
}
Posted by: Guest on October-26-2020
0

get the current page id in wordpress

$page_id = get_queried_object_id();
Posted by: Guest on September-03-2020

Code answers related to "wordpress get current page id in functions php"

Browse Popular Code Answers by Language