Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1. $conn = mysqli_connect('localhost', 'root', 'qwerty', 'rodzinny-zakatek');
  2.  
  3. if ($conn && isset($_GET['add-posts'])) {
  4.     for ($i=0; $i < 24; $i++) {
  5.  
  6.         $args = array(
  7.             'post_type' => 'lokale',
  8.             'post_status' => 'publish',
  9.             'post_title' => 'Etap VI nr.' . ($i+1),
  10.             //'post_category' => array(23),
  11.             'meta_input' => array(
  12.                 'status' => 'inaccessible',
  13.                 'stage' => 'stage6',
  14.                 'area' => '86',
  15.                 'return' => 'IV kwartał 2020',
  16.                 //'local-price' => '315000'
  17.             ),
  18.         );
  19.  
  20.         $postID = wp_insert_post($args);
  21.  
  22.         $sql = "INSERT INTO mwp_term_relationships (object_id,term_taxonomy_id, term_order) VALUES ( $postID, 28, 0 )";
  23.  
  24.         $conn->query($sql);
  25.  
  26.     }
  27. }
  28.  
  29. $conn->close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement