更新情報
・問題を追加(2024/4/12)
・リファクタリング(2023/4/22)
・Decoratorsに関する問題を追加(2020/6/6)
<?php | |
// Fetch data required for custom orderby types and left join it into the query | |
add_filter('posts_join_paged', 'custom_orderby_joiner', 10, 2); | |
function custom_orderby_joiner($join_paged_statement, $wp_query) { | |
$orderby = $wp_query->query_vars['orderby']; | |
if ($orderby === 'popularity') { | |
$join_paged_statement .= " INNER JOIN (SELECT postid, pageviews FROM wp_popularpostsdata) popularpostsdata ON popularpostsdata.postid = wp_posts.ID"; | |
} |
I don't know whether this will be useful to anyone else, but I wanted to use the Linux tree command to generate file system trees in CSV format on OS X. This should work pretty much as is on Linux, although you may need or want to change the paths and optimize the usage of sed.
This uses the Linux "tree" command, which is not standard on OS X.
<?php | |
/* | |
Plugin Name: ACF Customizer Patch | |
Plugin URI: https://gist.github.com/fabrizim/9c0f36365f20705f7f73 | |
Description: A class to allow acf widget fields to be stored with normal widget settings and allow for use in customizer. | |
Author: Mark Fabrizio | |
Version: 1.0 | |
Author URI: http://owlwatch.com/ | |
*/ | |
class acf_customizer_patch |
// replace map keys with whatever you want | |
// creats classes as .grid-$keyname-$col | |
$breakpoint-widths: (xs: 480px, sm: 768px, md: 992px, lg: 1200px); | |
$grid-columns: 12 | |
// media query mixin | |
@mixin mq($search) { | |
@media (min-width: map-get($breakpoint-widths, $search)){ | |
@content | |
} |
#!/bin/bash | |
echo "What is the theme name? (no spaces)" | |
read THEME | |
echo Installing Wordpress | |
git clone git@github.com:scottzirkel/wordpress-base.git website ## This pulls down my WordPress starter template | |
cd website | |
echo Installing Composer ## I use Composer to manage the backend dependencies (ie: WordPress, public plugins, etc) | |
composer install | |
cd app/themes | |
echo Setting up "$THEME" |
http://co3k.org/blog/csrf-token-should-not-be-session-id について。
この記事では触れられていませんが、
この際ハッキリ言っておくべきだと思うので書きますが、そもそもセッションIDを(HTMLソース中に埋め込む)CSRF対策トークンとして使うのは間違いでした。最初から間違っていたのです。正確に言うとCSRFの話は関係ないですね。CSRF関係なく、特に「単体で」セッションハイジャックが可能になるような値を、HTMLソース中に埋め込むべきではありません。
<?php | |
/** | |
* Load site scripts. | |
* | |
* @since 1.0.0 | |
* | |
* @return void | |
*/ | |
function wpgulp_enqueue_scripts() { |
A list of Sketch plugins hosted at GitHub, in no particular order.
<?php | |
/** | |
* Theme Activation Tour | |
* | |
* This class handles the pointers used in the introduction tour. | |
* @package Popup Demo | |
* | |
*/ | |
class WordImpress_Theme_Tour { |