Settings API not Saving to Database or Display

The issue with the data saving lies in this area of the code (all three similar functions). printf( ‘<textarea name=”%1$s[$2$s]” id=”%3$s” rows=”1″ cols=”30″ class=”code”>%4$s</textarea>’, $args[‘option_name’], $args[‘name’], $args[‘label_for’], $args[‘value’] ); Or more specifically it’s, this part [$2$s], which should be, [%2$s]. I totally get it though, these specifiers can be fiddly and easy to make typos … Read more

Echo get_option displays as text

If you really want to execute code stored in a database, a quick google search reveals that you can use the eval() function to do just that. However, many people do say that Eval is Evil… Instead of storing the entire PHP code of an option in the database, try storing a simple boolean flag … Read more