Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@plugin-republic
Last active June 14, 2019 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plugin-republic/4cdd159cb665b6c61fdd6c00f0f183e7 to your computer and use it in GitHub Desktop.
Save plugin-republic/4cdd159cb665b6c61fdd6c00f0f183e7 to your computer and use it in GitHub Desktop.
<?php
/**
* Display a custom text field
* @since 1.0.0
*/
function cfwc_create_custom_field() {
woocommerce_wp_text_input(
array(
'id' => 'custom_text_field_title',
'label' => __( 'Custom Text Field Title', 'cfwc' ),
'class' => 'cfwc-custom-field',
'desc_tip' => true,
'description' => __( 'Enter the title of your custom text field.', 'ctwc' ),
)
);
}
add_action( 'woocommerce_product_options_general_product_data', 'cfwc_create_custom_field' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment