How to update selective options on plugin settings page

First kick in your validation callback by changing the register_setting() to register_setting( ‘pluginname_options’, ‘pluginname-settings’, ‘pluginname_validate’ ); And then update your validation function to actually do something. Below it gets the current state of the options, and then only updates the pieces of the array that are submitted. When you are on a tab and click … Read more

Placeholders in Jetpack Contact Form [closed]

You can do this by means of jQuery (which means this is rather a jQuery/JavaScript question). Put the following in one of your (already included) JS files, or create a new JS file and enqueue it, or hard-code it in between <script>…</script> tags: jQuery(document).ready(function($) { $(‘#my-form-field’).attr(‘placeholder’, ‘Please enter your name…’); });

recommended practice for form submission

I would use init hook in your plugin file to register custom function add_action( ‘init’, ‘custom_proccess_form’ ); And then check form inputs in the custom function, you mentioned creating posts function custom_proccess_form() { $wp_error = true; // report errors or not $nonce = $_POST[‘_wpnonce’]; if( isset($_POST[‘insert_post’]) && wp_verify_nonce($nonce, ‘my-nonce-name’) ) { $post = array( ‘post_title’ … Read more

Wp_mail Returning False on Server

Your code looks okay to me. Instead check whether email working in other part of the website or not!! Use Postman SMTP Mailer/Email Log plugin to configure / test / debug your mail system.

need to add attach thumbnail from my form

Its pretty simple actually. Here is the link for the set_thumbnail function reference codex. And here is the answer for the file upload. First off all you have to attach the file to the post : function attach_uploads($uploads,$post_id = 0){ $files = rearrange($uploads); if($files[0][‘name’]==”){ return false; } foreach($files as $file){ $upload_file = wp_handle_upload( $file, array(‘test_form’ … Read more

how to handle forms in multiple pages?

Kind of – I would suggest using init. This would probably be the best way of doing it since you can process the form as described below. wp_head would work though. Also, you should make sure you are making necessary checks with ‘nonces’. I suggest the init hook as you can employ something similar to … Read more

Settings API erases itself?

The reason is that if you are on page 1, the data that is posted to be saved is an array of the form: XX_theme_settings=array(‘XX_Option1′ =>’input1′,’XX_Option2’=>’input2′,…) and contains no data from page 2. This is because the input from page 2 is not posted with it (since it wasn’t in the same <form> – it’s … Read more

Contact form 7 Dynamic text – placeholder on GET field

the Dynamic Text plugin cannot make what you need, but I use this code to write a new tag that you can use like that : [dynamictext_placeholder enquiry-product placeholder “placeholder text” “CF7_GET key=’product-name'” “before ‘%s’ after”] for that, create a new plugin with that : add_action( ‘wpcf7_init’, function () { wpcf7_add_form_tag( array( ‘dynamictext_placeholder’) , ‘wpcf7dtx_dynamictext_placeholder_shortcode_handler’ … Read more

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