• Resolved djsava

    (@djsava)


    Hello

    I have a plugin where I need to fill in the post type to be able to add a special button in the editor for the biography.

    I don’t know if you’ll understand.

    I’m using AddQuicktag plugin for add shortcodes buttons. This plugin works well with all post types like article, page, event, announcement, media… Except with entries.

    I must to add a post type element like here :

    // add custom function to filter hook 'addquicktag_post_types'
    add_filter( 'addquicktag_post_types', 'my_addquicktag_post_types' );
    /**
     * 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[] = 'post_entry';
        return $post_types;
    }

    I put post_entry but it doesn’t work in the editor.

    Thanks for your help

    • This topic was modified 2 years, 9 months ago by djsava.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Steven

    (@shazahm1hotmailcom)

    RE: Post Type Entry

    The Connections Entry is not a post type. It uses a custom database schema optimized for directory content to allow performant scaling.

    I did take a look at the code for the AddQuicktag plugin.

    I think if you use the “post type” connections_page_connections_manage that might/should work.

    I hope this helps; please let me know.

    Thread Starter djsava

    (@djsava)

    Hello Steven and thanks for your quick reply.

    Unfortunately it doesn’t work.

    I tested with connections_page, or connections_manage only too, and it’s the same issue.

    Plugin Author Steven

    (@shazahm1hotmailcom)

    Can you let me know, more precisely, what you are trying to add or remove from the quick tags editor? This way, I can research it in more detail to see if it is possible to use this plugin to affect the quick tags editor used for the bio field. Put another way; I want to replicate what you are trying to do so I can give you the exact instructions. Thanks!

    Thread Starter djsava

    (@djsava)

    OK,
    First of all a big thank you to you for your various help.

    Addquicktag allows you to add buttons in the text editor.
    I use the classic editor, TinyMCE Advanced.
    On my side, in the fairgrounds (fêtes foraines) category, I need to insert a shortcode like this:
    Dates pour l’année [year]:

    [events_list location=”26″]

    For exemple : Like Here

    Creating a quicktag allows me to add this code without me having to remember it.

    Plugin Author Steven

    (@shazahm1hotmailcom)

    Here’s the code that works for me:

    add_filter(
    	'addquicktag_post_types',
    	/**
    	 * Return array $post_types with custom post types strings
    	 * 
    	 * @param  $post_type Array
    	 * @return $post_type Array
    	 */
    	static function( $post_types ) {
    
    		$post_types[] = 'connections_page_connections_add';
    
    		return $post_types;
    	}
    );
    
    add_filter(
    	'addquicktag_pages',
    	/**
    	 * Return array $page with custom page strings
    	 * 
    	 * @param  $page Array
    	 * @return $page Array
    	 */
    	static function( $page ) {
    
    		$page[] = 'connections_page_connections_add';
    
    		return $page;
    	}
    );

    After you add the code, navigate to the AddQuciktag settings admin page and enable your chosen quicktags for the connections_page_connections_add post type.

    After you do, they should show as options on the Connections admin page.

    I hope this helps!

    Thread Starter djsava

    (@djsava)

    Hi steven,

    Yes it works fine. Only in text editor. Html editor don’t work but it’s not a problem for me.

    Thank you very much for all.

    Thread Starter djsava

    (@djsava)

    Html editor works too.
    I forgot to unfold the toolbar

    Plugin Author Steven

    (@shazahm1hotmailcom)

    Great to hear everything is working well!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Post Type Entry’ is closed to new replies.