How to create edit profile page for users on frontend with custom fields in WordPress?

Posted by Jessica Taylor | Updated on | WordPress


Want to create edit profile page for users on frontend with custom fields in WordPress? You can add extra user fields in wp-admin, for the users. Use this in your functions.php file, or in your …

How to add custom roles as well as remove default roles in WordPress?

Posted by Jessica Taylor | Updated on | WordPress


If you want to add custom roles as well as remove default roles in WordPress? Use following code in your theme’s functions.php file OR in site specific plugin.

How to get parent category ID in WordPress?

Posted by Jessica Taylor | Updated on | WordPress


Want to get parent category ID in WordPress? Below is an example to get parent category ID in WordPress?

How to insert query in WordPress database?

Posted by Jessica Taylor | Updated on | WordPress


Want to insert query in WordPress database? Below is an example of how to insert in database in WordPress. Below example is to select data from database in WordPress. Another example of retrieve and display …

How to insert shortcode into WordPress menu?

Posted by Jessica Taylor | Updated on | WordPress


Want to insert shortcode into WordPress menu? Use following code in your theme’s functions.php file OR in site specific plugin.

WordPress Media Uploader with size select

Posted by Jessica Taylor | Updated on | WordPress


In this example, we have shared WordPress Media Uploader with size select. You could use the media insertion dialog as shown on the “edit page” site, which adds alignment, link_to and size input fields. To …

How to WooCommerce coupons are stored in Database?

Posted by Jessica Taylor | Updated on | WooCommerce


Want to WooCommerce coupons are stored in Database? WooCommerce Coupon are stored in wp_posts table with post_type => ‘shop_coupon’. And all the associated data are stored in wp_postmeta table. You can use this MySQL query …

How to get product tags in array in WooCommerce?

Posted by Jessica Taylor | Updated on | WooCommerce


If you want to get product tags in array in WooCommerce? You need to loop through the array and create a separate array to check in_array() because get_terms() return object with in array.

WordPress query pages with certain template

Posted by Jessica Taylor | Updated on | WordPress


In this example, I have shared WordPress query pages with certain template. if post_type is left out WP will look for post, and you are looking for pages.

What are static factory methods?

Posted by Jessica Taylor | Updated on | Java


In this answer, I have shared what are static factory methods? We avoid providing direct access to database connections because they are resource intensive. So we use a static factory method getDbConnection that creates a …

How to convert a String to CharSequence in Java?

Posted by Jessica Taylor | Updated on | Java


If you want to convert a String to CharSequence? Since String IS-A CharSequence, you can pass a String wherever you need a CharSequence, or assign a String to a CharSequence: If you want to convert …

How to get the current class name in Java?

Posted by Jessica Taylor | Updated on | Java


If you want to get the current class name in Java? The “$1″ is not “useless non-sense”. If your class is anonymous, a number is appended. If you don’t want the class itself, but its …

How to clone ArrayList and also clone its contents?

Posted by Jessica Taylor | Updated on | Java


If you want to clone ArrayList and also clone its contents? You will need to iterate on the items, and clone them one by one, putting the clones in your result array as you go. …

How to create a memory leak in Java?

Posted by Jessica Taylor | Updated on | Java


Want to create a memory leak in Java? A simple thing to do is to use a HashSet with an incorrect (or non-existent) hashCode() or equals(), and then keep adding “duplicates”. Instead of ignoring duplicates …

How to convert JSON data into a Python object?

Posted by Jessica Taylor | Updated on | Python


Want to convert JSON data into a Python object? You can do it in one line, using named-tuple and object_hook: or, to reuse this easily: If you want it to handle keys that aren’t good …