Plugin Directory


Ignore:
Timestamp:
11/03/2026 11:52:29 PM (17 hours ago)
Author:
meumouse
Message:

Release 2.7.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • joinotify/trunk/admin/src/Core/Workflow_Processor.php

    r3771693 r3782814  
    825825     *
    826826     * @since 2.0.0
     827     * @version 2.7.0
    827828     * @param array $trigger_data | Trigger node ({id,type,data})
    828829     * @param array $payload | Runtime trigger payload
    … …  
    869870                        $match = false;
    870871                    }
     872                }
     873            } elseif ( isset( $payload['hook'] ) && $payload['hook'] === 'woocommerce_created_customer' ) {
     874                $trigger_source = isset( $settings['account_source'] ) && is_scalar( $settings['account_source'] )
     875                    ? (string) $settings['account_source']
     876                    : '';
     877
     878                // "none" or an unset filter => an account created anywhere
     879                if ( '' !== $trigger_source && 'none' !== $trigger_source && $trigger_source !== (string) ( $payload['account_source'] ?? '' ) ) {
     880                    $match = false;
    871881                }
    872882            }
    … …  
    11931203    /**
    11941204     * Handle with workflow actions
    1195      * 
     1205     *
    11961206     * @since 1.0.0
    1197      * @version 1.4.7
     1207     * @version 2.7.0
    11981208     * @param array $action | Workflow actions array
    11991209     * @param int $post_id | Post ID
    … …  
    12711281                }
    12721282            }
     1283        }
     1284
     1285        /**
     1286         * Actions whose handler writes onto the shared payload.
     1287         *
     1288         * The handlers in the map below capture a copy of the payload, so whatever they store
     1289         * is lost. A handler listed here receives the payload by reference instead, so a value
     1290         * it stores (an HTTP response, for example) reaches the actions that run after it and
     1291         * travels with the payload through delays. Same arguments and return as the map below,
     1292         * with the payload taken by reference.
     1293         *
     1294         * @since 2.7.0
     1295         * @param array $payload_actions Map of action_slug => callable( array $action_data, array $action, int $post_id, array &$event_data ): bool.
     1296         * @param array $action          Full action item ({id,type,data,children}).
     1297         * @param int   $post_id         Workflow post ID.
     1298         */
     1299        $payload_actions = apply_filters( 'Joinotify/Workflow_Processor/Payload_Actions', array(), $action, $post_id );
     1300
     1301        if ( is_array( $payload_actions ) && isset( $payload_actions[ $action_data['action'] ] ) && is_callable( $payload_actions[ $action_data['action'] ] ) ) {
     1302            $handler = $payload_actions[ $action_data['action'] ];
     1303
     1304            // called directly, not through call_user_func(), so the reference holds
     1305            return (bool) $handler( $action_data, $action, $post_id, $event_data );
    12731306        }
    12741307
Note: See TracChangeset for help on using the changeset viewer.