I have a custom functionality which create a custom post with info entered on a form
Part of the post content is a line like
When I tested it as an admin all worked perfect and the content was created as I wanted, but once I used the form as non-logged user the custom post was created with only
When I changed the id to class like
<div class="featuredcocktail"> it worked well for both admin and non-logged user.
$my_post = array( 'post_title' => $company_field, 'post_type' => 'bgmp', 'post_status' => 'draft', 'comment_status' => 'closed', 'ping_status' => 'closed', 'post_content' => $content ); $id = wp_insert_post( $my_post ); $cont = '<div id="featuredcocktail">'. "\r\n"; $cont .= '<img src="'. $attach_data['file'] .'" alt="'. $filename .'" title="'. $filename .'" width="'. $attach_data['width'] .'" height="'. $attach_data['height'] .'" class="alignright size-medium" />'. "\r\n"; wp_update_post( array('ID' => $id, 'post_content' => $cont ) );
Any idea how I can use id?