08 2012 档案

short code
摘要:允许非编程人员直接使用的功能函数,并且可以添加属性等,类似标签( from v2.5 on) 1 <?php 2 /* 3 Plugin Name: Map plugin using shortcode 4 Plugin URI: http://www.falkonproductions.com/shortcodeMaps/ 5 Description: This plugin will get a map of whatever parameter is passed. 6 Author: Drew Falkman 7 Version: 1.0 8 Author URI: http:/ 阅读全文

posted @ 2012-08-30 23:16 kalintw 阅读(258) 评论(0) 推荐(0)

Template Tags
摘要:Template Tags 是一些get某些内容并输出的函数,例如经常用于theme可以自己定义一些tempalte tag 函数http://codex.wordpress.org/Template_Tags 1 <?php 2 /* 3 Plugin Name: My copyright plugin 4 Plugin URI: http://www.falkonproductions.com/copyrightPlugin/ 5 Description: This plugin does things you never thought were possible. 6 Autho 阅读全文

posted @ 2012-08-30 23:04 kalintw 阅读(180) 评论(0) 推荐(0)

write a pluggable function
摘要:方法:写一个函数使用相同的名字,即重写重写wp_new_user_notification,当新用户注册时,发送邮件copy wp_new_user_notification from plug.php, 改写部分邮件内容: 1 <?php 2 /* 3 Plugin Name: Welcome Plugin 4 Plugin URI: http://www.falkonproductions.com/welcome/ 5 Description: This plugin will welcome new users 6 Author: Drew Falkman 7 Version: 1 阅读全文

posted @ 2012-08-30 22:59 kalintw 阅读(152) 评论(0) 推荐(0)

pluggable functions
摘要:pluggable functions都在wp-includes/pluggable.phphttp://codex.wordpress.org/Pluggable_Functions源文件中形式:if ( ! func exit ){ define}如果用户重写了,那么源文件的定义就被忽略,因此pluggable此外,默认的定义在适当需要的时候也可以直接调用 阅读全文

posted @ 2012-08-30 22:49 kalintw 阅读(113) 评论(0) 推荐(0)

a filter
摘要:filter是过滤和处理内容的。两个时刻:发送给client之前;保存进数据库之前。和action不同,需要一个内容参数: 1 <?php 2 function cwmp_add_content_watermark( $content ) 3 { 4 5 // in case we want to add to earlier versions 6 if ( is_feed() ) 7 { 8 return $content . 9 "Created by Falkon Productions, copyright " .... 阅读全文

posted @ 2012-08-30 22:41 kalintw 阅读(175) 评论(0) 推荐(0)

an action
摘要:action是事件,在某一时刻自定义事件或者动作。提交comments的时候,发送邮件: 1 <?php 2 function cc_comment() 3 { 4 global $_REQUEST; 5 $to = "kalintw@gmail.com"; 6 $subject = "new comment posted @ your blog " . $_REQUEST['subject']; 7 $msg = "Message from: " . $_REQUEST['author'] . 阅读全文

posted @ 2012-08-30 22:31 kalintw 阅读(192) 评论(0) 推荐(0)

hook: action and filter
摘要:两种hook:action 执行taskfilter 过滤文本等信息,在post到web页面之前或者存到数据库之前plugin api:http://codex.wordpress.org/Plugin_APIFilter ref: http://codex.wordpress.org/Plugin_API/Filter_ReferenceAction ref: http://codex.wordpress.org/Plugin_API/Action_Referenceplugin 激活的时刻developer可以做事情,比如创建数据表,判断运行环境等。 1 <?php 2 global 阅读全文

posted @ 2012-08-30 21:33 kalintw 阅读(137) 评论(0) 推荐(0)

plugin head
摘要:http://adambrown.info/p/wp_hookshttp://codex.wordpress.org/plugin头:(http://codex.wordpress.org/Writing_a_Plugin) 1 <?php 2 /* 3 Plugin Name: Name Of The Plugin 4 Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates 5 Description: A brief description of the Plugin. 6 Version: The Plugin 阅读全文

posted @ 2012-08-30 21:06 kalintw 阅读(116) 评论(0) 推荐(0)

画笔
摘要:C-N空白处C-click分辨率:印刷至少300画笔:Command-option-z 依次撤销每一步command-shift-z取消刚才的撤销shift+F5 填充硬度流量喷枪shift 画直线F5 画笔调板 阅读全文

posted @ 2012-08-30 20:09 kalintw 阅读(139) 评论(0) 推荐(0)

color
摘要:RGBgray:百分比 0%白色,100%黑色,黑度通道:灰度图像可以理解为分布状况,饱和度分布白的地方分布多白色在rgb每个通道饱和度都高通道变化会改变图像CMYK油墨调和颜色,rgb是三色发光混合青色,洋红,黄,黑web安全色前景色、背景色 切换快捷键 X, DHSB 色相,饱和度,亮度像素和实际物理大小建立联系:分辨率F 全屏切换, 此时空格+鼠标可移动tab显示或隐藏调板 阅读全文

posted @ 2012-08-30 18:31 kalintw 阅读(137) 评论(0) 推荐(0)

html-table
摘要:theadtfootcolspancolgroupcol 阅读全文

posted @ 2012-08-29 21:08 kalintw 阅读(86) 评论(0) 推荐(0)

theme - 8
摘要:copy from content-single.php of 2011, paste into the new content-posts.phprename content-recipes.php to content.php, add condition 阅读全文

posted @ 2012-08-29 13:38 kalintw 阅读(76) 评论(0) 推荐(0)

theme - 7
摘要:2. 主要内容调用放到一个文件save content-recipes.php as custom-content.php将content-recipes.php内容清空,加入:1 <?php2 get_template_part( 'custom-content' ); 3 ?>在custom-content.php中再判断是哪种post type 阅读全文

posted @ 2012-08-29 13:11 kalintw 阅读(85) 评论(0) 推荐(0)

theme - 6
摘要:1. 每个post type 自己的template,当各种type内容类型很不同时适用content-recipes.phpcontent-photos.php - 改变内容展现方式,页面结构、位置content-videos.php内容调用API:1 <?php the_content(); ?>2 <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', & 阅读全文

posted @ 2012-08-29 12:47 kalintw 阅读(85) 评论(0) 推荐(0)

theme - 5
摘要:判断taxonomy有没有设置值: 1 <div class="entry-meta-custom"> 2 <?php if (get_the_term_list( $post->ID, 'meal-type' ) != null ) { ?> 3 <div>Meal type: <?php echo get_the_term_list( $post->ID, 'meal-type', '', ', ', '' ); ?></di 阅读全文

posted @ 2012-08-29 11:54 kalintw 阅读(86) 评论(0) 推荐(0)

theme - 4
摘要:add the taxonomy info, in content-recipes.php:<?php //if ( 'post' == get_post_type() ) : ?>1 <div class="entry-meta-custom">2 <div>Meal type: <?php echo get_the_term_list( $post->ID, 'meal-type', '', ', ', '' ); ?></div& 阅读全文

posted @ 2012-08-29 11:47 kalintw 阅读(103) 评论(0) 推荐(0)

theme - 3
摘要:自定义post typesingle-$typename.php如果是child theme,还要遵守具体父theme的约定。例如2011的single.php里的约定:<?php get_template_part('content', 'single'); ?>约定content-single.php1. create a new and override single.php, 修改下面这行,最后删除single-recipes.php:1 <?php get_template_part( 'content', get_p 阅读全文

posted @ 2012-08-29 11:23 kalintw 阅读(86) 评论(0) 推荐(0)

2011theme
摘要:single.php: 1 <?php 2 3 get_header(); ?> 4 5 <div id="primary"> 6 <div id="content" role="main"> 7 8 <?php while ( have_posts() ) : the_post(); ?> 9 10 <nav id="nav-single">11 <h3 class="assistive-text"><?php _e 阅读全文

posted @ 2012-08-29 10:47 kalintw 阅读(100) 评论(0) 推荐(0)

theme - 2
摘要:增加新的post type 1 // Add new post type for Recipes 2 add_action('init', 'cooking_recipes_init'); 3 function cooking_recipes_init() 4 { 5 $recipe_labels = array( 6 'name' => _x('Recipes', 'post type general name'), 7 'singular_name' => _x('Recip 阅读全文

posted @ 2012-08-29 10:17 kalintw 阅读(165) 评论(0) 推荐(0)

theme - 1
摘要:wp两种内容:post & pagepost:以category的形式组织进一步由tag按照发布时间逆序自定义custom fieldcommentsfeatured imagepage:独立parent-childtemplatemenucommentsfeatured image 阅读全文

posted @ 2012-08-29 10:13 kalintw 阅读(102) 评论(0) 推荐(0)

Userful UI test framework
摘要:Frankhttp://www.testingwithfrank.comUISpechttp://code.google.com/p/uispec/FoneMonkeyhttp://www.gorillalogic.com/testing-tools/meet-the-monkeyssikulihttp://sikuli.org/icukehttps://github.com/unboxed/icukeZucchinihttp://www.zucchiniframework.org/KIFhttps://github.com/square/KIF 阅读全文

posted @ 2012-08-29 10:10 kalintw 阅读(131) 评论(0) 推荐(0)

吐槽 - 1
摘要:1.人生就像耗子钻水管,表现在两个方面,其一,只能前进,木得退路,其二,耗子以为能把握自己的命运,其实前途早已注定。2.人生大可不必太过悲观,即使你的心上人没有乘着七彩的云朵来迎接你,只要你朝着太阳撒泡尿,也能创造出属于你的独一无二的彩虹。3.嫉妒,其实是一门移花接木的高深功夫,它能成功的把对自己不努力的愤怒成功转嫁到另外一个比你强的人身上,从而减轻自己的心理负担。 阅读全文

posted @ 2012-08-29 10:09 kalintw 阅读(116) 评论(0) 推荐(0)

导航