This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter("template_include", "get_parent_page_template"); | |
function get_parent_page_template( $template ) { | |
global $post; | |
if(is_page()) { | |
$children = wp_list_pages("child_of=".$post->ID."&echo=0"); | |
if( !$post->post_parent and !empty( $children )) { | |
$template = locate_template( array( "page-parent.php", "page.php" ) ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Class Scheduled_Term { | |
public $taxonomy = "category"; | |
public $term_id = 1; | |
public $term_slug; | |
public $event_key = "scheduled_term"; | |
public $date_key = 'date'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Class Add_Selectable_Image_Size { | |
public $image_sizes = array(); | |
public function __construct() { | |
add_action( 'after_setup_theme', array(&$this, 'add_image_sizes') ); | |
add_filter( 'image_size_names_choose', array(&$this, 'add_image_size_select') ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function add_custom_post_type_role( $post_type ,$arg ) { | |
$role = get_role('administrator'); | |
if( "post" != $arg->capability_type and !$arg->_builtin ) { | |
$role->add_cap( "edit_{$arg->name}" ); | |
$role->add_cap( "read_{$arg->name}" ); | |
$role->add_cap( "delete_{$arg->name}" ); | |
$role->add_cap( "delete_{$arg->name}s" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Any Mobile Theme Switcher Fix | |
Description:Any Mobile Theme Switcher Fix | |
*/ | |
if(is_admin()) { | |
$_GET["am_force_theme_layout"] = "desktop"; | |
$_COOKIE['am_force_theme_layout'] = "desktop"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function the_content_image( $size = 'thumbnail', $align = "" ) { | |
global $post; | |
$output = preg_match('/<img.+class=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); | |
if( $output ) { | |
$first = $matches; | |
preg_match("/wp-image-([0-9]+)/", $first[1], $matches); | |
$attr = ""; | |
if( $align ) { | |
$attr = array( "class" => $align ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Advanced Custom Fields: encrypted_field | |
Version: 1.0.0 | |
Author: Toro_Unit | |
Author URI: http://www.jbnet.jp | |
License: GPLv2 or later | |
License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do ($=jQuery) -> | |
$.fn.semiMediaQuery = (breakpoints) -> | |
@init = (breakpoints) => | |
@breakpoints = breakpoints | |
@getElements() | |
@delegateEvents() | |
@setWidthClass() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Game_of_Life | |
# | |
# @CELL_SIZE セルの大きさ | |
# @BORAD_SIZE マスの数 | |
# @FPS = FPS | |
# | |
constructor:( canvas, @CELL_SIZE = 10,@BORAD_SIZE = 100,@FPS = 50 ) -> | |
@timer | |
@memory = @createMemory() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"autoReloadChanged": true, | |
"blod_folder_labels": true, | |
"close_windows_when_empty": false, | |
"draw_white_space": "all", | |
"font_size": 13, | |
"highlight_line": true, | |
"ignored_packages": | |
[ | |
"Vintage", |