Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn.
Author: Kaspars Dambis
kaspars.net / @konstruktors
| <?php | |
| /** | |
| * Plugin name: WP Trac #42573: Fix for theme template file caching. | |
| * Description: Flush the theme file cache each time the admin screens are loaded which uses the file list. | |
| * Plugin URI: https://core.trac.wordpress.org/ticket/42573 | |
| * Author: Weston Ruter, XWP. | |
| * Author URI: https://weston.ruter.net | |
| */ | |
| function wp_42573_fix_template_caching( WP_Screen $current_screen ) { |
| <?php | |
| global $wp_embed; | |
| $video_url = 'https://www.youtube.com/watch?v=b7mixrO2lzA'; | |
| echo $wp_embed->run_shortcode( '[embed]' . $video_url . '[/embed]' ); |
| // add locale such as locale_ja, locale_en_US to body class | |
| add_filter( 'body_class', 'add_body_class_locale' ); | |
| function add_body_class_locale( $classes ) { | |
| $classes[] = 'locale_' . sanitize_html_class( get_bloginfo('language') ); | |
| return $classes; | |
| } |
| var deleteAllGroupMembers = (function () { | |
| var deleteAllGroupMembers = {}; | |
| // the facebook ids of the users that will not be removed. | |
| // IMPORTANT: add your own facebook id here so that the script will not remove yourself! | |
| var excludedFbIds = ['1234','11223344']; // make sure each id is a string! | |
| var usersToDeleteQueue = []; | |
| var scriptEnabled = false; | |
| var processing = false; | |
| deleteAllGroupMembers.start = function() { |
| add_filter('bogo_localizable_post_types', 'my_localizable_post_types', 10, 1); | |
| function my_localizable_post_types($localizable) { | |
| $localizable[] = 'custom_post_type_name'; | |
| return $localizable; | |
| } |
Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn.
Author: Kaspars Dambis
kaspars.net / @konstruktors
| #!/usr/bin/php | |
| <?php | |
| switch($argc) { | |
| case 1: | |
| case 2: | |
| echo "please input new site url and wp directory name!\n"; | |
| exit(); | |
| default: | |
| $old_site = isset($argv[3]) ? $argv[3] : ''; | |
| $path = $argv[2]; |
| git status | grep deleted: | awk '{print $3}' | xargs git rm | |
| # ただしカラースキーム付きの場合は保証しない. |