WordPress.org

Ready to get started?Download WordPress

Forums

Call function in wysiwyg editor (2 posts)

  1. Niellles
    Member
    Posted 1 year ago #

    Hi there,

    I'm currently writing my first plugin.

    I finished most of the functions and now I want my other admins to be able to call one of the functions in the wysiwyg-editor when creating a new page.

    Something similar to {event_description} in the WP-events calendar that shows the description of that particular event.

    The function shows a form, sends an email and calls to another function (to create a PDF as an attachment for the email).

    Could anyone help me with this?

    The function looks like this:

    function kna_user_contents(){
        include('plugins/knakaartenapp/kna_user_pagina.php');
    }

    Kind regards,

    Niels

  2. michael.mariart
    Member
    Posted 1 year ago #

    The most recommended way for doing this is actually the easiest as well.

    What you need to do is register a shortcode that will call that function. Have a look at the Shortcode API page, and you'll be able to see how it's done.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.