Last active
February 14, 2022 10:12
-
-
Save julien731/a247c8927e2a5c8adf5e to your computer and use it in GitHub Desktop.
Awesome Support Custom Fields Starter Kit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 */ | |
/* Do NOT write anything after this line */ | |
} |
After add awesome-support-custom-fields.php in the plugin folder, we must return to the plugin page. And you must activate the new plugin which named "Awesome Support: My Custom Fields", then the filed can be used in the ticket page.
I downloaded the "Code Snippet" plugin and put the following code inside.
add_action ('after_setup_theme', 'wpas_user_custom_fields');
function wpas_user_custom_fields () {
if (function_exists ('wpas_add_custom_field')) {
wpas_add_custom_field ('my_custom_field', array ('title' => __ ('My Custom Field', 'awesome-support')));
}
}
Hi, its possible get the department tag to send in email notification?
Hi, I added the code in the plugins folder as per the given description click here and active this plugin but now I'm not sure where to see the output of this code.
Thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Following these examples doesn't have any effect. Are there any additional options in the admin interface that need to be enable in order for custom fields to show up in the "Fields" Settings tab? Additionally, do custom fields even work with Remote Tickets in the first place?