/* * Remove all user entries before saving the entry – this is for all forms. * * @link https://wpforms.com/developers/how-to-overwrite-entries-from-users-who-have-already-submitted-a-form/ */ function remove_all_before_entry_save( $fields, $entry, $form_id ) { //get the current user’s user ID $user_id = get_current_user_id(); //check if the…Continue reading
/** * Remove the field label from the top of the field * * @link https://wpforms.com/developers/how-to-create-a-form-with-floating-labels/ */ function wpf_dev_display_field_before( $field, $form_data ) { // Only run this snippet on the form ID 1289 if ( absint( $form_data[ ‘id’ ] )…Continue reading
/** * Run shortcodes on the form label field. * * @link https://wpforms.com/developers/how-to-display-shortcodes-inside-the-label-of-the-form-field/ */ function add_shortcode_to_label( $field, $form_data ) { // Check that the form ID is 1055 and the field id is 4 if ( 1055 === absint( $form_data[…Continue reading
/** * Register the Smart Tag so it will be available to select in the form builder. * * @link https://wpforms.com/developers/how-to-create-a-smart-tag-from-an-acf-field/ */ function wpf_dev_register_smarttag( $tags ) { // Key is the tag, item is the tag name. $tags[ ‘portfolio_price’ ]…Continue reading
/** * Restrict address autocomplete to a specific country * * @link https://wpforms.com/developers/how-to-restrict-address-autocomplete-to-a-specific-country/ */ function wpf_dev_geo_autocomplete_default_country( ) { ?>Continue reading
// Register REST routes add_action(‘rest_api_init’, function () { register_rest_route(‘wp/v2’, ‘/delete-image’, [ ‘methods’ => ‘POST’, ‘callback’ => ‘chicpinups_delete_image’, ‘permission_callback’ => function (WP_REST_Request $request) { return chicpinups_check_api_key($request); }, ]); }); // Function to delete images and update metadata if (!function_exists(‘chicpinups_delete_image’)) { function…Continue reading
add_action( ‘after_setup_theme’, function() { update_option( ‘image_default_link_type’, ‘file’ ); });Continue reading
add_filter( ‘login_head’, function () { // Update the line below with the URL to your own logo. // Adjust the Width & Height accordingly. $custom_logo = ‘https://damore.nl/wp-content/uploads/2024/02/logo-damore-admin.png’; $logo_width = 300; $logo_height = 101; printf( ‘ ‘, $custom_logo, $logo_width, $logo_height );…Continue reading