WordPress.org

Ready to get started?Download WordPress

Forums

AddQuicktag
[resolved] AddQuicktag and Custom Post Types (6 posts)

  1. Baden
    Member
    Posted 2 years ago #

    Just a quick thank-you for a wonderful plugin! We had to add the quicktags to a custom post type, and BAM, right there on the main description page was the solution.

    Well played, Mr. Bueltge... well played!

    http://wordpress.org/extend/plugins/addquicktag/

  2. Frank
    Member
    Plugin Author

    Posted 2 years ago #

    thanks for the message!

  3. Li-An
    Member
    Posted 2 years ago #

    Thank you for the tip !

  4. Syamsul Alam
    Member
    Posted 1 year ago #

    I just create custom post type for my video tutorials, using plugin called Type.

    When I try to add my custom post type to addquicktags using code below, i got error.

    // add custom function to filter hook 'addquicktag_post_types'
    add_filter( 'addquicktag_post_types', 'my_addquicktag_video-tutorial' );
    /**
     * Return array $post_types with custom post types
     *
     * @param   $post_type Array
     * @return  $post_type Array
     */
    function my_addquicktag_post_types( $post_types ) {
    
        $post_types[] = 'edit-comments';
    
        return $post_types;
    }

    Well, then I edit my files and turn it into something like this:

    // add custom function to filter hook 'addquicktag_post_types'
    add_filter( 'addquicktag_post_types', 'my_addquicktag_video_tutorial' );
    /**
     * Return array $post_types with custom post types
     *
     * @param   $post_type Array
     * @return  $post_type Array
     */
    function my_addquicktag_video_tutorial( $post_types ) {
    
        $post_types[] = 'video_tutorial';
    
        return $post_types;
    }

    I have video_tutorial inside addquicktags options page, tick the quicktags that needed, but when i go to my custom post type, nothing happens....

    I have zero knowledge in PHP lol.... please help me :D

  5. Syamsul Alam
    Member
    Posted 1 year ago #

    Additional info about my custom post type:
    - Custom post type name plural (required): Video Tutorial
    - Custom post type name singular (required): Video Tutorial
    - Slug (required): video-tutorial

    I don't know where i can see the 'name' of my custom post type. That's why...

    In past, i had success with adding custom post type on addquicktag. That's because the name of that custom post type is one word, ecourse. That's why i can make it work on first try.

    But not with 'video tutorial' which has 2 words. I don't know how should i call it in theme function. Thanks for your help and sorry for my english. Lol.

  6. Frank
    Member
    Plugin Author

    Posted 1 year ago #

    Do you have seen the example plugin for CPT?
    see here: http://plugins.svn.wordpress.org/addquicktag/trunk/addquicktag_cpt.php.example

    copy this and change to your CPT and change the name of the firl to .php.
    Do you have also problems, please send me a mail with your CPT and your custom plugin, that add this CPT to the AddQuicktag plugin.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic