This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • mmmateommmateo
    Participant

    Ah, perfect. Thanks!

    in reply to: Need to show more than 10 results at once #13620
    mmmateommmateo
    Participant

    Hmm, that doesn’t seem to do it. Could I be doing something wrong?

    http://imgur.com/a/W2YWz

    in reply to: Linking result to custom field #13212
    mmmateommmateo
    Participant

    Thanks Ernest,

    That didn’t solve the issue, but it helped point me in the right direction. To solve it, I had to use the ACF function get_field() vs get_post_meta(). This may be helpful to include in your documentation, in case other users are using ACF alongside your plugin.

    [code]
    add_filter( ‘asp_results’, ‘asp_custom_link_meta_results’, 1, 1 );

    function asp_custom_link_meta_results( $results ) {

    // Change this variable to whatever meta key you are using
    $key = ‘attach_document’;

    // Parse through each result item
    foreach ($results as $k=>$v) {
    $new_url = get_field($key, $v->id, true);

    // Change only, if the meta is specified
    if ($new_url != ”)
    $results[$k]->link = $new_url;
    }

    return $results;
    }
    [/code]

    Thanks again,

    Mateo

Viewing 3 posts - 1 through 3 (of 3 total)