Custom Ticket Fields
-
I want to add a couple of extra fields to the Submit Ticket form.
Is this possible?
-
It is possible. Please see the documentation regarding custom fields: https://getawesomesupport.com/documentation/awesome-support/custom-fields/
Thanks. I created a new file called awesome-support-custom-fields.php and placed it in my /plugins directory. It contains the following code form the example but the field does not display.
<?php
/**
* @package Awesome Support/Custom Fields
* @author ThemeAvenue <[email protected]>
* @license GPL-2.0+
* @link http://themeavenue.net
* @copyright 2014 ThemeAvenue
*
* @wordpress-plugin
* Plugin Name: Awesome Support: My Custom Fields
* Plugin URI: http://getawesomesupport.com
* Description: Adds custom fields to the Awesome Support ticket submission form.
* Version: 0.1.0
* Author: ThemeAvenue
* Author URI: http://themeavenue.net
* Text Domain: wpas
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Domain Path: /languages
*/// 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 */wpas_add_custom_field( ‘my_custom_field’, array( ‘title’ => __( ‘My Custom Field’, ‘wpas’ ) ) );
/* Do NOT write anything after this line */
}Could you please try replacing the code from
add_actionto the last}by the following:if ( function_exists( 'wpas_user_custom_fields' ) ) { wpas_add_custom_field( 'my_custom_field', array( 'title' => __( 'My Custom Field', 'wpas' ) ) ); }I update the file with your suggestion but I still don’t see the new field.
The file is in the /plugins directory. Ex. \wp-content\plugins\awesome-support-custom-fields.phpIs that correct? Thanks
<?php
/**
* @package Awesome Support/Custom Fields
* @author ThemeAvenue <[email protected]>
* @license GPL-2.0+
* @link http://themeavenue.net
* @copyright 2014 ThemeAvenue
*
* @wordpress-plugin
* Plugin Name: Awesome Support: My Custom Fields
* Plugin URI: http://getawesomesupport.com
* Description: Adds custom fields to the Awesome Support ticket submission form.
* Version: 0.1.0
* Author: ThemeAvenue
* Author URI: http://themeavenue.net
* Text Domain: wpas
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Domain Path: /languages
*/// If this file is called directly, abort.
if ( ! defined( ‘WPINC’ ) ) {
die;
}add_action( ‘plugins_loaded’, ‘wpas_user_custom_fields’ );
if ( function_exists( ‘wpas_user_custom_fields’ ) ) {
wpas_add_custom_field( ‘my_custom_field’, array( ‘title’ => __( ‘My Custom Field’, ‘wpas’ ) ) );
}/* Do NOT write anything after this line */
}Yes it is correct. Have you activated the plugin in your WordPress dashboard? Also, you have to remove the closing bracket after the line “/* Do NOT write anything after this line */” if you’re using the updated code I gave you.
Ok thanks. No, I had not activated it before. I will see if that fixes it.
The topic ‘Custom Ticket Fields’ is closed to new replies.