function wingsSaveTextForPostAndUserUpdate() { global $wpdb; global $wingspersonalplugin_db_version; $table_name = $wpdb->prefix . "wingspersonaloverlib"; $thoughts = $_POST['thoughts']; //pegar o post id e o usuário $postId = $_POST['id']; $user = wp_get_current_user(); //pegar o trecho $text = $_POST['text']; $thoughtsId = $_POST['thoughtsId']; //salvar no banco /* $wpdb->insert( $table_name, array( 'personal_post_ID' => $postId, 'personal_user_ID' => $user->ID, 'personal_comment' => $_POST['thoughts'], 'personal_comment_text' => $text, ) ); */ $wpdb->update($table_name, array('personal_comment' => $thoughts, 'personal_comment_text' => $text), array('ID' => $thoughtsId), array('%s', '%s'), array('%d')); //buscar o conteúdo - lembrar de pegar no get content capitular o conteúdo the_content_capitular(null, false, $postId); //vamos buscar return; }
<header class="entry-header"> <h1 class="entry-title"><?php the_title(); ?> </h1> <div class="entry-meta"> <?php radiate_posted_on(); ?> </div><!-- .entry-meta --> </header><!-- .entry-header --> <div class="entry-content"> <?php the_content_capitular(); ?> </div><!-- .entry-content --> <footer class="entry-meta"> <div class="entry-social-network"> compartilhe <div id="entry-curtir-icon" class="minibox"> curtir </div> <div class="entry-social-number"> 1208 </div> <div id="entry-tweet-icon" class="minibox"> tweet