Create wp_editor/Custom editor in wordpress/Woo-commerce.
add_action("admin_init", "certifications");
add_action('save_post', 'save_subdescription');
function certifications(){
add_meta_box("sub_description", "Certifications", "meta_function", "product");
}
function meta_function(){
global $post;
$custom = get_post_custom($post->ID);
$sub_description = $custom["sub_description"][0];
wp_editor( $sub_description, 'certifications', $settings =
array('textarea_name'=>'sub_description','dfw'=>true) );
}
function save_subdescription(){
global $post;
update_post_meta($post->ID, "sub_description", $_POST["sub_description"]);
}
function show_certification_content(){
echo get_post_meta( get_the_ID(), 'sub_description', true );
//echo get_the_content();
}
add_action('woocommerce_before_single_product_summary','show_certification_content');
add_action("admin_init", "certifications");
add_action('save_post', 'save_subdescription');
function certifications(){
add_meta_box("sub_description", "Certifications", "meta_function", "product");
}
function meta_function(){
global $post;
$custom = get_post_custom($post->ID);
$sub_description = $custom["sub_description"][0];
wp_editor( $sub_description, 'certifications', $settings =
array('textarea_name'=>'sub_description','dfw'=>true) );
}
function save_subdescription(){
global $post;
update_post_meta($post->ID, "sub_description", $_POST["sub_description"]);
}
function show_certification_content(){
echo get_post_meta( get_the_ID(), 'sub_description', true );
//echo get_the_content();
}
add_action('woocommerce_before_single_product_summary','show_certification_content');
Comments
Post a Comment