Undefined index: PostUrl on a “page” type post
-
I’m getting a PHP notice when I open a post of type “page”.
I see that
PostUrl
should be filled inget_post_event_data
if$post instanceof WP_Post
, but it isn’t because it’s a page.So
PostUrl
does not get set, but is being used inviewing_post
if the user is logged in and! empty( $post->post_title )
.PHP Notice: Undefined index: PostUrl in /htdocs/veikals/wp-content/plugins/wp-security-audit-log/classes/Sensors/Content.php on line 466 PHP Stack trace: PHP 1. {main}() /htdocs/veikals/index.php:0 PHP 2. require() /htdocs/veikals/index.php:17 PHP 3. require_once() /htdocs/veikals/wp-blog-header.php:19 PHP 4. include() /htdocs/veikals/wp-includes/template-loader.php:106 PHP 5. get_header($name = 'shop', $args = *uninitialized*) /htdocs/veikals/wp-content/plugins/woocommerce/templates/archive-product.php:20 PHP 6. locate_template($template_names = [0 => 'header-shop.php', 1 => 'header.php'], $load = TRUE, $require_once = TRUE, $args = []) /htdocs/veikals/wp-includes/general-template.php:48 PHP 7. load_template($_template_file = '/htdocs/veikals/wp-content/themes/twentytwentyone/header.php', $require_once = TRUE, $args = []) /htdocs/veikals/wp-includes/template.php:676 PHP 8. require_once() /htdocs/veikals/wp-includes/template.php:730 PHP 9. wp_head() /htdocs/veikals/wp-content/themes/twentytwentyone/header.php:20 PHP 10. do_action($tag = 'wp_head') /htdocs/veikals/wp-includes/general-template.php:3009 PHP 11. WP_Hook->do_action($args = [0 => '']) /htdocs/veikals/wp-includes/plugin.php:484 PHP 12. WP_Hook->apply_filters($value = '', $args = [0 => '']) /htdocs/veikals/wp-includes/class-wp-hook.php:316 PHP 13. WSAL_Sensors_Content->viewing_post('') /htdocs/veikals/wp-includes/class-wp-hook.php:292
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Undefined index: PostUrl on a “page” type post’ is closed to new replies.