test1
alert(‘haiii’);Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
alert(‘haiii’);Continue reading
#– Allow Shop Manager to access Product Feed menus –# function allow_feed_menus_to_shop_manager() { return ‘manage_woocommerce’; } add_filter( ‘woosea_user_cap’, ‘allow_feed_menus_to_shop_manager’ ); #– Add Product Feed Manage Capability to Shop Manager Role –# function add_adt_cap_to_shop_manager() { $role = get_role( ‘shop_manager’ ); if(…Continue reading
// Hook into the save_post action to set the YouTube thumbnail as the featured image function set_youtube_thumbnail_as_featured_image($post_id) { // Check if the post type is ‘video’ to avoid running on other post types if (get_post_type($post_id) !== ‘video’) { return; }…Continue reading
/** * Set a specific language Google reCAPTCHA. * * @link https://wpforms.com/developers/how-to-set-the-language-for-google-recaptcha/ */ function wpf_dev_recaptcha_language_wpml( $url ) { // Get my current language setting from WPML $my_current_lang = apply_filters( ‘wpml_current_language’, NULL ); // Set the language of my Google reCAPTCHA…Continue reading
/** * Set the language for Google reCAPTCHA. * * @link https://wpforms.com/developers/how-to-set-the-language-for-google-recaptcha/ */ function wpf_dev_recaptcha_language( $url ) { // Set the language code to FR (French) return esc_url_raw( add_query_arg( array( ‘hl’ => ‘fr ‘), $url ) ); } add_filter( ‘wpforms_frontend_recaptcha_url’,…Continue reading
/** * Prevent certain names from the other formats for the Name form field. * * @link https://wpforms.com/developers/how-to-block-names-from-completing-your-form/ */ function wpf_dev_block_name_validation( $field_id, $field_submit, $form_data ) { // Bail early if form ID is not 1000 and field ID is not…Continue reading
/** * Prevent certain names from the Simple format Name form field. * * @link https://wpforms.com/developers/how-to-block-names-from-completing-your-form/ */ function wpf_dev_block_name_validation( $field_id, $field_submit, $form_data ) { // Bail early if form ID is not 1000 and field ID is not 10 if…Continue reading
/** * Get and use the File Upload field URL * * @link https://wpforms.com/developers/how-to-get-the-url-from-the-file-upload-form-field/ */ function wpf_dev_frontend_confirmation_message( $message, $form_data, $fields, $entry_id ) { // Only run on my form with ID = 1000 if ( absint( $form_data[ ‘id’ ] )…Continue reading