Removing plus sign in user login wordpress


/* to allow the user to regiter with email ids containing + */
add_filter( 'sanitize_user', 'plus_sanitize_user', 10, 3);
function plus_sanitize_user($username, $raw_username, $strict) {
 $new_username = strip_tags($raw_username);
 // Kill octets
 $new_username = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '', $new_username);
 $new_username = preg_replace('/&.?;/', '', $new_username); // Kill entities

// If strict, reduce to ASCII for max portability.
 if ( $strict )
 $new_username = preg_replace('|[^a-z0-9 _.\-@+]|i', '', $new_username);

return $new_username;
}

Display posts/pages



<?php
 $args = array('numberposts' => '50', 'offset' => '',
 'category' => 'product_type', 'orderby' => 'post_date',
 'order' => 'DESC',
 'include' => '', 'exclude' => '',
 'meta_key' => '','meta_value' => '',
 'post_type' => 'product', 'post_mime_type' => '', 'post_parent' => '',
 'post_status' => 'publish', 'suppress_filters' => true
 );
 $products = get_posts($args);
 foreach($products as $product) {
 echo $product->post_title; // display product title
 echo get_the_post_thumbnail( $product->ID); // display product image
 echo $product->post_content; // display product description
 }
?>

terms, taxonomy, relationships in wp



little bit of conclusion
wp_terms_taxonomy strutured in this manner:
 1) term_taxonomy_id - category id
 2) term_id - FK->wp_terms.term_id,
 3) taxonomy - eg) category = one of the taxonomy type
 4) description of category
 5) parent 0 if it is parent,
 else any term_taxonomy_id of the main category
 6) count total posts under current category
wp_terms strutured in this manner:
 1) term_id (auto_increment)
 2) name - name of the category
 3) slug - slug of the category
 4) term_group - term with multiple aliases.This feature doesn't seem to be
 fully backed and is therefore practically never used
wp_term_relationships strutured in this manner:
 1) object id - ID of a post or link
 2) term_taxonomy_id - FK->wp_term_taxonomy.term_taxonomy_id
 3) term_order - order of the terms - categories

Adding menu page in admin end with WordPress


<?php
function file_admin() {
  include 'file.php';
}
 adding menu page => inside parameters with arrangements 1) page_title, 2) menu title, 3) capability, 4) file, 5) function, 6) icon, 7) position
 add_menu_page('Caros', 'Caros', 'read', 'caros/file.php', 'file_admin', 'images/menu.png','7');
 ?>
Getting custom field values
<?php $url = get_post_custom_values('url'); echo $url[0];?>