Since teachpress 4.0 the plugin contains a number of various functions which are useful for using plugin data outside of the standard shortcodes. This article lists some of this functions.
The database API (since version 5.0)
The API is defined in teachpress/core/database.php.
- tp_artefacts
- get_artefact()
- get_artefacts()
- tp_assessments
- get_assessment()
- get_assessments()
- tp_authors
- tp_bookmarks
- bookmark_exists()
- get_bookmarks()
- tp_courses
- get_course()
- get_course_meta()
- get_courses()
- is_student_subscribed()
- is_owner()
- tp_documents
- tp_publications
- tp_students
- get_student()
- get_student_meta()
- get_students()
- is_student()
- tp_tags
- get_tags()
15. April 2013 at 08:25
Is there a function to get Notes?
18. April 2013 at 01:48
If you use get_tp_publications() or get_tp_publication() the return includes the notes of the selected publications or what you mean?
6. Februar 2014 at 21:33
How can I search through courses? It seems that search function just search beetween publications.
7. Februar 2014 at 13:52
There is no similar search UI like [tpsearch] for courses. But you can use the function get_tp_courses() for a search through courses. The function is defined in core/database.php (there you can find the definitions for the available parameters).
27. September 2014 at 17:20
First, I wish to thank you for the excellent plugin. I have been using it for some years and have just installed version 5 alpha.
I use the [tgcloud] shortcode for the pulldown filters, but cancel the cloud in css with display:none, because we have far too many tags.
Instead of the cloud, I would like to put the tags in a pulldown filter, the same as type, author, etc.
I think this would be a nice option, but I am willing to code if you could direct me.
Thank you so much.
28. September 2014 at 02:58
Hi chomac,
You’re not the first one which asked me for a pulldown filter of tags. So, I will add an option for that to [tpcloud]. 😉
4. November 2014 at 14:45
Is it possible to write in the note field html, like links or so? If I write there Links, I see the HTML-code on the Website
5. November 2014 at 21:17
Hi ebussinetz
I answer you in german, because that could be a bit easier. 😉
Du kannst HTML-Code mit einer kleinen Änderung im Programmcode wieder nutzbar machen:
Suche in der Datei teachpress/core/class-bibtex.php die Funktion single_publication_meta_row() und dann diese Zeile:
$note = isset( $row['techtype'] ) ? tp_bibtex::prepare_html_line('note', $row['note'],', (',')',$use_span) : '';und ändere sie in:
$note = isset( $row['techtype'] ) ? tp_bibtex::prepare_html_line('note', htmlspecialchars_decode($row['note']),', (',')',$use_span) : '';Hab’s jetzt nicht getestet, sollte aber gehen. 😉