How do you disable account activation in WPMU and then log the user in right away?

In a WPMU setup the account information is sent to the wp_signup table before being passed to the wp_users table. an easy fix for this is: function your_disable_activation( $user, $user_email, $key, $meta=”” ) { // Activate the user $user_id = wpmu_activate_signup( $key ); wp_set_auth_cookie( $user_id, true, is_ssl() ); wp_redirect( /*redirect to */ site_url() ); exit; … Read more

Possible to enqueue scripts and CSS to Multisite Network dashboard?

You can use the global variable $current_screen. It has the property is_network, with a boolean value, that indicates if we are in /wp-admin/network/ or not. add_action( ‘admin_print_scripts’, ‘network_scripts_wpse_91699’ ); function network_scripts_wpse_91699() { global $current_screen; if( !$current_screen->is_network ) return; wp_register_script( ‘test’, plugins_url( ‘test.js’, __FILE__) ); wp_enqueue_script( ‘test’ ); } This action hook can also be used … Read more

Child Theme activates, but nothing from parent theme displays (MAMP, Multisite)

Basically I am using a child theme as the default theme every time a new blog is created. In the wp-config.php file – I was calling define(‘WP_DEFAULT_THEME’, ‘confit-childtheme’); define( ‘TEMPLATEPATH’, ‘/public_html/wp-content/themes/confit’); I read that when you are using a child theme as the default install theme, you have to reference the parent theme folder. This … Read more

Pushing stored procedure to a multisite database in WordPress

Here are the Steps: STEP 01 : Put code in a Text File Open up a text editor (vi, nano, emacs) and place your code in it. Save it as /tmp/mynewcode.sql STEP 02 : Collect All Databases Names MYSQLCONN=`-uroot -ppassword` SQLSTMT=”SELECT schema_name FROM information_schema.schemata” SQLSTMT=”${SQLSTMT} WHERE schema_name NOT IN” SQLSTMT=”${SQLSTMT} (‘information_schema’,’performance_schema’,’mysql’)” mysql ${MYSQLCONN} -ANe”${SQLSTMT}” > … Read more

Jetpack API for WordPress Network

I answered my own question. The slash in the URL messes up the API call. However urlencoding the URL will get around it. IE: $context = stream_context_create( $options ); $site = urlencode(“subdomain.example.com/site1″); $response = file_get_contents( ‘https://public-api.wordpress.com/rest/v1/sites/’ . $site .”https://wordpress.stackexchange.com/”, false, $context );