Use copypasta to add to a sub-dir of mu-plugins or use Composer:
"require": {
"shelob9/css-inliner" : "*"
| /** | |
| * Snippets to hide EDD coupon fields & codes during the checkout process - handy if you use URLs to apply discounts instead | |
| * Tutorial: http://www.sellwithwp.com/easy-digital-downloads-hide-coupons/ | |
| */ | |
| // Removes the field to enter a discount at checkout | |
| remove_action( 'edd_checkout_form_top', 'edd_discount_field', -1 ); | |
| // Changes the discount code in the checkout summary to display "Discount applied - " instead of the code |
| <?php | |
| /** | |
| * Register Team Members metabox as repeatable group fields. | |
| */ | |
| function maintainn_team_members_metabox() { | |
| $prefix = '_maintainn_team_'; | |
| $cmb_group = new_cmb2_box( array( | |
| 'id' => $prefix . 'metabox', | |
| 'title' => __( 'Team Members', 'maintainn-demo' ), |
| function is_blog () { | |
| global $post; | |
| $posttype = get_post_type($post ); | |
| return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag())) && ( $posttype == 'post') ) ? true : false ; | |
| } | |
| Usage: | |
| <?php if (is_blog()) { echo 'You are on a blog page'; } ?> |
| # DRUPAL-TO-WORDPRESS CONVERSION SCRIPT | |
| # Changelog | |
| # 10.02.2012 - Updated by Kelly Dwan !! THIS VERSION HAS NOT BEEN TESTED !! | |
| # 07.29.2010 - Updated by Scott Anderson / Room 34 Creative Services http://blog.room34.com/archives/4530 | |
| # 02.06.2009 - Updated by Mike Smullin http://www.mikesmullin.com/development/migrate-convert-import-drupal-5-to-wordpress-27/ | |
| # 05.15.2007 - Updated by D’Arcy Norman http://www.darcynorman.net/2007/05/15/how-to-migrate-from-drupal-5-to-wordpress-2/ | |
| # 05.19.2006 - Created by Dave Dash http://spindrop.us/2006/05/19/migrating-from-drupal-47-to-wordpress/ |
| <?php | |
| /* | |
| * Virtual Themed Page class | |
| * | |
| * This class implements virtual pages for a plugin. | |
| * | |
| * It is designed to be included then called for each part of the plugin | |
| * that wants virtual pages. | |
| * | |
| * It supports multiple virtual pages and content generation functions. |
| <?php | |
| // display member list filtered by profile fields | |
| function member_list_by_profile_fields( $atts ) { | |
| global $bp, $wpdb; | |
| $atts = shortcode_atts( array( | |
| 'id' => '1', | |
| 'YOURFIELDNAME' => 'default-value' // this can be just a number! check in bp profile field settings with inspector tool ;) | |
| ), $atts, 'member_list_by_profile_fields' ); |
| /** | |
| * Register Custom myCRED Hook | |
| * @since 1.0 | |
| * @version 1.0 | |
| */ | |
| add_filter( 'mycred_setup_hooks', 'Learndash_myCRED_Hook' ); | |
| function Learndash_myCRED_Hook( $installed ) { | |
| $installed['hook_learndash'] = array( | |
| 'title' => __( 'LearnDash', 'mycred' ), |
| <?php | |
| // this is to add a fake component to BuddyPress. A registered component is needed to add notifications | |
| function custom_filter_notifications_get_registered_components( $component_names = array() ) { | |
| // Force $component_names to be an array | |
| if ( ! is_array( $component_names ) ) { | |
| $component_names = array(); | |
| } | |
| // Add 'custom' component to registered components array |
| <?php | |
| /** | |
| * post-process.php | |
| * make sure to include post-process.php in your functions.php. Use this in functions.php: | |
| * | |
| * get_template_part('post-process'); | |
| * | |
| */ | |
| function do_insert() { | |
| if( 'POST' == $_SERVER['REQUEST_METHOD'] |