Support

Account

Home Forums Backend Issues (wp-admin) Display custom field value on edit page Reply To: Display custom field value on edit page

  • Thanks John – I figured something out.

    I wrote this function:

    
    function generate_acf_shortcode( $field ) {
     echo '<pre>[post-snippet post="'; print_r($field['value']); echo '"]</pre>';
    }
    
    add_action( 'acf/render_field/type=page_link', 'generate_acf_shortcode', 10, 1 );
    

    This generated the proper snippet syntax (actual short code i wrote elsewhere) inline with my page_link fields.

    I followed that up by altering it to this:

    
    function generate_acf_shortcode( $field ) {
      $_SESSION['acf_post_link'] = $field['value'];
    }
    
    add_action( 'acf/render_field/type=page_link', 'generate_acf_shortcode', 10, 1 );
    

    and then in the EMF field I called this to pull those values in for each field:

    
    [post-snippet post="<?php echo $_SESSION['acf_post_link']; ?>"]
    

    Ended up With this: