WordPress.org

Ready to get started?Download WordPress

Forums

WP Survey And Quiz Tool
[resolved] Additional custom field for PDF certification (3 posts)

  1. Contemplative Computing
    Member
    Posted 2 years ago #

    Hi guys,

    I'm wondering if anybody knows how to add an extra shortcode variable to the PDF output. I need my certification PDFs to display quiz-taker's license numbers, which I can add as a required field in their profile through another plugin. I just don't know quite how to pull this field into the PDF output.

    I found shortcode.php and see where I'd add the new shortcode, I just don't know quite enough about php/mysql to work this out on my own.

    Any thoughts?

    Thanks,
    Matthew

    http://wordpress.org/extend/plugins/wp-survey-and-quiz-tool/

  2. Backie
    Member
    Posted 2 years ago #

    add_filter('wpsqt_replacement_tokens','filter_add_token');
    function filter_add_token($objTokens) {
       $objTokens->addToken ( 'tokenName', 'description of the token, this will appear in the token list on the admin dashboard where listed', 'tokenValue' );
    }
    
    // if you don't know the value at the set process which is done early and often so might not be wise to do the logic each time the list is generated.
    add_filter('wpsqt_set_token_values','filter_token_values');
    function filter_token_values($objTokens) {
       $objTokens->setTokenValue('tokenName', 'tokenValue');
    }

    Some code like that above. Do that in your own plugin file so that any updates won't break your install.

  3. Contemplative Computing
    Member
    Posted 2 years ago #

    Thanks! Figured it out on my own using pretty much exactly what you described.

    Very happy with the cimy extra field plugin, which has great documentation about how to pull the value for its additional fields.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic