Skip to content

Instantly share code, notes, and snippets.

View hemraj7171's full-sized avatar

Hemraj Adhikari hemraj7171

  • Web Experts Nepal(WEN)
  • Kathmandu,Nepal
View GitHub Profile
@yassiryahya
yassiryahya / functions.php
Created November 24, 2011 16:46
Assigning Role On Wordpress Registration & Profile Page
<?php
// Add two new role.
// Full list of capabilities can be found at http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table
add_role('writer', 'Writer', array(
'delete_posts' => true,
'delete_published_posts' => true,
'edit_posts' => true,
'edit_published_posts' => true,
'publish_posts' => true,
'read' => true,
@digamber89
digamber89 / autocomplete-orders.php
Created October 29, 2015 05:44
Autocomplete Orders
/**
* Auto Complete all WooCommerce orders.
*/
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
function custom_woocommerce_auto_complete_order( $order_id ) {
if ( ! $order_id ) {
return;
}
$order = wc_get_order( $order_id );