Insert Extra fields added in the front end registration form to DB

Why the downvotes for using user meta? That’s how I do it, I store all the extra profile stuff in wp_usermeta table by utilizing update_user_meta. <?php // first validate all $_POST data $validated = $this->validate_and_sanitize(); $username = $validated[‘uname’]; $password = $validated[‘pass’]; $email = $validated[’email’]; $new_user_id = wp_create_user($username, $password, $email); if ( is_wp_error($new_user_id) && array_key_exists(‘existing_user_login’, $new_user_id->errors)) … Read more

What is best for saving lot of extra detail of user?

You can store multiple pieces of data within a single field by passing an array rather than a string: $user_data = array( ‘favorite_color’ => ‘blue’, ‘favorite_animal’ => ‘cat’, ‘favorite_city’ => ‘paris’ ); update_user_meta( $user_id, ‘user_data’, $user_data ); WordPress will serialize this data for you on save, and unserialize back into an array when it is … Read more

Running WordPress from MySQL Cluster with HAPRoxy

SELinux was contributing to the problem. The main issue was that an HTML page was attempting to talk to another port on the localhost. I would not have seen the problem if the HAProxy was running on a separate host. The log was revealed in /var/log/messages, where I should have checked but did not considering … Read more

Woocommerce: Grab total revenue of a product over all orders

Got it solved. Probably not the most efficient way but it works! SELECT product_id, meta_value FROM ( SELECT order_meta.order_item_id, order_meta.meta_value AS ‘product_id’ FROM wp_woocommerce_order_itemmeta AS order_meta LEFT JOIN wp_woocommerce_order_items AS order_items ON order_meta.order_item_id = order_items.order_item_id LEFT JOIN wp_term_relationships AS term_rels ON term_rels.object_id = order_items.order_id WHERE term_taxonomy_id = 24 AND order_meta.meta_key = ‘_product_id’ ) AS product_ID … Read more

Create hundreds of users with just ID in phpMyAdmin

To change the initial ID user by mysql ALTER TABLE wp_users AUTO_INCREMENT=2; although the number has to start at the next available id with no existing id higher, as in select max(id) from wp_users; https://stackoverflow.com/questions/1485668/how-to-set-initial-value-and-auto-increment-in-mysql

Install WordPress with SQL database

Install WordPress Locally WordPress is well-known for its ease of installation. Under most circumstances, installing WordPress is a very simple process and takes less than five minutes to complete. If you wish to install WordPress on local, the following guide will help. Before install WordPress Checking to ensure that you and your web host have … Read more

Print output of Table Creation

function jal_install() { global $jal_db_version; $sql = “CREATE TABLE IF NOT EXISTS WP_AWESOME_TABLES ( id mediumint(9) NOT NULL AUTO_INCREMENT, PRIMARY KEY id (id) );”; require_once( ABSPATH . ‘wp-admin/includes/upgrade.php’ ); dbDelta( $sql ); add_option( “jal_db_version”, $jal_db_version ); } register_activation_hook( _____FILE_____, ‘jal_install’ ); You have to hook the function. After activate the plugin table will created. http://codex.wordpress.org/Creating_Tables_with_Plugins

How do I find posts?

I may be misinterpreting your question, it could use some more detail, but I think the old site must have had a plugin installed. Posts and their statuses are not displayed in any of the default WordPress dashboard widgets. The only two plugins that I know that do something like that are Post Status Menu … Read more

Where To Find bb_profile_data(); In bbPress?

From this reference you get the following info: Function and Method Cross Reference bb_profile_data() Defined at: /bb-includes/functions.bb-template.php -> line 2405 Referenced 1 times: /bb-templates/kakumei/profile.php -> line 30 so you should check your profile template. If you have ssh access to your site, try # grep “bb_profile_data” -R /the/path/to/your/site/ in the shell command line, to search … Read more