title: How to convert mysql_real_escape_string to PHP7?
body: <p>I got a Wordpress system running on <strong>PHP 7.0.11</strong> using <strong>Wordpress</strong>. A plugin I want to use does not work and checking the logs does result in</p>
  
  <blockquote>
    <p>PHP Fatal error:  Uncaught Error: Call to undefined function mysql_real_escape_string() in…</p>
  </blockquote>
  
  <p>Looking for this error message I have found that the <a href="http://php.net/manual/en/function.mysql-real-escape-string.php" rel="noreferrer"><code>mysql_real_escape_string()</code></a> extension was deprecated.</p>
  
  <p>How can I convert this statement to work in PHP 7 and above? </p>
  
  <pre><code>$ids = mysql_real_escape_string( $ids );
  $result = $wpdb-&gt;query( "DELETE FROM $table_name WHERE id IN( $ids )" );
  </code></pre>
  
  <p>I have found this in the Wordpress docs: <a href="https://developer.wordpress.org/reference/classes/wpdb/_real_escape/" rel="noreferrer"><code>wpdb::_real_escape()</code></a></p>