• Resolved MagicStick

    (@magicstick)


    Hi all. I updated to 3.9 this morning and have identified my white screen is due to the function I wrote that was working fine in previous version. Looked for docs on the new ‘function?!’ found nothing. Here is the function I HAD. Can you confirm required changes?

    wpcf7_add_shortcode('wpcf7_doclink', 'add_doclink', true);
    
    function add_doclink() {
    
      $page_id      = get_queried_object_id();
    
      $the_file_url = get_post_meta($page_id, 'thepost_doc_url', true);
    
      $html         = '<input type="hidden" name="your-doclink" value="'.$the_file_url.'">';
    
      return $html;
    }

    https://wordpress.org/plugins/contact-form-7/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter MagicStick

    (@magicstick)

    I figure out a solution. Updated my code to the following:

    add_action( 'init', 'xxxxx_wpcf7_add_shortcode', 5 );
    
    function xxxxx_wpcf7_add_shortcode() {
      wpcf7_add_shortcode('wpcf7_doclink', 'add_doclink', true);
    }
    
    function add_doclink() {
    
      $page_id      = get_queried_object_id();
    
      $the_file_url = get_post_meta($page_id, 'thepost_doc_url', true);
    
      $html         = '<input type="hidden" name="your-doclink" value="'.$the_file_url.'">';
    
      return $html;
    }

    Thanks for the feedback! Good to see you find a solution.

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

The topic ‘3.9 White screen (Not recognising wpcf7_add_shortcode())’ is closed to new replies.