• hello, i have a problem with implementing my own function into wordpress. I have this plugin and I need to display / add link to the file uploaded by the form. I used the code sent 2 threads before but I don’t know exactly where to add this code:

    // The action callback function.
    function example_callback_id_generated( $attachment_id ) {
        // (maybe) do something with the args.
        $url = wp_get_attachment_url( $attachment_id );
    }
    add_action( 'nmr_create_attachment_id_generated', 'example_callback_id_generated', 10, 1 );

    Adding it to the functions.php file in the themes directory I get a fatal wordpress error.

    I then added it to the file: store-file-uploads-for-contact-form-7.php, But when calling it as “[nmr_create_attachment_id_generated]” I get plain text – no location ….

    I want the file location to show up in the textbox.

Viewing 1 replies (of 1 total)
  • Plugin Author mirceatm

    (@mirceatm)

    Hi!
    I think there’s some misunderstanding here.
    This plugin has no shortcode, so writing [nmr_create_attachment_id_generated] (which looks like you want to call a wordpress shortcode) in a Page or Post or Contact Form will not work, unless you add code for a new shortcode called like that. Check the documentation for shortcodes here

    As stated in the plugin description:
    This plugin will save uploaded files to Media Library before email is sent by CF7.
    This plugin will raise an event with the the full file path & name.

    The code you posted should react to the event mentioned above and get you the url of the attachment – showing that url in a page, post or contact form is another story. I’m available for small consulting work at mircea @ namir . ro

Viewing 1 replies (of 1 total)
  • The topic ‘Get url of file – step by step’ is closed to new replies.