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 | |
/** | |
* This adds `post_type` and `post_status` to the query that happens during `post_exists()` so it can utilize the `type_status_date` index on `wp_posts`. | |
* Hooked on `query` during `wp_import_post_data_raw` and removed during `wp_import_existing_post`. | |
* | |
* Modifies a query like this from `post_exists()`: | |
* SELECT ID FROM wp_posts WHERE 1=1 AND post_date = '2020-07-01 09:30:00' AND post_title = 'Some Post Title' | |
* | |
* To this: |
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
func showNotification() -> Void { | |
var notification = NSUserNotification() | |
notification.title = "Test from Swift" | |
notification.informativeText = "The body of this Swift notification" | |
notification.soundName = NSUserNotificationDefaultSoundName | |
NSUserNotificationCenter.defaultUserNotificationCenter().deliverNotification(notification) | |
} | |
//showNotification() |
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 | |
WP_Post::__set_state( | |
array( | |
'ID' => 123, | |
'post_author' => '1', | |
'post_date' => '2019-02-08 06:24:07', | |
'post_date_gmt' => '2019-02-08 12:24:07', | |
'post_content' => '', | |
'post_title' => '', |
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 | |
WP_Query::__set_state( | |
array( | |
'query' => array(), | |
'query_vars' => array( | |
'error' => '', | |
'm' => '', | |
'p' => 0, | |
'post_parent' => '', |
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( 'wp_link_query', 'trac_44310_wp_link_query', 10, 1 ); | |
function trac_44310_wp_link_query( $results ) { | |
foreach( $results as $index => $result ) { | |
$results[$index]['title'] = trim( esc_html( strip_tags( html_entity_decode( $result['title'] ) ) ) ); | |
} | |
return $results; |
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: Simple Staff List - Post Nominal Field | |
* Description: Adds a "Post Nominal" field for Simple Staff List plugin | |
* Version: 1.0 | |
* Author: Brett Shumaker | |
* Author URI: https://brettshumaker.com | |
* License: GPL2 | |
**/ |
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
// Add this to the switch( $format ) statement in fpropdf_format_field() /format.php ~line 429 | |
case 'address': | |
$v = maybe_unserialize( $v ); | |
if ( ! is_array( $v ) ) | |
break; | |
$address = ''; | |
foreach ( $v as $key => $this_value ) { |
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 | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly | |
} | |
/** | |
* WC_Shipstation_API_Export Class | |
*/ | |
class WC_Shipstation_API_Export extends WC_Shipstation_API_Request { |
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_action( 'woocommerce_subscriptions_updated_users_role', 'st_woocommerce_subscriptions_updated_users_role', 11, 3 ); | |
function st_woocommerce_subscriptions_updated_users_role( $role_new, $user, $role_old ) { | |
$_pf = new WC_Product_Factory(); | |
if ( 'member_going_in' == $role_new || WC_Subscriptions_Manager::user_has_subscription( $user->ID, '', 'active') ) { | |
$subscriptions = wcs_get_users_subscriptions($user->ID); | |
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
<!-- | |
This is just an example staff loop | |
To use the custom template tag in functions.php just | |
copy/paste line 14 below into your own Staff Loop Template | |
--> | |
[staff_loop] | |
<img class="staff-member-photo" src="[staff-photo-url]" alt="[staff-name] : [staff-position]"> | |
<div class="staff-member-info-wrap"> | |
[staff-name-formatted] | |
[staff-position-formatted] |
NewerOlder