Blog

SCSS Nested Styling Example

User .project-grid-container .grid-item h4, .project-grid-container .grid-item p { color:$color-primary; } applly above scss nested Assistant To apply the given SCSS style with proper nesting, you can organize it like this: .project-grid-container { .grid-item { h4, p { color: $color-primary; } } } ### Explanation: – The `project-grid-container` is the parent selector. – Inside it, the […]

Get Custom Post Type Categories

User get custom post type cateogires by post id Assistant To get the categories (or terms) of a custom post type by its post ID in WordPress, you can use the `wp_get_post_terms` function. Here's an example: ### Code Example: <?php // Replace with your custom post ID $post_id = 123; // Replace 'your_taxonomy' with the […]

Web Development Experience Summary

User With over 10 years of extensive experience in web development, I specialize in PHP frameworks such as Laravel, CakePHP, and WordPress. I have advanced proficiency in frontend technologies, including Angular (version 7 and above) and Vue.js. My expertise also extends to version control systems, including Git, GitHub, and Bitbucket. I am highly adaptable and […]

Gravity Forms Validation Issue

User update gravity form to 2.9 then form submit without even fields not validated Assistant If your Gravity Forms plugin is auto-submitting forms without validating fields after updating to version 2.9, it's likely due to a conflict or a bug introduced during the update. Here's how you can resolve this issue: ### Steps to Fix […]

jQuery Elementor Backend Issue

User jQuery(document).ready(function($) { var fileFrame; $('.gallery-upload-button').on('click', function(e) { e.preventDefault(); // If the media frame already exists, reopen it. if (fileFrame) { fileFrame.open(); return; } // Create a new media frame fileFrame = wp.media({ title: 'Select Images', button: { text: 'Add to Gallery' }, multiple: true }); // When an image is selected, run a callback. […]

Add Entry ID to Order

User ?product_id=244444&quantity=1&entry_id=90 when add to cart and ordered successfully then add entry_id in postmeta table based on order id Assistant To achieve this in WordPress (likely WooCommerce, based on the context), you can hook into the WooCommerce order creation process and add the `entry_id` as post meta for the order. Here's how you can implement […]

Optimizing WooCommerce Order Updates

User add_action( 'woocommerce_order_status_dispensing', 'track_prescriber', 999, 2 ); function track_prescriber($order_id, $order){ $user_id = get_current_user_id(); update_post_meta($order_id,'_prescriber_id',$user_id); } This hook taking time to update _prescriber_id if we selected more than 100 orders in wp-admin Assistant The delay occurs because the `woocommerce_order_status_dispensing` hook runs for every order you select. When you select 100+ orders, WordPress processes this hook for […]

WooCommerce Order Status Overview

User woocommerce_order_status Assistant The `woocommerce_order_status` in WooCommerce represents the current state of an order. WooCommerce provides several built-in statuses that help track the order lifecycle, from creation to completion or cancellation. Below are the common order statuses: ### Built-in Order Statuses 1. **Pending Payment** (`pending`): – Order created but awaiting payment. – Stock is not […]

Custom WooCommerce Order Status

User woocommerce_order_status_dispensing Assistant In WooCommerce, to add a custom order status like `dispensing`, you can follow these steps: ### 1. Add the Custom Order Status You can use the `register_post_status` function to register a new order status and then add it to the list of order statuses using WooCommerce hooks. Here’s a code snippet to […]

WooCommerce PDF Invoice Customization

User add_filter('pdf_content_additional_content','woocommerce_pdf_invoice_new_labels',10,2); function woocommerce_pdf_invoice_new_labels( $content , $order_id){ $sign_img =''; $prescriber_id = get_post_meta($order_id,'_prescriber_id',true); $user_info = get_userdata($prescriber_id); $prescriber_name = isset($user_info->display_name) && $user_info->display_name!='' ? $user_info->display_name : $user_info->user_nicename; $prescriber_sign = get_user_meta($prescriber_id,'prescriber_signature',true); if($prescriber_sign){ $sign_url = wp_get_attachment_url($prescriber_sign); $sign_url = str_replace(site_url('/'),'',$sign_url); $sign_img =''; } $content = str_replace( '[[BILLING_FNAME]]', get_post_meta( $order_id,'_billing_first_name',TRUE ),$content); $content = str_replace( '[[BILLING_LNAME]]', get_post_meta( $order_id,'_billing_last_name',TRUE ),$content); $content = str_replace( '[[BILLING_DOB]]', […]