WordPress.org

Support

Support » Plugins and Hacks » [Resolved] AddQuicktag and Custom Post Types

[Resolved] AddQuicktag and Custom Post Types

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Frank Bueltge
    Participant

    @bueltge

    thanks for the message!

    Li-An
    Participant

    @li-an

    Thank you for the tip !

    Syamsul Alam
    Member

    @syamsul-alam

    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 😀

    Syamsul Alam
    Member

    @syamsul-alam

    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.

    Plugin Author Frank Bueltge
    Participant

    @bueltge

    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] AddQuicktag and Custom Post Types’ is closed to new replies.