data, $standalone_form->post_status ); } return $locations; } /** * Get form location metas. * * @param array $locations Locations. * * @since 1.7.4 * * @return array */ private function get_form_location_metas( $locations ) { $metas = []; foreach ( $locations as $location ) { if ( empty( $location['form_id'] ) ) { continue; } $metas[ $location['form_id'] ][] = $location; } return $metas; } /** * Log message to WPForms logger and standard debug.log file. * * @since 1.7.4 * * @param string $message The error message that should be logged. * * @noinspection ForgottenDebugOutputInspection * @noinspection PhpUndefinedConstantInspection */ private function log( $message ) { if ( defined( 'WPFORMS_DEBUG' ) && WPFORMS_DEBUG ) { // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log error_log( $message ); wpforms_log( 'Forms Locator', $message, [ 'type' => 'log' ] ); } } }