Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author julien731

    (@julien731)

    It is possible. Please see the documentation regarding custom fields: https://getawesomesupport.com/documentation/awesome-support/custom-fields/

    Thread Starter elvis75

    (@elvis75)

    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 */
    }

    Plugin Author julien731

    (@julien731)

    Could you please try replacing the code from add_action to 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' ) ) );
    }
    Thread Starter elvis75

    (@elvis75)

    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.php

    Is 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 */
    }

    Plugin Author julien731

    (@julien731)

    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.

    Thread Starter elvis75

    (@elvis75)

    Ok thanks. No, I had not activated it before. I will see if that fixes it.

Viewing 6 replies - 1 through 6 (of 6 total)

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