• Resolved imsrsm

    (@samirur)


    adding following Custom Field code not working

    
    // If this file is called directly, abort.
    if ( ! defined( 'WPINC' ) ) {
    	die;
    }
    
    add_action( 'plugins_loaded', 'wpas_user_custom_fields' );
    /**
     * Register all custom fields after the plugin is safely loaded.
     */
    function wpas_user_custom_fields() {
    /* You can start adding your custom fields safely after this line */
    
    if ( function_exists( 'wpas_add_custom_field' ) ) {
        wpas_add_custom_field( 'customer_name', 
            array(
                'title' => __( 'Customer Name', 'wpas' ),
                'field_type' => 'text',
                'required' => true
                )
            );
            
        wpas_add_custom_field( 'invoice_number', 
            array(
                'title' => __( 'Invoice Number', 'wpas' ),
                'field_type' => 'number',
                'required' => true
                )
            );
    
       wpas_add_custom_field( 'phone_number', 
            array(
                'title' => __( 'Phone Number', 'wpas' ),
                'field_type' => 'number',
                'required' => true
                )
            );
    
        }
    /* Do NOT write anything after this line */
    }
    

    Please help, thanks

    • This topic was modified 4 years, 4 months ago by imsrsm.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom Fields not working’ is closed to new replies.