Skip to content

Commit

Permalink
Add support for setting origin ID with Charitable.
Browse files Browse the repository at this point in the history
  • Loading branch information
rvdsteege committed May 10, 2023
1 parent 4eeb83a commit 3eccc8b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,12 @@ public static function complement_payment( Payment $payment ) {
$referer = \wp_get_referer();

if ( null === $origin_id && false !== $referer ) {
$referer_host = \wp_parse_url( $referer, \PHP_URL_HOST );

if ( null === $referer_host ) {
$referer = \home_url( $referer );
}

$post_id = \url_to_postid( $referer );

if ( $post_id > 0 ) {
Expand Down

0 comments on commit 3eccc8b

Please sign in to comment.