I hereby claim:
- I am nciske on github.
- I am nciske (https://keybase.io/nciske) on keybase.
- I have a public key ASB7t0EWCIBKKd78Pn8E9eLBX8J-NpP-_diJHTGvUp4LBgo
To claim this, I am signing this object:
// http://wordpress.stackexchange.com/questions/9394/getting-all-values-for-a-custom-field-key-cross-post | |
function get_meta_values( $key = '', $type = 'post', $status = 'publish' ) { | |
global $wpdb; | |
if( empty( $key ) ) | |
return; | |
$r = $wpdb->get_col( $wpdb->prepare( " | |
SELECT pm.meta_value FROM {$wpdb->postmeta} pm | |
LEFT JOIN {$wpdb->posts} p ON p.ID = pm.post_id | |
WHERE pm.meta_key = '%s' |
// http://wordpress.org/support/topic/call-function-called-by-embed-shortcode-direct | |
// Doesn't work: | |
// $post_embed = do_shortcode('[embed]your-video-url[/embed]'); | |
// Does work: | |
global $wp_embed; | |
$post_embed = $wp_embed->run_shortcode('[embed]your-video-url[/embed]'); |
<?php | |
global $wpdb; | |
// Start Transaction | |
$wpdb->query( "START TRANSACTION" ); | |
// Do some expensive/related queries here | |
//$wpdb->query("DELETE FROM table WHERE form_id = '1' "); | |
//$wpdb->query("DELETE FROM data WHERE form_id = '1' "); | |
// set $error variable value in error handling after $wpdb modifications |
(* | |
Speed up Mail.app by vacuuming the Envelope Index | |
Code from: http://www.hawkwings.net/2007/03/03/scripts-to-automate-the-mailapp-envelope-speed-trick/ | |
Originally by "pmbuko" with modifications by Romulo | |
Updated by Brett Terpstra 2012 | |
Updated by Mathias Törnblom 2015 to support V3 in El Capitan and still keep backwards compability | |
Updated by @lbutlr for V5 and Container folder in High Sierra and use du | |
Updated by @nciske for V6 in Mojave | |
NOTE: Mojave users will need to grant Terminal.app or Automator.app (wherever you run the script) full disk access for the script to run successfully |
<?php | |
add_action( 'wp_head', 'add_screenshot_as_ogimage' ); | |
function add_screenshot_as_ogimage(){ | |
// default width = 1500 -- 200px minimum, Facebook recommends 1500x1500, max image size of 5mb | |
echo '<meta property="og:image" content="http://s.wordpress.com/mshots/v1/'.urlencode( $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] ).'?w=1500"/>'; |
<?php | |
add_filter("gform_currencies", "add_na_currency"); | |
function add_na_currency($currencies) { | |
$currencies['NA'] = array( | |
"name" => __("N/A", "gravityforms"), | |
"symbol_left" => '', | |
"symbol_right" => "", | |
"symbol_padding" => " ", |
I hereby claim:
To claim this, I am signing this object:
<?php | |
/** | |
* Default Events Template for Genesis | |
* This file is the basic wrapper template for all the views if 'Default Events Template' | |
* is selected in Events -> Settings -> Template -> Events Template. | |
* | |
* @package TribeEventsCalendar | |
* @since 3.0 | |
* @author Modern Tribe Inc. | Tweaked by Thought Refinery | |
* |