俺のフックがこんなに簡単なわけがない。

Embed Size (px)

Citation preview

  • 1. ore no hook ga konna ni kantan na wakega nai. WordBench KOBE #21

2. [...] functions.php function new_excerpt_more($more) { return ; } add_filter(excerpt_more, new_excerpt_more); 3. [...] functions.php function new_excerpt_more($more) { return ; } add_filter(excerpt_more, new_excerpt_more); 4. [...] functions.php function new_excerpt_more($more) { return ; } add_filter(excerpt_more, new_excerpt_more); 5. 6. 7. WordPress 8. WordPress 9. 60g60g... 10. 60g 60g... 11. 60g60g ... 12. 60g60g = ... 13. 60g60g ... 14. 60g60g ... 15. function () {}add_action(, ); 16. 17. = 18. Web 19. 60g60g... 20. 60g60g... 21. 60g 60g ... 22. 60g 60g = ... 23. function ($text) {return . $text;}add_filter(, ); 24. 60g60g... 25. 60g60g= ... 26. function () {return false;}add_filter(, ); 27. function () {}add_action(, ); 28. function ($text) {return . $text;}add_filter(, ); 29. 30. = WordPress $post, $wp_query, $wp_rewrite 31. function new_excerpt_more($more) {return ;}add_filter(excerpt_more,new_excerpt_more); 32. function new_excerpt_more($more) {return ;}add_filter(excerpt_more,new_excerpt_more); 33. function new_excerpt_more($more) {return ;}add_filter(excerpt_more,new_excerpt_more); 34. function new_excerpt_more($more) {return ;}add_filter(excerpt_more,new_excerpt_more); 35. function new_excerpt_more($more) {return ;}add_filter(excerpt_more,new_excerpt_more); 36. function new_excerpt_more($more) {return ;}add_filter(excerpt_more,new_excerpt_more); 37. function new_excerpt_more($more) {return ;}add_filter(excerpt_more,new_excerpt_more); $more 38. 39. function new_excerpt_more($more) {return ;}add_filter(excerpt_more,new_excerpt_more); 40. function new_excerpt_more($more) {return ;}add_filter(excerpt_more,new_excerpt_more); apply_lters(excerpt_more 41. function wp_trim_excerpt($text = ) { $raw_excerpt = $text; if (== $text ) {$text = get_the_content();$text = strip_shortcodes( $text );$text = apply_filters(the_content, $text);$text = str_replace(]]>, ]]>, $text);$excerpt_length = apply_filters(excerpt_length, 55);$excerpt_more = apply_filters(excerpt_more, .[...]);$text = wp_trim_words( $text, $excerpt_length,$excerpt_more ); } return apply_filters(wp_trim_excerpt, $text, $raw_excerpt);} wp-includes/formatting.php 42. function wp_trim_excerpt($text = ) { $raw_excerpt = $text; apply_lters() if (== $text ) {$text = get_the_content();$text = strip_shortcodes( $text );$text = apply_filters(the_content, $text);$text = str_replace(]]>, ]]>, $text);$excerpt_length = apply_filters(excerpt_length, 55);$excerpt_more = apply_filters(excerpt_more, .[...]);$text = wp_trim_words( $text, $excerpt_length,$excerpt_more ); } return apply_filters(wp_trim_excerpt, $text, $raw_excerpt);} 43. function wp_trim_excerpt($text = ) { $raw_excerpt = $text; $more if (== $text ) { + [...] $text = get_the_content();$text = strip_shortcodes( $text );$text = apply_filters(the_content, $text);$text = str_replace(]]>, ]]>, $text);$excerpt_length = apply_filters(excerpt_length, 55);$excerpt_more = apply_filters(excerpt_more, .[...]);$text = wp_trim_words( $text, $excerpt_length,$excerpt_more ); } return apply_filters(wp_trim_excerpt, $text, $raw_excerpt);} 44. 45. WordPress 46. UI 47. 48. /** * Categories widget class * * @since 2.8.0 */class WP_Widget_Categories extends WP_Widget {...! ! $cat_args = array(orderby => name, show_count => $c,hierarchical => $h);...! !

  • ! !

... wp-includes/default-widget.php 49. /** * Categories widget class * * @since 2.8.0 */class WP_Widget_Categories extends WP_Widget {... wp_list_categories() ! ! $cat_args = array(orderby => name, show_count => $c,hierarchical => $h);... ! !

  • ! !

... 50. /** * Categories widget class * * @since 2.8.0 */class WP_Widget_Categories extends WP_Widget {... $cat_args ! ! $cat_args = array(orderby => name, show_count => $c,hierarchical => $h);...! !

  • ! !

... 51. /** * Categories widget class * * @since 2.8.0 */class WP_Widget_Categories extends WP_Widget {...! ! $cat_args = array(orderby => name, show_count => $c,hierarchical => $h);...! !

  • ! !

... 52. /** * Categories widget class * * @since 2.8.0 */class WP_Widget_Categories extends WP_Widget {... ! ! $cat_args = array(orderby => name, show_count => $c, widget_categories_argshierarchical => $h);...! !

  • ! !

... 53. FUNCTIONS.PHPfunction change_widget_category_orderby( $cat_args ){$cat_args[orderby] = count;$cat_args[order] = DESC;return $cat_args;}add_filter( widget_categories_args,change_widget_category_orderby ); 54. FUNCTIONS.PHPfunction change_widget_category_orderby( $cat_args ){$cat_args[orderby] = count;$cat_args[order] = DESC; wp_list_categories()return $cat_args;}add_filter( widget_categories_args,change_widget_category_orderby ); 55. FUNCTIONS.PHPfunction change_widget_category_orderby( $cat_args ){$cat_args[orderby] = count;$cat_args[order] = DESC;return $cat_args;} add_filter( widget_categories_args,change_widget_category_orderby ); Codexwp_list_categories 56. FUNCTIONS.PHPfunction change_widget_category_orderby( $cat_args ){$cat_args[orderby] = count;$cat_args[order] = DESC;return $cat_args;}add_filter( widget_categories_args,change_widget_category_orderby ); 57. & 58. 59. WordPress 60. ? 61. 62. Debug Bar Extender Variable Lookup http://wordpress.org/extend/plugins/debug-bar-extender/ 63. http://notnil-creative.com/blog/archives/1615http://notnil-creative.com/blog/archives/1566JavascriptCSShttp://notnil-creative.com/blog/archives/1299http://notnil-creative.com/blog/archives/1163Breadcrumb NavXThttp://notnil-creative.com/blog/archives/981jQueryhttp://notnil-creative.com/blog/archives/969 64. Thanks!