import (migration) user database to wp-users

get all data from DB1( non-wp-database ) and save to an $array. Use this wordpress code inside your functions.php for insert users into DB2 ( wordpress database). function cxg_wp_insert_user() { foreach ( $array as $arr ) { $user_data = array( ‘ID’ => ”, ‘user_pass’ => wp_generate_password(), ‘user_login’ => $loginName, ‘user_nicename’ => $nicename, ‘user_url’ => ”, … Read more

Clear custom field when new tag is added

Could you do something like this? function tag-added-script() { ?> <script> jQuery(function($) { $(‘.tagadd’).click(function() { // Run Your Jquery Here alert(‘test’); }); }); </script> <?php } add_action( ‘admin_head’, ‘tag-added-script’ ); The above will react whenever the “tagadd” button is clicked. Theoretically you could then grab the custom field ID and clear it via jquery.

Validate user meta and redirect

Here is how I would do it: function save_extra_user_profile_fields( $user_id ) { if (!isset($_POST[‘address’]) || empty($_POST[‘address’])) { // this field was not set or was empty // do your action wp_redirect( home_url() ); // or profile page exit; } else { // field was set and contains a value // do your action update_user_meta( $user_id, … Read more

I have a question in Basic HTML [closed]

This basically means you do not want to use, say “Microsoft Word” to edit your code. Doing so may (and often will) add unnecessary bits of information to the code… causing it to parse unexpectedly when viewed in a browser. Instead, you a code editor (like Adobe Dreamweaver, or a free alternative like Notepad++) to … Read more

Gravity prerender taxonomy [closed]

Scoured the web and modified a snippet, in case anybody is interested: <?php add_filter(“gform_pre_render”, “gform_prepopluate_populate_books”); add_filter(“gform_admin_pre_render”, “gform_prepopluate_populate_books”); function gform_prepopluate_populate_books($form){ //Grab all Terms Associated with a Specific Taxonomy; global $post; $taxonomy = ‘genres’; $formid = 5; $fieldid = 14; if($form[“id”] != $formid) return $form; $terms = get_terms($taxonomy, ‘hide_empty=0&orderby=none’); //Creating drop down item array. $items = array(); … Read more