Title: fpg's Replies | WordPress.org

---

# fpg

  [  ](https://wordpress.org/support/users/fpg/)

 *   [Profile](https://wordpress.org/support/users/fpg/)
 *   [Topics Started](https://wordpress.org/support/users/fpg/topics/)
 *   [Replies Created](https://wordpress.org/support/users/fpg/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/fpg/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/fpg/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/fpg/engagements/)
 *   [Favorites](https://wordpress.org/support/users/fpg/favorites/)

 Search replies:

## Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Post Type Widget Blocks] This block has encountered an error and cannot be previewed](https://wordpress.org/support/topic/this-block-has-encountered-an-error-and-cannot-be-previewed-25/)
 *  [fpg](https://wordpress.org/support/users/fpg/)
 * (@fpg)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/this-block-has-encountered-an-error-and-cannot-be-previewed-25/#post-13548971)
 * Yep, seeing the same. Not working.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: ["Login Error!" message always appears in login form.](https://wordpress.org/support/topic/login-error-message-always-appears-in-login-form/)
 *  Thread Starter [fpg](https://wordpress.org/support/users/fpg/)
 * (@fpg)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/login-error-message-always-appears-in-login-form/#post-4206187)
 * I do not actually, but the site is still under development and the only data 
   inside right now is “test data” so it wouldn’t be a devastating loss.
 * However, just so I understand the problem, I know that many of the tables are
   relational, but I have removed references to the extra users from both wp_users
   and wp_usermeta.
 * Would there be other places that I need to clean out before I can fix the Login
   issues? Seems like if the users don’t exist in wp_users, the extra data for those
   users floating around in other tables shouldn’t have much of an impact.
 * More than saving any sort of test data, I’d just like to understand what’s causing
   WP to behave this way.
 * Thanks for your help!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: ["Login Error!" message always appears in login form.](https://wordpress.org/support/topic/login-error-message-always-appears-in-login-form/)
 *  Thread Starter [fpg](https://wordpress.org/support/users/fpg/)
 * (@fpg)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/login-error-message-always-appears-in-login-form/#post-4206175)
 * I’ve included the function used below. Just FYI, this is all inherited code, 
   I have absolutely no idea why the original author didn’t just use wp_create_user()/
   wp_insert_user()….
 *     ```
       function ent_insert_user( $userdata ) {
       		/*
       		 * COPIED FROM wp_includes/user.php
       		 * NEED TO ALLOW DUPLICATE EMAIL ADDRESS ON USER IMPORT
       		 * COMMENT OUT DUPE EMAIL CHECK BELOW
       		 */
       		global $wpdb;
   
       		if ( is_a( $userdata, 'stdClass' ) )
       			$userdata = get_object_vars( $userdata );
       		elseif ( is_a( $userdata, 'WP_User' ) )
       		$userdata = $userdata->to_array();
   
       		extract( $userdata, EXTR_SKIP );
   
       		// Are we updating or creating?
       		if ( !empty($ID) ) {
       			$ID = (int) $ID;
       			$update = true;
       			$old_user_data = WP_User::get_data_by( 'id', $ID );
       		} else {
       			$update = false;
       			// Hash the password
       			$user_pass = wp_hash_password($user_pass);
       		}
   
       		$user_login = sanitize_user($user_login, true);
       		$user_login = apply_filters('pre_user_login', $user_login);
   
       		//Remove any non-printable chars from the login string to see if we have ended up with an empty username
       		$user_login = trim($user_login);
   
       		if ( empty($user_login) )
       			return new WP_Error('empty_user_login', __('Cannot create a user with an empty login name.') );
   
       		if ( !$update && username_exists( $user_login ) )
       			return new WP_Error( 'existing_user_login', __( 'Sorry, that username already exists!' ) );
   
       		if ( empty($user_nicename) )
       			$user_nicename = sanitize_title( $user_login );
       		$user_nicename = apply_filters('pre_user_nicename', $user_nicename);
   
       		if ( empty($user_url) )
       			$user_url = '';
       		$user_url = apply_filters('pre_user_url', $user_url);
   
       		if ( empty($user_email) )
       			$user_email = '';
       		$user_email = apply_filters('pre_user_email', $user_email);
   
       		/**** GOING TO ALLOW DUPLICATE EMAILS ON THE IMPORT ONLY! ********************
       		if ( !$update && ! defined( 'WP_IMPORTING' ) && email_exists($user_email) )
       			return new WP_Error( 'existing_user_email', __( 'Sorry, that email address is already used!' ) );
       		********************************************************************************/
   
       		if ( empty($nickname) )
       			$nickname = $user_login;
       		$nickname = apply_filters('pre_user_nickname', $nickname);
   
       		if ( empty($first_name) )
       			$first_name = '';
       		$first_name = apply_filters('pre_user_first_name', $first_name);
   
       		if ( empty($last_name) )
       			$last_name = '';
       		$last_name = apply_filters('pre_user_last_name', $last_name);
   
       		if ( empty( $display_name ) ) {
       			if ( $update )
       				$display_name = $user_login;
       			elseif ( $first_name && $last_name )
       			/* translators: 1: first name, 2: last name */
       			$display_name = sprintf( _x( '%1$s %2$s', 'Display name based on first name and last name' ), $first_name, $last_name );
       			elseif ( $first_name )
       			$display_name = $first_name;
       			elseif ( $last_name )
       			$display_name = $last_name;
       			else
       				$display_name = $user_login;
       		}
       		$display_name = apply_filters( 'pre_user_display_name', $display_name );
   
       		if ( empty($description) )
       			$description = '';
       		$description = apply_filters('pre_user_description', $description);
   
       		if ( empty($rich_editing) )
       			$rich_editing = 'true';
   
       		if ( empty($comment_shortcuts) )
       			$comment_shortcuts = 'false';
   
       		if ( empty($admin_color) )
       			$admin_color = 'fresh';
       		$admin_color = preg_replace('|[^a-z0-9 _.\-@]|i', '', $admin_color);
   
       		if ( empty($use_ssl) )
       			$use_ssl = 0;
   
       		if ( empty($user_registered) )
       			$user_registered = gmdate('Y-m-d H:i:s');
   
       		if ( empty($show_admin_bar_front) )
       			$show_admin_bar_front = 'true';
   
       		$user_nicename_check = $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND user_login != %s LIMIT 1" , $user_nicename, $user_login));
   
       		if ( $user_nicename_check ) {
       			$suffix = 2;
       			while ($user_nicename_check) {
       				$alt_user_nicename = $user_nicename . "-$suffix";
       				$user_nicename_check = $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND user_login != %s LIMIT 1" , $alt_user_nicename, $user_login));
       				$suffix++;
       			}
       			$user_nicename = $alt_user_nicename;
       		}
   
       		$data = compact( 'user_pass', 'user_email', 'user_url', 'user_nicename', 'display_name', 'user_registered' );
       		$data = stripslashes_deep( $data );
   
       		if ( $update ) {
       			$wpdb->update( $wpdb->users, $data, compact( 'ID' ) );
       			$user_id = (int) $ID;
       		} else {
       			$wpdb->insert( $wpdb->users, $data + compact( 'user_login' ) );
       			$user_id = (int) $wpdb->insert_id;
       		}
   
       		$user = new WP_User( $user_id );
   
       		foreach ( _get_additional_user_keys( $user ) as $key ) {
       			if ( isset( $$key ) )
       				update_user_meta( $user_id, $key, $$key );
       		}
   
       		if ( isset($role) )
       			$user->set_role($role);
       		elseif ( !$update )
       		$user->set_role(get_option('default_role'));
   
       		wp_cache_delete($user_id, 'users');
       		wp_cache_delete($user_login, 'userlogins');
   
       		if ( $update )
       			do_action('profile_update', $user_id, $old_user_data);
       		else
       			do_action('user_register', $user_id);
   
       		return $user_id;
       	}
       ```
   
 * Also, here’s an example data array that would be used as an argument for the 
   above method:
 *     ```
       array('user_login'=>$username,'user_pass'=>$password,'user_nicename'=>$username,'user_email'=>$email,'user_registered'=>$date,'display_name'=>$fullname,'first_name'=>$first_name,'last_name'=>$last_name)
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: ["Login Error!" message always appears in login form.](https://wordpress.org/support/topic/login-error-message-always-appears-in-login-form/)
 *  Thread Starter [fpg](https://wordpress.org/support/users/fpg/)
 * (@fpg)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/login-error-message-always-appears-in-login-form/#post-4206170)
 * We used a CSV file and looped through using a series of WordPress methods to 
   build the user.
 * The only table it touches is the WP User’s table though, which is why it’s confusing
   that the issue still occurs after we’ve removed those users from the database
   via phpMyAdmin.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WPBook] [Plugin: WPBook] Updated to 2.3.3, starting getting internal 500 errors on posting](https://wordpress.org/support/topic/plugin-wpbook-updated-to-233-starting-getting-internal-500-errors-on-posting/)
 *  Thread Starter [fpg](https://wordpress.org/support/users/fpg/)
 * (@fpg)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-wpbook-updated-to-233-starting-getting-internal-500-errors-on-posting/#post-2512594)
 * I believe it was 2.2.3 that we upgraded from.
 * Check permissions page takes me to the App where the posts seem to be getting
   published strangely enough.
 * No message, it goes to the general 500 server error page.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Filter/Action hook once file is uploaded?](https://wordpress.org/support/topic/filteraction-hook-once-file-is-uploaded/)
 *  Thread Starter [fpg](https://wordpress.org/support/users/fpg/)
 * (@fpg)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/filteraction-hook-once-file-is-uploaded/#post-2224254)
 * Did some more digging into add_attachment. This action fires too early for what
   I’m needing it to do. It fires after the image is uploaded but before its 3 additional
   sizes (Thumbnail, Medium, Large) are created in the same folder.
 * Anyone know of an Action that fires AFTER these files are created?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Order custom posts by ASC menu_order and DESC date](https://wordpress.org/support/topic/order-custom-posts-by-asc-menu_order-and-desc-date/)
 *  Thread Starter [fpg](https://wordpress.org/support/users/fpg/)
 * (@fpg)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/order-custom-posts-by-asc-menu_order-and-desc-date/#post-2186857)
 * In the interim (till I find a better solution), if someone comes across this 
   thread with the same issue, here’s the quick and easy JS solution (throw in your
   functions.php file):
 *     ```
       function marqueeDefaultOrder(){
       	echo '<script>
       	jQuery(document).ready(function(){
       		if(jQuery("#marquee_options").length > 0){
       			jQuery("#menu_order").val(100);
       		}
       	});
       	</script>';
       }
       add_action( 'admin_head-post-new.php', 'marqueeDefaultOrder');
       ```
   
 * Just be sure to replace “#marquee_options” with a unique selector on your Post
   Type page. If you want it for every post type, just remove that if statement 
   entirely.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Order custom posts by ASC menu_order and DESC date](https://wordpress.org/support/topic/order-custom-posts-by-asc-menu_order-and-desc-date/)
 *  Thread Starter [fpg](https://wordpress.org/support/users/fpg/)
 * (@fpg)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/order-custom-posts-by-asc-menu_order-and-desc-date/#post-2186821)
 * Another solution that isn’t as ideal would be to set the default menu order to
   something like 10 instead of 0 for my custom post type, but I wasn’t able to 
   find the flexibility to do so in register_post_type() and I’m even less inclined
   to implement a JS solution (though I will if need be).
 * Again, any suggestions would be appreciated.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Creating cookies on login](https://wordpress.org/support/topic/creating-cookies-on-login/)
 *  Thread Starter [fpg](https://wordpress.org/support/users/fpg/)
 * (@fpg)
 * [18 years, 10 months ago](https://wordpress.org/support/topic/creating-cookies-on-login/#post-598391)
 * Anyone know about how WordPress creates these cookies?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Add session data and retrieve](https://wordpress.org/support/topic/add-session-data-and-retrieve/)
 *  Thread Starter [fpg](https://wordpress.org/support/users/fpg/)
 * (@fpg)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/add-session-data-and-retrieve/#post-596894)
 * I found in the wordpress codex: [http://codex.wordpress.org/WordPress_Cookies](http://codex.wordpress.org/WordPress_Cookies)
 * That WordPress uses cookies that it creates in the ‘/wp-includes/pluggable-functions.
   php’ file. I added an additional setcookie function inside of the wp_setcookie
   function to see if I could create an additional cookie at startup. When I logged
   out and logged back in the new cookie did not create. Does anyone know why?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [RSS Feed Problems](https://wordpress.org/support/topic/rss-feed-problems/)
 *  [fpg](https://wordpress.org/support/users/fpg/)
 * (@fpg)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/rss-feed-problems/page/3/#post-93057)
 * My RSS feeds show up fine in my browser. However my problem is trying to read
   it with PHP. I’m trying to parse out the information. My host uses a script called
   CURL to pull in information. However when I pull in the RSS information with 
   CURL the information it prints looks like it’s about the feed not nessecarily
   with the feed. Anyone have any luck reading in their RSS feed via CURL or even
   file_get_contents?

Viewing 11 replies - 1 through 11 (of 11 total)