# automatorwp/6.0.3/integrations/simple-feature-requests/includes/triggers/open-feature-request.php

AutomatorWP – No-Code Workflow Automation, Integration &amp; Webhooks Plugin, now with AI, version 6.0.3. 72 lines.

- Page: https://pluginprobe.com/plugins/automatorwp/6.0.3/code/integrations/simple-feature-requests/includes/triggers/open-feature-request.php
- Raw: https://pluginprobe.com/plugins/automatorwp/6.0.3/raw/integrations/simple-feature-requests/includes/triggers/open-feature-request.php
- Modified: 2026-09-30T10:02:50+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/automatorwp/6.0.3/code/integrations/simple-feature-requests/includes/triggers/open-feature-request.php#L10-L20`.

```php
<?php
/**
 * Open Feature Request
 *
 * @package     AutomatorWP\Integrations\Simple_Feature_Requests\Triggers\Open_Feature_Request
 * @author      AutomatorWP <contact@automatorwp.com>, Ruben Garcia <rubengcdev@gmail.com>
 * @since       1.0.0
 */
// Exit if accessed directly
if( !defined( 'ABSPATH' ) ) exit;

class AutomatorWP_Simple_Feature_Requests_Open_Feature_Request extends AutomatorWP_Integration_Trigger {

    public $integration = 'simple_feature_requests';
    public $trigger = 'simple_feature_requests_open_feature_request';

    /**
     * Register the trigger
     *
     * @since 1.0.0
     */
    public function register() {

        automatorwp_register_trigger( $this->trigger, array(
            'integration'       => $this->integration,
            'label'             => __( 'User opens a feature request', 'automatorwp' ),
            'select_option'     => __( 'User opens <strong>a feature request</strong>', 'automatorwp' ),
            /* translators: %1$s: Number of times. */
            'edit_label'        => sprintf( __( 'User opens a feature request %1$s time(s)', 'automatorwp' ), '{times}' ),
            'log_label'         => __( 'User opens a feature request', 'automatorwp' ),
            'action'            => 'sfr_post_created',
            'function'          => array( $this, 'listener' ),
            'priority'          => 10,
            'accepted_args'     => 1,
            'options'           => array(
                'times' => automatorwp_utilities_times_option(),
            ),
            'tags' => array_merge(
                automatorwp_utilities_post_tags( __( 'Feature request', 'automatorwp' ) ),
                automatorwp_utilities_times_tag()
            )
        ) );

    }

    /**
     * Trigger listener
     *
     * @since 1.0.0
     *
     * @param int $inserted_id
     */
    public function listener( $inserted_id ) {

        $user_id = get_current_user_id();

        // Bail if user is not logged in
        if( $user_id === 0 ) {
            return;
        }

        automatorwp_trigger_event( array(
            'trigger'   => $this->trigger,
            'user_id'   => $user_id,
            'post_id'   => $inserted_id,
        ) );

    }

}

new AutomatorWP_Simple_Feature_Requests_Open_Feature_Request();
```
