Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I am not familiar with the Wordpress api, so please verify a few assumptions I have. (I know this is not an answer, but I do not want to put as a comment for readability)</p> <p>1) <code>ab_settings()</code> is called somewhere?<br> 2) Is the section you are having issues with?</p> <pre><code> foreach ($this-&gt;html as $key =&gt; $html) { add_settings_field( $key, $html['title'], array(&amp;$this, 'ab_do_htmlprint' ), 'ab_' . $this-&gt;slug . '_options', 'ab_section'); } </code></pre> <p>3) <code>$key</code> is magically available or do you need to provide it as an argument?</p> <pre><code> public function ab_do_htmlprint() { $html = $this-&gt;html[$key];` </code></pre> <p>Also, the format of your <code>ab_do_htmlprint</code> function is very hard to read and could be a source of error. Try using <a href="http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc" rel="nofollow">HEREDOC</a> notation or purely PHP strings </p> <p>ex) Instead of</p> <pre><code> public function ab_do_htmlprint() { $html = $this-&gt;html[$key]; ?&gt; &lt;p&gt;&lt;?php echo $html['description'] ?&gt;&lt;/p&gt; &lt;&lt;?php echo $html['type'] ?&gt; id="&lt;?php echo $html['id'] ?&gt;" class="&lt;?php echo $html['class'] ?&gt;" name="&lt;?php echo $html['name'] ?&gt;"&gt; &lt;?php get_option($html['name'])?&gt; &lt;/&lt;?php echo $html['type'] ?&gt;&gt; &lt;?php } </code></pre> <p>as</p> <pre><code> public function ab_do_htmlprint() { $html = $this-&gt;html[$key]; $output = "&lt;p&gt;{$html['description']}&lt;/p&gt;"; $output .= "&lt;{$html['type']} id=\"{$html['id']}\""; $output .= " class=\"{$html['class']}\""; $output .= " name=\"{$html['name']}\"&gt;"; get_option( $html['name'] ); $output .= "&lt;/{$html['type']}&gt;"; echo $output; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload