This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Create new shortcode for quickly displaying user metadata. | |
*** NOTE: This only works if you have the Ultimate Member plugin installed. | |
*** Use like regular wordpress shortcodes. Enter [USERMETA user_id="*id*" meta="*field_name*"] (replace *id* and *field_name* with actual values) | |
*** If you use it on an Ultimate Member profile page/tab, it will use the user currently being viewed. | |
*** On other pages, you must include the "user_id" within the shortcode. | |
*/ | |
//Add the shortcode to WordPress | |
add_shortcode('USER_META', 'user_meta_shortcode_handler'); | |
//create the function referenced by the add_shortcode() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wpuf_post_umgroup( $post_id, $form_id ) { | |
/* Build the post content by adding the referer URL to the comment and update the post */ | |
$lv_comment = $_POST['_my_comment'] . PHP_EOL . PHP_EOL . home_url() . wp_get_referer(); | |
$lv_post = array(); | |
$lv_post['ID'] = $post_id; | |
$lv_post['post_author'] = get_current_user_id(); | |
$lv_post['post_content'] = $lv_comment; |
NewerOlder