How to display a value from a radio button in the options menu in wordpress

Your form is sending data using POST method, so you should receive selected value of radio button in $_POST[‘colorSelect’]. To simply display it you can use: if(isset($_POST[‘colorSelect’])) echo $_POST[‘colorSelect’]; else echo “Nothing selected”; To save it to options table use following code at the start of your function colorSelector(): if(isset($_POST[‘colorSelect’])) update_option(‘colorSelect’, $_POST[‘colorSelect’]); So you can … Read more

Why is WordPress changing my HTML code

Couple of things: You’re missing the semicolon after your unicode character, should be ” The quote element gets stripped by the visual editor b/c the version of TinyMCE that WordPress implements is only set to recognize a certain subset of html elements and it strips out the rest. Possible solutions: Disable the visual editor in … Read more

Remove tags from the kses filter

The allowed tags are stored in $allowedposttags (located in /wp-includes/kses.php) as an array. For each element it looks something like this: $allowedposttags = array( ‘div’ => array( ‘align’ => true, ‘dir’ => true, ‘lang’ => true, ‘xml:lang’ => true, ) ); You can remove a single element of an array via unset unset($allowedposttags[‘div’]);

Are there any standard HTML markup for metabox?

WordPress.org UI Style Guide site has some reference materials, including those on Box Formats and Forms. As far as I remember it’s not consistently maintained or considered especially canonical source. In practice elements are often done after studying current state of actual admin markup.

Minify HTML, CSS, JS with PHPWee?

There is little ‘bug’ in PHPWee. It should use <?php instead of <?: <? namespace PHPWee; require_once(“src/CssMin/CssMin.php”); require_once(“src/HtmlMin/HtmlMin.php”); require_once(“src/JsMin/JsMin.php”); // Open-source (BSD) PHP inline minifier functions for HTML, XHTML, HTML5, CSS 1-3 and Javascript. // BSD Licensed – https://github.com/searchturbine/phpwee-php-minifier/blob/master/LICENSE // // Usage // $output = \PHPWee\Minify::html($any_html); // $output = \PHPWee\Minify::css($any_css); // $output = \PHPWee\Minify::js($any_js);