start new:
tmux
start new with session name:
tmux new -s myname
<?php | |
function themename_customize_register($wp_customize){ | |
$wp_customize->add_section('themename_color_scheme', array( | |
'title' => __('Color Scheme', 'themename'), | |
'priority' => 120, | |
)); | |
// ============================= |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
# skip existent files | |
RewriteCond %{REQUEST_FILENAME} -f | |
RewriteRule index.php - [QSA,L,C] | |
RewriteRule .* - [QSA,L] | |
# deny access php files |
// zenity dialog box functions | |
// Adam R. Nelson | |
// August 2013 | |
var spawn = require('child_process').spawn; | |
function appendSettings(args, settings) { | |
if (settings) { | |
if (settings.ok) { | |
args.push('--ok-label'); |
<?php | |
$file = '/path/to/file.png'; | |
$filename = basename($file); | |
$upload_file = wp_upload_bits($filename, null, file_get_contents($file)); | |
if (!$upload_file['error']) { | |
$wp_filetype = wp_check_filetype($filename, null ); | |
$attachment = array( | |
'post_mime_type' => $wp_filetype['type'], | |
'post_parent' => $parent_post_id, |
<?php // encoding: utf-8 | |
/*Copyright 2008Qian Qin(email : [email protected]) | |
This program is free software; you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation; either version 2 of the License, or | |
(at your option) any later version. | |
This program is distributed in the hope that it will be useful, |
function wp_api_encode_acf($data,$post,$context){ | |
$data['meta'] = array_merge($data['meta'],get_fields($post['ID'])); | |
return $data; | |
} | |
if( function_exists('get_fields') ){ | |
add_filter('json_prepare_post', 'wp_api_encode_acf', 10, 3); | |
} |
<?php | |
/** | |
* Insert an attachment from a URL address. | |
* | |
* @param string $url The URL address. | |
* @param int|null $parent_post_id The parent post ID (Optional). | |
* @return int|false The attachment ID on success. False on failure. | |
*/ | |
function wp_insert_attachment_from_url( $url, $parent_post_id = null ) { |