# hostinger/trunk/includes/Mcp/Handlers/WebsitePageUpdated.php

Hostinger Tools, version trunk. 36 lines.

- Page: https://pluginprobe.com/plugins/hostinger/trunk/code/includes/Mcp/Handlers/WebsitePageUpdated.php
- Raw: https://pluginprobe.com/plugins/hostinger/trunk/raw/includes/Mcp/Handlers/WebsitePageUpdated.php
- Modified: 2025-07-22T10:37:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/hostinger/trunk/code/includes/Mcp/Handlers/WebsitePageUpdated.php#L10-L20`.

```php
<?php

namespace Hostinger\Mcp\Handlers;

defined( 'ABSPATH' ) || exit;

class WebsitePageUpdated extends EventHandler {

    const ALLOWED_POST_TYPES = array( 'post', 'product', 'page' );

    public function send( array $args = array() ): void {
        if ( ! $this->can_send( $args ) ) {
            return;
        }

        $post        = get_post( $args['post_id'] );
        $args['url'] = get_permalink( $post );
        $this->send_to_proxy( $args );
    }

    public function can_send( array $args = array() ): bool {
        $post_id = $args['post_id'] ?? false;

        if ( ! $post_id ) {
            return false;
        }

        $post = get_post( $post_id );
        if ( ! $post ) {
            return false;
        }

        return parent::can_send( $args ) && in_array( $post->post_type, self::ALLOWED_POST_TYPES, true );
    }
}

```
