Use copypasta to add to a sub-dir of mu-plugins or use Composer:
"require": {
"shelob9/css-inliner" : "*"
| // bp-custom.php does not exist by default. If you don’t have a file located at /wp-content/plugins/bp-custom.php, | |
| // @see https://codex.buddypress.org/themes/bp-custom-php/ | |
| // @see https://codex.buddypress.org/developer/loops-reference/the-activity-stream-loop/ | |
| // @see https://codex.buddypress.org/developer/function-examples/bp_ajax_querystring/ | |
| // Show activity to friends only :) | |
| function bp_loop_querystring_for_friend_only_activity( $query_string, $object ) { | |
| if ( ! empty( $query_string ) ) { | |
| $query_string .= '&'; | |
| } |
| 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'; } ?> |
| //@see http://community.rtcamp.com/t/permalinks-with-ultimate-member/4778 | |
| //if you want to use rtmedia for UM | |
| add_filter( 'author_link', 'rtmedia_for_um', 10, 3); | |
| function rtmedia_for_um($link, $author_id, $author_nicename) { | |
| if ( class_exists('UM_API') ) | |
| $link = str_replace('author', 'user', $link); | |
| // get_author_posts_url: http://yoursite.com/author/user-name/ to http://yoursite.com/user/user-name/ |
| <?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' ), |
| /** | |
| * 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 |
| // create fake page called "chat-room" | |
| // modify function and variable names with "ABCD" to whatever you like | |
| // modify variable $fakepage_ABCD_url to the fake URL you require | |
| add_filter('the_posts','fakepage_ABCD_detect',-10); | |
| function fakepage_ABCD_detect($posts){ | |
| global $wp; | |
| global $wp_query; | |
| global $fakepage_ABCD_detect; // used to stop double loading |
| /* | |
| * define( 'JOB_MANAGER_FREELANCING_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) ); | |
| * JOB_MANAGER_FREELANCING_PLUGIN_DIR should be defined in your custom plugin | |
| * | |
| */ | |
| add_filter( 'job_manager_locate_template', 'fl_locate_template', 10, 3 ); | |
| /** |
Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn.
Author: Kaspars Dambis
kaspars.net / @konstruktors
| <?php | |
| /** | |
| * @package Delete Expired Jobs | |
| * @version 0.0.1 | |
| * @see http://opentuteplus.com/delete-expired-jobs-locomotive/ | |
| */ | |
| /* | |
| Plugin Name: Delete Expired Jobs | |
| Plugin URI: https://shop.opentuteplus.com | |
| Description: Delete Expired Jobs |