How do I add a filter to wp_list_categories() to make links nofollow?
try: add_filter(‘wp_list_categories’,’esc_wp_rel_nofollow’); function esc_wp_rel_nofollow($output){ return stripslashes(wp_rel_nofollow($output)); }
try: add_filter(‘wp_list_categories’,’esc_wp_rel_nofollow’); function esc_wp_rel_nofollow($output){ return stripslashes(wp_rel_nofollow($output)); }
I would try “wp_insert_post_data” filter. add_filter(‘wp_insert_post_data’, ‘new_content’ ); function new_content($content) { preg_match_all(‘~<a.*>~isU’,$content[“post_content”],$matches); for ( $i = 0; $i <= sizeof($matches[0]); $i++){ if ( !preg_match( ‘~nofollow~is’,$matches[0][$i]) ){ $result = trim($matches[0][$i],”>”); $result .= ‘ rel=”nofollow”>’; $content[‘post_content’] = str_replace($matches[0][$i], $result, $content[‘post_content’]); } } return $content; } Obviously needs work, just a PoC.
You need to first deregister the script using wp_deregister_script wp_deregister_script( ‘admin-widgets’ ); then use your code to re-register the script using your own js file: wp_register_script(‘admin-widgets’, WP_PLUGIN_URL. ‘/oak-automated-sidebars/oak-widgets.js’); wp_enqueue_script(‘admin-widgets’); Hope this Helps
Yes using the built in editor is the right way to do it. WordPress prizes backwards compatibility so the function should continue to work forever.
you have to commit the changes to the /trunk directory yourself, changing the version number in the /trunk/readme.txt is not going to do this on its own. Update Whenever i update a version say from 1.0.0 to 2.0.0 i first create a directory in /tags and name it just like the last version 1.0.0 the … Read more
A readme update may take a week or more. Sometimes it helps to update just the readme file again. The Last Updated field is … dead. One of my plugins still shows the date 2010-12-24, but I had three updates in the mean time, the last one a week ago. The whole system feels like … Read more
I noticed that wordpress’ make_clickable filter was attached to the comment_text filter hook and not get_comment_text, which is what I have been using for a while. I had researched earlier if this may be the case, specifically figuring out what the difference was between the two, and I think I read something about comment_text using … Read more
A good thing – as always – is the Action Reference. You could count the terms from the $post data on pre_post_update.
Use a gettext filter and match against the text. add_filter( ‘gettext’, ‘filter_published_on’, 10000, 2 ); function filter_published_on( $trans, $text ) { if( ‘Published on: <b>%1$s</b>’ == $text ) { global $post; switch( $post->post_type ) { case ‘your-posttype’: return ‘Whatever on: <strong>%1$s</strong>’; break; default: return $trans; break; } } return $trans; } The alternative would be … Read more
Since this was posted, the wp_editor() function has been created. This is the correct way to include TinyMCE in a theme or plugin. Better yet, its Codex page (linked above) is much better and there are some pretty good tutorials out there.