Add extra columns in WordPress admin custom post types

add_filter( ‘manage_{custom_post_type}_posts_columns’, ‘set_custom_post_type_edit_columns’ );
function set_custom_post_type_edit_columns($columns){
$columns[‘user_mail’] = __( ‘Email’, ‘your_text_domain’ );
return $columns;
}
add_action( ‘manage_{custom_post_type}_posts_custom_column’ , ‘custom_post_type_column’, 10, 2 );
function custom_post_type_column( $column, $post_id ) {
switch ( $column ) {
case ‘user_mail’ :
echo get_post_meta( $post_id , ‘user_mail’ , true );
break;
}
}

Advertisements

jQuery validation to allow only numbers OR only characters

Allow only numbers 
$(‘#zip’).keypress(function(event){

if(event.which != 8 && isNaN(String.fromCharCode(event.which))){

event.preventDefault();

}
});

Allow Characters with dots
$(‘#name’).keypress(function(event){

var inputValue = event.charCode;  if(!(inputValue >= 65 && inputValue <= 120) && (inputValue != 32 && inputValue != 0  && inputValue != 46)){

event.preventDefault();

}

});

Changing your home network IP address

  1. Open the Control Panel.
  2. Click on the Network and Sharing Center icon.
  3. In the View your active networks section, click the Local Area Connection or Ethernet link.
  4. On the Local Area Connection or Ethernet Status window, click the Properties button.
  5. In the Properties window, select the Internet Protocol Version 6 (TCP/IPv6) or Internet Protocol Version 4 (TCP/IPv4) connection and click the Properties button. The connection you select depends on the type of Internet protocol in use for your Internet or Network connection.
  6. In the Internet Protocol properties window, select the Use the following IP address option if not already selected. Specify the new IP address you want to use. You also need to specify the subnet mask and default gateway.