Support

Account

Forum Replies Created

  • @matthias-honert thank you!

    $iframe = preg_replace(‘~<iframe[^>]*\K(?=src)~i’,’data-‘,$iframe);

    sorted it for me too after hours of looking!!! 🙂

  • @elliot thanks for the links, just read the first one about the rushed release.

    We really do appreciate your hard work on this and totally support you in the long term. ACF is fantastic and we know that you and the team will work hard to iron out the kinks and adapt to this massive change.

    Thanks again for your awesome work and commitment.

  • Same here, all the fields listed (even the inactive ones) – just the headers show, nothing can be edited unless we activate the classic editor

  • Hi, I’ve just got some more grey hairs and got the code from the Relevassi blog post about this working so it will use custom fields in it’s excerpt. With this code and “custom search result snippets” turned on, it will highlight the search term.
    Hope this helps others!!

    add_filter('relevanssi_excerpt_content', 'custom_fields_to_excerpts', 10, 3);
    function custom_fields_to_excerpts($content, $post, $query) {
    
    $custom_field = get_post_meta($post->ID, 'normal_custom_field', true);
    $content .= " " . $custom_field;
    $custom_field = get_post_meta($post->ID, 'normal_custom_field2', true);
    $content .= " " . $custom_field;
    
    if($fields){
    foreach($fields as $custom_field){
    $content .= " " . $custom_field['repeater_sub_field_1'];
    $content .= " " . $custom_field['repeater_sub_field_2'];
    }
    }
    $fields = get_field('page_content', $post->ID);
    if($fields){
    foreach($fields as $custom_field){
    
    if($custom_field['acf_fc_layout'] == 'layout_name_1'){
    $content .= " " . $custom_field['sub_custom_field'];
    $content .= " " . $custom_field['sub_custom_field2'];
    
    } elseif ($custom_field['acf_fc_layout'] == 'layout_name_2'){
    $content .= " " . $custom_field['sub_custom_field'];
    }
    }
    }
    return $content;
    }
  • Hi, I’ve just got some more grey hairs and got the code from the Relevassi blog post about this working so it will use custom fields in it’s excerpt. With this code and “custom search result snippets” turned on, it will highlight the search term.
    Hope this helps others!!

    add_filter('relevanssi_excerpt_content', 'custom_fields_to_excerpts', 10, 3);
    function custom_fields_to_excerpts($content, $post, $query) {
    
    $custom_field = get_post_meta($post->ID, 'normal_custom_field', true);
    $content .= " " . $custom_field;
    $custom_field = get_post_meta($post->ID, 'normal_custom_field2', true);
    $content .= " " . $custom_field;
    
    if($fields){
    foreach($fields as $custom_field){
    $content .= " " . $custom_field['repeater_sub_field_1'];
    $content .= " " . $custom_field['repeater_sub_field_2'];
    }
    }
    $fields = get_field('page_content', $post->ID);
    if($fields){
    foreach($fields as $custom_field){
    
    if($custom_field['acf_fc_layout'] == 'layout_name_1'){
    $content .= " " . $custom_field['sub_custom_field'];
    $content .= " " . $custom_field['sub_custom_field2'];
    
    } elseif ($custom_field['acf_fc_layout'] == 'layout_name_2'){
    $content .= " " . $custom_field['sub_custom_field'];
    }
    }
    }
    return $content;
    }
  • Hi guys, yes I confirm I’m using a custom built theme with template php tags to load the acf content into the relevant areas of the layout.
    Great info in this thread, I’ll review properly when back to work and try out some of the conditionals.
    The conditional dependent on membership levels sounds promising as potentially we could also show the relevant sign up form in a custom field based on membership.
    Many thanks

  • Thanks John.

    James from support also sent me the info below, I’ve forwarded that in to Paul at member press to look at.

    “Thanks for the email.

    I had a look at the discussion and just to add my input perhaps you could have the guys over at Memberpress also hook into the acf_the_content global filter for getting the acf content within WYSIWYG custom fields.

    Please have a look at the following resource page for more info: http://hookr.io/filters/acf_the_content/

    I hope this helps.”

  • cartpauj, thanks!
    I changed the settings to redirect and that looks like it solves the issue!
    When it’s set to redirect, member press works on the page url and redirects to another page,so it doesn’t matter if the content is an acf or not so this could’ve the way round the issue.
    Thanks both for your help, much appreciated.

  • Just checked and the default behaviour when using the standard wp wysiwyg is to replace the content with the sign up form.

  • Ah, interesting point you’ve made there. Is member press redirecting or just replacing the content with the sign up/login.
    I may be wrong in thinking its redirecting, I’ll check the page urls.

    If the content is in the default wysiwyg wp editor (the_content) it shows the sign up if not logged in.

    If the content is in a acf area, nothing happens, it still shows the content (or a blank page if the code I pasted above is used)

    I have asked member press to view this thread and let us know their comments.

  • Hi john,very valid question and I’ll contact member press support for clarification.
    In the admin We set rules for each membership level – eg hide post, page etc if it logged in.
    If someone goes to one of these pages, they are redirected to the sign up/login page.

    Member press support also said “you should be able to use a PHP conditional (as long as there’s a Rule protecting that page) like <?php if(current_user_can(‘mepr-auth’)) { ?>”, however this just hides everything and doesn’t redirect to the sign up.

    I’ll email them with your question now as they are keen to find a way too.
    Thanks

  • yes, when you create the field you have options to hide the editor, permalink, attributes etc, so you can hide the default editor and leave just your own fields.

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