/** * This code adds a video repeater field to specific Gravity Forms (IDs 3 and 10), pre-populates it with data from * ACF fields related to vendors or venues, and saves the submitted video gallery data back to the…Continue reading
/** * * Retrieve post ID by user ID and post type (either ‘vendor’ or ‘venue’). * * @param int $user_id The current user’s ID. * @param string $post_type The post type to search for (‘vendor’ or ‘venue’). * @return…Continue reading
/** * * Retrieve post ID by user ID and post type (either ‘vendor’ or ‘venue’). * * @param int $user_id The current user’s ID. * @param string $post_type The post type to search for (‘vendor’ or ‘venue’). * @return…Continue reading
/** * Conditionally show the submit button * * @link https://wpforms.com/developers/how-to-conditionally-show-the-submit-button/ */ add_action( ‘wp_head’, function () { ?>Continue reading
remove_action(‘woocommerce_single_product_summary’,’woocommerce_template_single_meta’,40);Continue reading
function custom_default_avatar($avatar_defaults) { $myavatar = ‘https://pharmacyneeds.gr/wp-content/uploads/2024/06/PharamcyNeeds-Logo-User.png.png’; $avatar_defaults[$myavatar] = “Default Avatar”; return $avatar_defaults; } add_filter(‘avatar_defaults’, ‘custom_default_avatar’); function set_custom_avatar( $avatar, $id_or_email, $size, $default, $alt ) { $custom_avatar_url = ‘https://pharmacyneeds.gr/wp-content/uploads/2024/06/PharamcyNeeds-Logo-User.png.png’; // Check if the user has a gravatar $user_avatar = get_avatar_data($id_or_email); // If…Continue reading
function check_disposable_email_domains($user_id) { // Λήψη του email του χρήστη με το user ID $user_info = get_userdata($user_id); $user_email = $user_info->user_email; // Extensive list of temporary email domains it wants you to block $blocked_domains = array( ‘secmail.pro’, ‘secmail.net’, ‘secmail.org’, ‘secmail.com’, ‘tempmail.com’,’1secmail.com’, ’10minutemail.com’,…Continue reading
function display_user_biography_in_order_page( $post ) { // دریافت ID کاربر بر اساس سفارش $order = wc_get_order( $post->ID ); $user_id = $order->get_user_id(); // دریافت بیوگرافی کاربر از پروفایل $user_bio = get_user_meta( $user_id, ‘description’, true ); // بررسی اینکه آیا بیوگرافی وجود دارد…Continue reading
// Disable WooCommerce Header in WordPress Admin add_action(‘admin_head’, ‘Hide_WooCommerce_Breadcrumb’); function Hide_WooCommerce_Breadcrumb() { echo ‘ ‘; } $current_user = wp_get_current_user(); if (!current_user_can(‘poshtiban’)) { add_filter(‘show_admin_bar’, ‘__return_false’); } else if (in_array(‘poshtiban’, $current_user->roles)) { add_action(‘admin_head’, ‘Custom_Style_For_Poshtiban’); } function Custom_Style_For_Poshtiban() { echo ‘ ‘; }…Continue reading