Add Fields To Custom Taxonomy

As a WordPress developer, some times we need to add fields to custom taxonomy. So, in this post we are going through the code snippet for adding field to taxonomy. Let have a look,

Here we are taking the taxonomy named `product_cat` which is the woocommerce product category and we are adding the field to feature product categories in woocommerce

/** Add Custom Field To Category Form */
add_action( 'product_cat_add_form_fields', 'product_cat_taxonomy_custom_fields', 10, 2 );
add_action( 'product_cat_edit_form_fields', 'product_cat_taxonomy_custom_fields', 10, 2 );
function product_cat_taxonomy_custom_fields($tag) {  
   // Check for existing taxonomy meta for the term you're editing  
   $t_id = $tag->term_id; // Get the ID of the term you're editing  
   $term_meta = get_option( "product_cat_featured_$t_id" ); // Do the check  
?>  
  
<tr class="form-field">  
    <th scope="row" valign="top">  
        <label for="presenter_id"><?php _e('Featured'); ?></label>  
    </th>  
    <td>  
      <select name="featured" id="featured" class="postform">
	<option value="0">Select</option>
	<option <?= $term_meta=='Yes'?'selected':'' ?>   value="Yes">Yes</option>
	<option <?= $term_meta=='No'?'selected':'' ?>   value="No">No</option> 
</select> 
    </td>  
</tr>  
  
<?php  
}  

The above code allows us to add out html code to the add new page and edit taxonomy page
we can modify to this to any html you need.
Add Fields To Custom Taxonomy
The only thing to note here is to keep the name of the field we created and we need that to save the data to the database

Now the second part of the code is to save the data to the database

/** Save Custom Field Of Category Form */
add_action( 'created_product_cat', 'product_cat_form_custom_field_save', 10, 2 );	
add_action( 'edited_product_cat', 'product_cat_form_custom_field_save', 10, 2 );
 
function product_cat_form_custom_field_save( $term_id, $tt_id ) {
 
	if ( isset( $_POST['featured'] ) ) {			
		$option_name = 'product_cat_featured_' . $term_id;
		update_option( $option_name, $_POST['featured'] );
	}
}

Hope this will help you to add fields to custom taxonomy and you can easily modify this code to you taxonomy
the only thing you need to change is `product_cat` and the name of the field

Check if static block is enabled in magento

In this post we are discussing about how we can check if static block is enabled in magento
For that first we need to create an static block and please note down the block identifier, we need the block identifier to check its active or not

Now here is the code to do so

Mage::getModel('cms/block')->load('identifier')->getIsActive()

In the above code replace the identifier with the one we created

WhatsApp Bans Users for Using WhatsApp Plus

Whatsapp bans users for using third part app for whatsapp named whatsapp plus and its been stated in their FAQ section

WhatsApp Plus is an application that was not developed by WhatsApp, nor is it authorized by WhatsApp. The developers of WhatsApp Plus have no relationship to WhatsApp, and we do not support WhatsApp Plus. Please be aware that WhatsApp Plus contains source code which WhatsApp cannot guarantee as safe and that your private information is potentially being passed to 3rd parties without your knowledge or authorization.

Please uninstall your application and install an authorized version of WhatsApp from ourwebsite or Google Play. Then, you will be able to use WhatsApp.

In reply WhatsApp Plus says

All the whatsapp plus users do give a negative ratings and review on the original version on playstore or appstore…

WhatsApp Plus inc.   WhatsAppPlusinc    Twitter

The company is now asking users to uninstall WhatsApp+ and install an authorised version of WhatsApp from official website or Google Play to reuse the service, although the 24-hour ban period will reportedly remain in effect for the full duration despite replacing or uninstalling the app.

DoT Reportedly Orders Blocking of 32 Websites Including GitHub, Archive.org, SourceForge

Several websites, including many software development resources such as GitHub and SourceForge, along with research resources like the Internet Archive have all been blocked on order of the Department of Telecom. A letter circulating online shows a list of 32 URLs that ISPs have reportedly been ordered to block, with most of these URLs being entire websites, instead of specific webpages that’s usually been the case with such blocks in the past.

blocked_sites_dec14

Such blocks in the past have been due to John Doe orders but the fact it is targeting software development sites like Github and Sourceforge is strange – the John Doe orders have specifically been used to block piracy of films, and blocking off sites that have no connection to movies makes no sense.

Arvind Gupta, the National Head of the BJP IT cell also took to Twitter, stating that these websites were being blocked for security reasons, based on the advice of the Anti-Terrorism Squad. According to Gupta’s Tweets, the sites were being unblocked as soon as they removed “objectionable materials”, allegedly related to ISIS.