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 you register image sizes using the function below, images | |
* edited in the Image Editor will be saved in all image sizes. | |
* | |
* @see https://core.trac.wordpress.org/ticket/19889 | |
*/ | |
if ( !function_exists( 'add_image_editor_size') ) : |
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 | |
/** | |
* Use Redux Framework with Timber | |
* | |
* Use this class like you would Redux Framework. All options are automatically | |
* made available in your Timber template context (by default as 'options'). | |
* | |
* Extra optional arguments in the $args array: | |
* - 'timber_context' (string) Name of the variable in template context. |
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( 'dp_duplicate_page', 'dp_duplicate_p2p', 10, 2 ); | |
add_action( 'dp_duplicate_post', 'dp_duplicate_p2p', 10, 2 ); | |
// For Duplicate Product support in WooCommerce: | |
//add_action( 'woocommerce_duplicate_product', 'dp_duplicate_p2p', 10, 2 ); | |
function dp_duplicate_p2p( $new_post_id, $old_post ) { | |
global $wpdb; |
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 gist secures attachments for messages in BuddyPress when | |
* using the BuddyPress Message Attachment plugin, by only serving | |
* the file to users that are part of the thread the file is attached | |
* to. | |
* | |
* =Usage= | |
* Add the functions in this file to your theme's functions.php or | |
* wherever you want it. Then add the following rewrite rule to your |
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 | |
// Sort BuddyPress users by last name | |
// | |
// Use this Gist to sort members alphabetically by last name in the | |
// members directory. Follow the instructions below and drop the code | |
// in your functions.php or your functions plugin. | |
// | |
// Updated to work with BP 1.7. See earlier revisions of this gist for | |
// earlier versions of BP. |