Show the submitted values in the form when validation fails

You can’t. If you’re using the settings API correctly, here’s what happens when you try to save your options: Form posts to options.php WordPress handles $_POST and runs update_option on your registered settings Your sanitize callback from register_setting is applied Any data that fails/you don’t return in your callback isn’t saved WordPress redirects back to … Read more

Plugin options, presets and filters : can you help me improve my workflow?

You hadn’t included how had you arrived at this concept, but the whole “presets” branch of logic is pretty strange. Post-filtering vs pre-filtering WordPress filters are de-facto centered on filtering results. Your my_plugin_get_options filter follows that model — the results are produced and offered for modification. Sometimes that is undesirable, what if we do all … Read more

Pass current post title to a predefined link

Looks like it’s possible to use a placeholder tag, the following is the PHP code using a _custom_link value of http://somelink.com/?ref=%%title%%. <?php // must be within the Loop $ref_slug = strtoupper(sanitize_title_with_dashes(get_the_title())); $regex = ‘(\%\%title\%\%)’; $ref_link = ( get_option(‘_custom_link’) ) ? preg_replace( $regex, $ref_slug, get_option(‘_custom_link’)) : null; echo $ref_link; ?>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)