- This topic is empty.
-
AuthorPosts
-
July 31, 2011 at 8:58 pm #33731
JapaneseDear
MemberHi guys,
do you know if it is there any way how to add default text into the post category description textarea in wordpress admin?
Thank you for help!
August 1, 2011 at 3:05 am #84291shazdeh
MemberThere’s no hooks to do that. But you can edit the admin file if you really need to do this. Open up wp-admin/edit-tags.php on line 356, you see this:
Or, you could add some jQuery to the page that removes that textarea and replaces it with with your own (but it must have the same name.)
August 1, 2011 at 3:22 am #84292JapaneseDear
MemberThanks for tip, I will try it.
But how some plugins work without that hook? For instance, Rich Text Tags, Categories, and Taxonomies.
My main goal, is to make this category descriptions easy editable for my client, but I need some way how to do it compatible with qTranslate, to support 2 language versions.
I wanted to output there at least the language tags. But maybe there is some way how to embed normal wordpress editor, one that we use to edit posts, pages and stuff.
August 1, 2011 at 6:20 am #84296shazdeh
MemberCould you provide the links for those plugins? I’m interested to check the sources!
What do you mean output language tags? What do you wanna do?August 1, 2011 at 7:04 am #84297JapaneseDear
Memberhttp://wordpress.org/extend/plugins/rich-text-tags/
I use qTranslate to have site in two languages. When i put this code to category description:
English text Slovak text
it will create two language versions of category description, and they are correctly outputed to the site using
so i wanted to put this English text Slovak text “language tags” as default content to the category description textarea, so my client can just paste his text between them for each language. But it is not very user friendly. I dont want user to see any code.
The best thing will be to have a standard post/page wordpress wysiwyg editor for category description, because qtranslate automatically puts language tabs on top of it, so user doesn’t see any “langage tags”. Maybe I can do my really simple custom wysiwyg editor with jquery and replace default textarea…
August 1, 2011 at 9:17 am #84300shazdeh
MemberDoes this do the trick?
function category_description_fields() { ?>
add_action( 'admin_head-edit-tags.php', 'category_description_fields' );
As you know it should go in your theme’s functions file, or a plugin.
August 1, 2011 at 10:07 am #84303JapaneseDear
MemberWell, not really, but I altered your code that we will achieve goal of this topic.
If I will have time I will maybe tweak this a bit, to make it more user friendly.
Thank you very much for your help!To add default text do post category description, add following code to your functions.php or plugin:
function category_description_fields() { ?>
add_action( 'admin_head-edit-tags.php', 'category_description_fields' );March 26, 2013 at 5:57 am #129726tazosmr
MemberIf you want to automatically add specific text to your editor while publishing posts or pages, then:
1) You can install Plugin: Default Post Content
OR
2) If you want to automatically add specific text to your editor while publishing posts or pages, then insert one of the following codes into functions.php:
function add_before_content($content) {
if ( ‘page’ == $post->post_type ) return $content .’Default page content.’;
if ( ‘post’ == $post->post_type ) return $content .’Default post content.’;
}
add_action(‘publish_post’,add_before_content);
add_action(‘update_post’,add_before_content);
add_filter(‘the_content’, add_before_content);
-
AuthorPosts
- The forum ‘Other’ is closed to new topics and replies.