I am focusing on this little wordpress plugin that allows a person to submit a publish on my small website.
if (!isset($wpdb)) $wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST); $wpdb->insert( $wpdb->prefix . 'posts', array( 'post_title' => 'testerrrr', 'post_author' => '1', 'post_content' => 'geen content aja', 'post_status' => 'publish' ) );
The above mentioned code is not adding a brand new row towards the table. (I additionally attempted with $wpdb->wp_posts) Also it does not produce a mistake neither (error confirming is switched on though) Exist maybe other fields that I am obliged to make use of within the array, or shall we be held doing another thing wrong?
As TheDeadMedic mentioned, this is often accomplished with wordpress_inser_publish()