heute kam mir der gedanke, dass es sehr praktisch wre, wenn man bei der erstellung eines neuen posts einen default text vorgeben knnte; in diesem blog kann ich das zwar nicht bentigen, aber in einer firmeninternen wordpress installation sehr wohl.

zum glck geht das sehr einfach, daher hab ich gleich ein plugin erstellt: wp default post content

25 Responses to WordPress Plugin: Default Post Content

  • great plug-in exactly what I was looking for but my problem is that I usually paste HTML code and it doesn’t get translated correctly. by this I mean:
    ——–START ——–

    height=”70%” width=”70%” alt=”” />

    ——- END ——–

    gets translated to:

    height=\”70%\” width=\”70%\” alt=\”\” />

    is there any way to fix this? thanks

  • hipslu says:

    ok, i see. i’ll have a look on that

  • hipslu says:
  • Pingback: M-ALO’s Monologer (Testblog) » Blog Archive » Plugin test: Default Post Content

  • Fanatyk says:

    I wrote my default content like this:
    [code]
       

    [/code]
    And I recive:
    [code]

    [/code]

  • hipslu says:

    looks like it’s working – or did i miss something? :mrgreen:

  • Fanatyk says:

    I thought that if wrote & n b s p I’ll see it in post editor 🙂

  • hipslu says:

    ah, i see. well, that will not work since the wysiwyg editor will make use of the html code in the default post content. in fact, i think this is the way i should work

  • Fanatyk says:

    I do not use WISIWYG

  • hipslu says:

    ok, please open the file, search for “stripslashes” (should be twice, line 59 and 97) and replace it with “htmlspecialchars”.

    be sure to enable “Strip Slashes?” on the options page. it should work now (tested with 2.0.1). please provide feedback so that i can add this option. thanks

  • Fanatyk says:

    works!

    THX! 🙂

  • Will says:

    Does not seem to work with wordpress 1.5.2. Just a blank white page. No space before or after php either. Any ideas?

  • hipslu says:

    what did you enter as your default content?

  • Will says:

    Hey,

    I am not even able to get that far.

    Going to you know via the options and default content tab, that is:

    /wp-admin/options-general.php?page=hipslu_wp-default-post-content.php

    Results in simply a blank white page. 🙁

    Thanks,

    Will

    Also leaving a comment here is really screwed up, cant believe the last one made it trhough:

    Warning: main(): Unable to access ../../../wp-config.php in /home/hipfinger/www.konfabulieren.com/wp-content/plugins/sk2_second_chance.php on line 3
    Warning: main(../../../wp-config.php): failed to open stream: No such file or directory in /home/hipfinger/www.konfabulieren.com/wp-content/plugins/sk2_second_chance.php on line 3
    Fatal error: main(): Failed opening required ‘../../../wp-config.php’ (include_path=’.:/usr/share/php:/usr/share/pear’) in /home/hipfinger/www.konfabulieren.com/wp-content/plugins/sk2_second_chance.php on line 3

  • hipslu says:

    how did you upload the plugin to your webspace? hopefully ascii; please check this.

    then, please open the url /wp-admin/options.php and find “active_plugins”. there should be “hipslu_wp-default-post-content.php” only once. if not, change it.

    ps: i think your browser has javascript disabled; enable it, and you should be able to post a comment without a problem 😉

  • hipslu says:

    i finally found some time to have a look at the annoying “redeclare” bug some of you are running into. well, in fact i do not understand why this happens, but i promise: it is fixed now. please download the new version asap (http://www.konfabulieren.com/wordpress-plugins/) and give me some feedback. thanks.

    and: added the option requested by fanatyk some time ago – no source code search / replace needed anymore

  • Byru says:

    Hey, that is the thing i was looking for, but it does not work with the newest WordPress 2.0.2

    When i want to open the Default Post Content configuration Tab i get the following:

    ———

    Fatal error: Cannot redeclare hipslu_dpc_options_page() in /home/httpd/vhosts/blitz-art.com/httpdocs/blog/wp-content/plugins/hipslu_wp-default-post-content.php on line 25

    ———

    Please help.

  • Natti says:

    The same as comment by Byru, doesn’t work with WP 2.0.4. Love to use this plugin (also the javascript Plugin) so could you please fix the bug or help me?
    Thanx in advance.

  • I’ve been useing it with 2.0.4 and now I’m useing it with 2.0.5 and have no problem :>

  • Can the liberties of a nation be thought secure,
    when we have removed their only firm basis,
    a conviction in the minds of the people that they
    are a gift of God? Indeed, I tremble for my countrymen,
    when I reflect that God is just, that His justice
    cannot sleep forever.

  • m-alo says:

    I’m using WP 2.05 and I’m also getting the “redeclare”-error like Byru and Natti.

    Fatal error: Cannot redeclare hipslu_dpc_options_page() (previously declared in …/wp-content/plugins/hipslu_wp-default-post-content.php:25) in …/wp-content/plugins/hipslu_wp-default-post-content.php on line 23

    Any help on this would be appreciated.

  • Javi Vicente says:

    I am using WP 2.1 and I get the same error as above. I do not know what would be the problem with the declaration. Could you help me, please?

  • Baris Unver says:

    If you add a “default content per category” option, I will be able to eat it. It’s still delicious this way but the option I mentioned would be awesome.

  • hipslu says:

    i do not think that this is possible (with my php skills :mrgreen: ) – the default content is set while the page is loading, but the category is defined for sure much later, so the page would have to reload or the content has to be set via javascript. what should happen to content the user has already entered? what should happen if there is more than one category checked? so i think this would not be that easy to implement.

    but i’ve added a option to define the default excerpt and the default title of a post; well, that would not help you, but it should be said i think 😀

  • I’m using WordPress 2.3.2, and v1.3 of the plugin. The strip slashes function of the plugin works great on the post section, but slashes still show up in the title section. Is this something I’m doing wrong?