Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • I see the code to override the lead_source, but how do you apply the filter to override a custom field? We have a custom field called Details. How can I use filters to target that field? From the docs I only see:

    // Alter Lead Source
    add_filter( 'salesforce_w2l_lead_source', 'salesforce_w2l_lead_source_example', 10, 2 );
    function salesforce_w2l_lead_source_example(  $lead_source, $form_id ){
    
        if( $form_id == 1 )
            return 'Example Lead Source for Form #1 on page id #'.get_the_id();
    
        return $lead_source;
    
    }

    Thanks worthingtech!! This is exactly what I was looking for too.

    This really helped me today too! Just all of a sudden one of my client’s sites broke with this error. I just had to check for the array first:

    $whichPage = get_field(‘which_page?’);
    if( ($whichPage) && in_array(….

    Thanks everyone!!

    Thread Starter cbush57

    (@cbush57)

    Sure thing.

    Basically we have a product shelf that members can add stuff to. When a product is added to a member’s shelf, it shows on their personal shelf, but also on the public community shelf.

    The issue is that when a member adds a product, it is stamped with a publish date and shows appropriately on their shelf according to the order they added it. However if a second member adds that same product, then the publish date gets renewed and it changes the order of the first members shelf.

    What we want to do, is basically have an additional field attached to a product that is a member specific sequence number. The problem is that right now, since the shelf shares the same data as the community shelf, every member’s sequence code gets added as a value under the “Sequence” field. For example, a “Book 1” can have a member sequence value of “123_01, 143_14, 154_02, etc” where the first part of that number is the member id “123_” and the second part is the sequence to appear on their personal shelves. We can use PHP to separate out the values, then populate all the data back into an array, sort, then return it in a new order, but that seems likes a work around and not a long term solution. Ideally we want to create another simple table that would store and relate the sequence information. We done that on other databases we’ve built from scratch, but not with WordPress. I hope that helps.

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)