Select Read/Write permissions.
Category: Word Press
Create a text field in the product data field in the product Data section in woocommerce
// image 5 function add_image_5_meta_field() { global $post; // Get the existing value $image_5 = get_post_meta($post->ID, ‘image_5’, true); // Output the field echo ‘<div class=”options_group”>’; woocommerce_wp_text_input( array( ‘id’ => ‘image_5’, ‘label’ => __(‘Image_5’, ‘woocommerce’), // Updated label ‘placeholder’ => __(‘Enter Image_5 Time’, ‘woocommerce’), ‘desc_tip’ => ‘true’, ‘description’ => __(‘This is a custom meta field for Image_5 time.’, ‘woocommerce’),… Continue reading Create a text field in the product data field in the product Data section in woocommerce
Create a custom inside a product Admin Page to create a editor field
// Add Feature overview meta field to product admin page function add_feature_description_meta_field() { global $post; // Get the existing value $feature_description = get_post_meta($post->ID, ‘feature_description’, true); // Output the field echo ‘<div class=”options_group”>’; echo ‘<p class=”form-field”> <bold><label for=”sub_description”>’ . esc_html__(‘Feature Description’, ‘woocommerce’) . ‘</label></bold> </p>’; wp_editor( $feature_description, ‘feature_description’, array( ‘textarea_name’ => ‘feature_description’, ‘label’ => __(‘Sub Description’, ‘woo… Continue reading Create a custom inside a product Admin Page to create a editor field
Create a custom field on the WooCommerce Category Admin page
function add_custom_category_image() { ?> <div class=”form-field”> <label for=”category_image”><?php esc_html_e(‘Category Image’, ‘textdomain’); ?></label> <input type=”text” name=”category_image” id=”category_image” value=””> <p class=”description”><?php esc_html_e(‘Enter category image URL for this category.’, ‘textdomain’); ?></p> </div> <?php } add_action(‘product_cat_add_form_fields’, ‘add_custom_category_image’, 10, 2); // Save custom category image data when creating or updating a category function save_custom_category_image($term_id) { if (isset($_POST[‘category_image’])) { update_term_meta($term_id, ‘category_image’,… Continue reading Create a custom field on the WooCommerce Category Admin page
To Overide the WooCommerce Templates
add_theme_support( ‘woocommerce’ ); need to Add the following to functions.php After adding this we can override the WooCommerce templates like Archieve-product.php Taxnomy-product_cat.php Single-product.php Files for the Category main page which includes the main categories and the next file includes the subcategory category and Product page with the category is listed in the Taxnomy-product_cat.php file And… Continue reading To Overide the WooCommerce Templates
In wordpress, how to get the value of custom field, type=file
In WordPress, you can retrieve the value of a custom field of type “file” (an attachment) using functions and features provided by WordPress. Here are the steps to get the value of a custom field of type “file”: Custom Field Creation:First, make sure you have added a custom field to your post or page that… Continue reading In wordpress, how to get the value of custom field, type=file
Create a table in the database using code in WordPress.
Code to create a database table dynamically using PHP. Add this code to function.php or php file in plugin.
Category As Ecommerce:WordPress Coding Standard
These PHP coding standards are intended for the WordPress community as a whole. They are mandatory for WordPress Core and we encourage you to use them for your themes and plugins as well. Opening and Closing PHP Tags When embedding multi-line PHP snippets within an HTML block, the PHP open and close tags must… Continue reading Category As Ecommerce:WordPress Coding Standard