Finds a value in a CSV file based on its column and row header
mixed intersect ( string $filename , mixed $column , mixed $row )| <?php | |
| /** | |
| * Allows you to rename any text string for a given post type | |
| * | |
| * @todo Make it work with text from all gettext domains | |
| * | |
| * @param array $strings Associative array of old strings and new strings | |
| * @param string|array $post_types String or array of Post Types to change the string for | |
| */ |
| <?php | |
| /** | |
| * Adds filter for taxonomies to posts table | |
| * | |
| * Adapted from: | |
| * @see http://wordpress.org/support/topic/custom-taxonomy-filter-not-working-in-admin-editphp-31b2?replies=8#post-2400615 | |
| * @see https://wordpress.stackexchange.com/questions/578/adding-a-taxonomy-filter-to-admin-list-for-a-custom-post-type/3215#3215 | |
| * | |
| * @param array $taxonomy Filter to be added |
| <?php | |
| /** | |
| * Changes the taxonomy checkboxes into radios so only one can be selected | |
| * | |
| * @param string|array $taxonomies Taxonomy(s) to be affected | |
| * @param string|array $post_types Post Type(s) to be affected | |
| */ | |
| function taxonomy_radios( $taxonomies, $post_types ) { | |
| // Ensure params are arrays |
| <?php | |
| /** | |
| * Allows you to specify a template for a post type while storing the | |
| * template file outside of a theme. | |
| * | |
| * @param string $file Full path to template file | |
| * @param string $post_type Post Type to use template | |
| */ | |
| function set_single_template( $file, $post_type ) { |
| # Basic | |
| rsync -avz --delete ./source/ ./destination | |
| # Windows deployment script with SSH fix | |
| rsync -avz --delete --progress --exclude '.git' --chmod=755 -e 'C:\Programs\rsync\ssh.exe' ./path/to/source user@host:/path/to/destination |
| <?php | |
| function delete($path) { | |
| $files = scandir($path); | |
| foreach ($files as $file) { | |
| if (!in_array($file, ['.', '..'])) { | |
| $full = $path . DIRECTORY_SEPARATOR . $file; | |
| if (is_file($full)) unlink($full); | |
| if (is_dir($full)) delete($full); | |
| } |
| // v-on:click handlers can only take one expression, so you can't close | |
| // a modal and update vars in one. This function updates vars on the | |
| // current Vue object, closes a modal (based on CSS selector) and, | |
| // optionally, opens another modal after a delay to all appear smooth | |
| modalNav: function(vars, close, open) { | |
| for (var attr in vars) { this[attr] = vars[attr]; } | |
| document.querySelectorAll(close)[0].classList.remove('active') | |
| if (typeof open !== 'undefined') { | |
| window.setTimeout(function () { | |
| document.querySelectorAll(open)[0].classList.add('active') |
| # Quick Convert | |
| ffmpeg -i input.mkv -c copy output.mp4 | |
| # To "Standard" MP4 | |
| ffmpeg -i input.mkv -c:v h264 -c:a aac output.mp4 |
| # Redirect 503 / |