Tracing dashboard publish settings from input form in WordPress

Those are some dangerous words “public…can enter data directly to the DB” You could write your own form and use wp_insert_post() Something like this: $new_post = array( ‘comment_status’ => ‘closed’, ‘ping_status’ => ‘closed’, ‘post_author’ => 1, // id of admin, or some other user ‘post_title’ => $_POST[‘title’], ‘post_name’ => $_POST[‘title’], ‘post_status’ => ‘draft’, ‘post_type’ => … Read more

Carrying information from button click into form [closed]

The better way to do this is using javascript/jquery. Use either javascript webstorage api or jquery ajax $.post. Webstorage api will be good for this. Here how you can do it. $(‘body’).on(‘click’, ‘.button.small’, function(){ var index = $(this).parents(‘table’).index(‘table’); var cur_workshop = $(this).parents(‘.innercontent’).find(‘h3’).eq(index).text(); localStorage.setItem(‘workshop’, cur_workshop); }); Place above script on http://yft.ac/upcoming-workshops/ this page template. Then call … Read more

add unique code required to register

Add a field on your registration form <label for=”secret_reg_code”>Secret Code: </label> <input type=”text” name=”secret_reg_code” id=”secret_reg_code” value=”” /> then in your plugin file or in function.php add define(‘MY_SECRET_REG_CODE’, ‘fdsfgadsfgdf’); function check_for_reg_secret_code($errors, $sanitized_user_login, $user_email) { if ( defined(‘MY_SECRET_REG_CODE’) && trim($_POST[‘secret_reg_code’]) != MY_SECRET_REG_CODE ) { $errors->add( ‘secret_code_error’, __(‘<strong>ERROR</strong>: Enter a valid code postal code.’, ‘your_text_domain’) ); } return … Read more

Assigning input to variable

Your form doesn’t contain the fields you think it does. Use FireBug or a similar tool (even var_dump($_POST)) to see what is actually being posted. Your num_users is a setting group, not a single field. At best the field with the value will be user_main_settings field. The previous commenter is also correct – checking for … Read more

Using Nonce for my Form

I figured out what I needed to do. I needed if(isset( $_POST[ ‘tdgmt_plugin_noncename’]) && wp_verify_nonce( $_POST[‘tdgmt_plugin_noncename’], plugins_url( __FILE__))){ to be above if($screen->base == ‘settings_page_tgdmt_options_page’){ as well as fixing my typos of tdgmt_plugin_noncename instead of tgdmt_plugin_noncename

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