Instantly share code, notes, and snippets.

Embed
What would you like to do?
Use AddQuicktag on Quickedit of comments
<?php
/**
* Plugin Name: Use AddQuicktag on Quickedit of comments
* Plugin URI: http://bueltge.de/
* Description: Add the quicktags fomr AddQuicktag plugin to the editor of Quickedit on comments
* Author: Frank Bültge
* Version: 0.0.1
* Licence: GPLv3
* Author URI: http://bueltge.de
*/
// This file is not called from WordPress. We don't like that.
if ( ! function_exists( 'add_filter' ) ) {
echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
exit;
}
if ( ! function_exists( 'my_addquicktag_post_types' ) ) {
// 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 strings
*
* @param $post_type Array
* @return $post_type Array
*/
function my_addquicktag_post_types( $post_types ) {
$post_types[] = 'edit-comments';
return $post_types;
}
add_filter( 'addquicktag_pages', 'my_addquicktag_pages' );
/**
* Return array $page with custom page strings
*
* @param $page Array
* @return $page Array
*/
function my_addquicktag_pages( $page ) {
$page[] = 'edit-comments.php';
return $page;
}
}
@bueltge

This comment has been minimized.

Show comment
Hide comment
@bueltge

bueltge Feb 27, 2015

For the plugin CategoryTinymce

Solution for the plugin CategoryTinymce to use the custom Quicktags on Edit Category.

<?php
/**
 * Plugin Name: AddQuicktag for CategoryTinymce
 * Plugin URI:  http://bueltge.de/
 * Description: Add the quicktags from AddQuicktag plugin to the CategoryTinymce plugin
 * Author:      Frank Bültge
 * Version:     0.0.1
 * Licence:     GPLv3
 * Author URI:  http://bueltge.de
 */

 // This file is not called from WordPress. We don't like that.
if ( ! function_exists( 'add_filter' ) ) {
    echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
    exit;
}

if ( ! function_exists( 'my_addquicktag_post_types' ) ) {

    // 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 strings
     * 
     * @param   $post_type Array
     * @return  $post_type Array
     */
    function my_addquicktag_post_types( $post_types ) {

        $post_types[] = 'edit-category';

        return $post_types;
    }

    add_filter( 'addquicktag_pages', 'my_addquicktag_pages' );
    /**
     * Return array $page with custom page strings
     * 
     * @param   $page Array
     * @return  $page Array
     */
    function my_addquicktag_pages( $page ) {

        $page[] = 'edit-tags.php';

        return $page;
    }

}
Owner

bueltge commented Feb 27, 2015

For the plugin CategoryTinymce

Solution for the plugin CategoryTinymce to use the custom Quicktags on Edit Category.

<?php
/**
 * Plugin Name: AddQuicktag for CategoryTinymce
 * Plugin URI:  http://bueltge.de/
 * Description: Add the quicktags from AddQuicktag plugin to the CategoryTinymce plugin
 * Author:      Frank Bültge
 * Version:     0.0.1
 * Licence:     GPLv3
 * Author URI:  http://bueltge.de
 */

 // This file is not called from WordPress. We don't like that.
if ( ! function_exists( 'add_filter' ) ) {
    echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
    exit;
}

if ( ! function_exists( 'my_addquicktag_post_types' ) ) {

    // 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 strings
     * 
     * @param   $post_type Array
     * @return  $post_type Array
     */
    function my_addquicktag_post_types( $post_types ) {

        $post_types[] = 'edit-category';

        return $post_types;
    }

    add_filter( 'addquicktag_pages', 'my_addquicktag_pages' );
    /**
     * Return array $page with custom page strings
     * 
     * @param   $page Array
     * @return  $page Array
     */
    function my_addquicktag_pages( $page ) {

        $page[] = 'edit-tags.php';

        return $page;
    }

}
@truetesterphp

This comment has been minimized.

Show comment
Hide comment
@truetesterphp

truetesterphp Feb 27, 2015

it's working Thank you

truetesterphp commented Feb 27, 2015

it's working Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment