Support » Plugin: HD Quiz » add questions with wp_insert_post func.

  • Resolved burakco

    (@burakco)


    Hello; I have a very big archive of questions. Is it possible to save these questions with the wp_insert_post function? In which file can I find the necessary variables?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Harmonic Design

    (@harmonic_design)

    Yes you can! HD Quiz uses a custom post type and taxonomy, so totally possible.

    However, please note that HD Quiz is ~5 years old now, and I named things… well, stupidly back in the day.

    HD Quiz is currently going through a large rewrite in order to modernize the way data is saved and retrieved as well as making just about every facet of HD Quiz “pluggable”.

    IF you can wait ~a week, the next version is a big revamp and will also include a basic CSV importer.

    If you can’t then the best place to take a look at is /includes/functions.php to take a look at the variables.

    here is a handy chart to help know what the question vars are currently, and the expected data type/values.

    text = sanitize_text_field
    content = wp_kses_post
    integer = integer
    checkbox = if enabled, value should be set to "yes"
    
    #name|description|type
    hdQue_post_class2|selected answer|integer
    hdQue_post_class23|use image as answers|checkbox
    hdQue_post_class24|use question as title|checkbox
    hdQue_post_class25|paginate|checkbox
    hdQue_post_class12|tooltip|text
    hdQue_post_class26|extra question text|content
    hdQue_post_class1|answer 1|text
    hdQue_post_class13|image 1|integer
    hdQue_post_class3|answer 2|text
    hdQue_post_class14|image 2|integer
    hdQue_post_class4|answer 3|text
    hdQue_post_class15|image 3|integer
    hdQue_post_class5|answer 4|text
    hdQue_post_class16|image 4|integer
    hdQue_post_class6|answer 5|text
    hdQue_post_class17|image 5|integer
    hdQue_post_class7|answer 6|text
    hdQue_post_class18|image 6|integer
    hdQue_post_class8|answer 7|text
    hdQue_post_class19|image 7|integer
    hdQue_post_class9|answer 8|text
    hdQue_post_class20|image 8|integer
    hdQue_post_class10|answer 9|text
    hdQue_post_class21|image 9|integer
    hdQue_post_class11|answer 10|text
    hdQue_post_class22|image 10|integer
    Thread Starter burakco

    (@burakco)

    thank you,i will wait update πŸ™‚

    Thread Starter burakco

    (@burakco)

    I think the update will be a little delay?

    i have some questions :

    1-) is “hdQue_post_class2” using for correct answers?

    2-) is that true?
    #name|description|type
    hdQue_post_class2|CORRECT answer|META_ID
    META_ID = hdQue_post_class13|image 1|UPLOADED_IMAGE_ID

    • This reply was modified 2 years, 4 months ago by burakco.
    Plugin Author Harmonic Design

    (@harmonic_design)

    Hi burakco,
    please contact me at harmonicdesign.ca and I’ll send you the next version of HD Quiz.

    If not, let me know and I can expand on the the meta data you need

    Thread Starter burakco

    (@burakco)

    i filled free quote form on your website πŸ™‚

    hi, can you give us the the way data is saved at the new version?

    Plugin Author Harmonic Design

    (@harmonic_design)

    I’ll be pushing the next version out tomorrow πŸ™‚

    Once released, you can take a look at ./includes/tools/data_upgrade.php to see how the data is saved. Basically, it’s an array with each field having a key for type and value. Type is the type of input (text, textarea, checkbox, radio, select, integer, float, editor).

    i hope that wordpress table “postmeta” where the data is saved and retrieved remain the same.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘add questions with wp_insert_post func.’ is closed to new replies.