web_dor_add_custom_field_automatically

The Business Responsive web dor add custom field automatically function.

Description

web_dor_add_custom_field_automatically( $post_ID ); 

Parameters (1)

0. $post_id
The post ID.

Usage

  1. if ( !function_exists( 'web_dor_add_custom_field_automatically' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4. // The post ID. 
  5. $post_id = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = web_dor_add_custom_field_automatically($post_id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/functions.php  
  1. function web_dor_add_custom_field_automatically($post_ID) 
  2.  
  3. if (!wp_is_post_revision($post_ID)) { 
  4.  
  5. add_post_meta($post_ID, 'field-name', 'custom value', true); 
  6.  
  7.