Created
January 11, 2012 15:21
-
-
Save bueltge/1595155 to your computer and use it in GitHub Desktop.
Add custom post type to AddQuicktag plugin for use the plugin on custom post types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Use AddQuicktag on my CPT | |
* Plugin URI: http://bueltge.de/ | |
* Description: Add custom post type 'my_custom_post_type' to AddQuicktag 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[] = 'my_custom_post_type'; | |
return $post_types; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in which file do I have to copy this code?