Wordpress - Pass wp-login information to the HTTP input

Hello. I also have an opened ticket with support, but thought I would check here while I wait.

I am working in Wordpress. Currently I have a page created in Wordpress that is pulling in a .html file sitting in a folder. Part of the .html is a submit and save button. When either of those buttons are clicked, it is directed to a process in the Planetpress workflow. I need to pass the current Wordpress login userID/UserName through the HTTP request to the workflow to use in the process. I’ve tried modifying the php with:

<?php wp_get_current_user(); ?>

but cannot get it to show in the HTTP input request in Planetpress.

Thank you!

You should add a input field for that, something like:

echo '<input type="hidden" name="user" value="' . wp_get_current_user() . '">';

This will add a POST element to the input request with the tag user.

We created a proof-of-concept plugin for WordPress which allows you to inject HTML returned by an OL Connect Workflow process. This HTML is can be static file loaded from disk or personalized HTML rendered by a template created in OL Connect Designer.

The Workflow process is called via a shortcode in your WordPress page ([olc_workflow action=“hello”]). As part of this request it passes several environment variables like the current user ID. One could modify this data using a filter. The Workflow process stores this information in the Job Data File of the process and allows you to personalize the OL Connect template.

We (OL) use this technique in many of our online demos and projects. Would you be interested in receiving this info?

Hi Erik! I am already using the OL shortcodes plugin and it works great! But… I do not see the environment variables in the post back to the workflow though? Is this an automatic thing, or do I need to modify the plugin to pass this information along to the HTTP Input?

I have tried to modify the page in Wordpress, the php in the theme functions and also elements in the OL shortcodes plugin itself.

I have a call with support scheduled for tomorrow morning and I will try what prennings has suggested above.

Thank you!

Hi APoole,

Do you know the version of the OL ShortCodes plugin? By default it should post information like the user_id, locale, post_name, post_id etc. These variables should be available in the Job Data File of your process.

To verify the content of the Job Data File one could add a Send To Folder following the HTTP Server Input (or NodeJS Server Input). This allows you to store a copy of the submitted data and use it as sample data for further testing.

In case information is missing one could call olc_shortcodes_data_filter filter from within the functions.php of the active theme. See the snippet below.

Erik

function example_callback( $data ) {
    // Adding a variable and value to $data
    $data['foo'] = 'bar';
    return $data;
}
add_filter( 'olc_shortcodes_data_filter', 'example_callback' );

The OLC shortcodes plugin sounds very good. Where can I get more infos about it and how can I get the plugin?

I want to do exactly what the plugin provides (embed html page from workflow).