WordPress.com Színtaxis kiemelés

Példa:

[sourcecode language=”css”]
#gomb {
font-weight: bold;
border: 2px solid #fff;
}
[/sourcecode]

Forrás:

[sourcecode language=”css”]
#gomb {
font-weight: bold;
border: 2px solid #fff;
}
[/sourcecode]

Paraméter lista:

  • actionscript3
  • bash
  • clojure
  • coldfusion
  • cpp
  • csharp
  • css
  • delphi
  • erlang
  • fsharp
  • diff
  • groovy
  • html
  • javascript
  • java
  • javafx
  • matlab (keywords only)
  • objc
  • perl
  • php
  • text
  • powershell
  • python
  • r
  • ruby
  • scala
  • sql
  • vb
  • xml

Forrás:
http://en.support.wordpress.com/code/posting-source-code/

Bejegyzés és oldal id meghatározása bővítmény nélkül

[sourcecode language=”php”]
add_filter(‘manage_posts_columns’, ‘kw_posts_columns_id’, 5);
add_action(‘manage_posts_custom_column’, ‘kw_posts_custom_id_columns’, 5, 2);
add_filter(‘manage_pages_columns’, ‘kw_posts_columns_id’, 5);
add_action(‘manage_pages_custom_column’, ‘kw_posts_custom_id_columns’, 5, 2);
function kw_posts_columns_id($defaults){
$defaults[‘wps_post_id’] = __(‘ID’);
return $defaults;
}
function kw_posts_custom_id_columns($column_name, $id){
if($column_name === ‘wps_post_id’){
echo $id;
}
}

[/sourcecode]

Dofollow hozzászólás link

[sourcecode language=”php”]
function kw_dofollow($str)
{
$str = preg_replace(
‘~<a ([^>]*)s*(["|’]{1}w*)s*nofollow([^>]*)>~U’,
‘<a ${1}${2}${3}>’, $str);
return str_replace(array(‘ rel=""’, " rel=”"), ”, $str);
}
remove_filter(‘pre_comment_content’,     ‘wp_rel_nofollow’);
add_filter   (‘get_comment_author_link’, ‘kw_dofollow’);
add_filter   (‘post_comments_link’,      ‘kw_dofollow’);
add_filter   (‘comment_reply_link’,      ‘kw_dofollow’);
add_filter   (‘comment_text’,            ‘kw_dofollow’);
[/sourcecode]