This file contains hidden or 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 | |
| /** | |
| * AffiliateWP - Custom logout redirect for Affiliates | |
| * By default, a user is sent to the wp-login.php?loggedout=true page | |
| * Affiliates are logged out to the affiliate dashboard login screen | |
| * Normal WP users are logged out and redirected to the site URL | |
| */ | |
| function affwp_custom_logout_redirect( $logout_url, $redirect ) { |
This file contains hidden or 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 | |
| class FacebookDebugger | |
| { | |
| /* | |
| * https://developers.facebook.com/docs/opengraph/using-objects | |
| * | |
| * Updating Objects | |
| * | |
| * When an action is published, or a Like button pointing to the object clicked, | |
| * Facebook will 'scrape' the HTML page of the object and read the meta tags. |
This file contains hidden or 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 | |
| /** | |
| * Redirect users to custom URL based on their role after login | |
| * | |
| * @param string $redirect | |
| * @param object $user | |
| * @return string | |
| */ | |
| function wc_custom_user_redirect( $redirect, $user ) { | |
| // Get the first of all the roles assigned to the user |
This file contains hidden or 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: Pancake v. 1.1 | |
| Plugin URI: http://phpmaps.github.io/me/ | |
| Description: Hides wordpress categories that Johnny finds annoying when working in the admin! | |
| Version: 1.1 rev 1 (Sea Gull) | |
| Author: Doogs | |
| Author URI: http://phpmaps.github.io/me/ | |
| */ | |
This file contains hidden or 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
| DELETE FROM wp_postmeta | |
| WHERE post_id IN(SELECT ID FROM wp_posts WHERE post_type = 'shop_order'); | |
| DELETE FROM wp_posts WHERE post_type = 'shop_order'; |
This file contains hidden or 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
| // For Yoast SEO Plugin Version: 14.1+ add to your Wordpress Theme's functions.php... | |
| // Remove All Yoast HTML Comments | |
| // https://gist.github.com/paulcollett/4c81c4f6eb85334ba076 | |
| // Credit @devendrabhandari (https://gist.github.com/paulcollett/4c81c4f6eb85334ba076#gistcomment-3303423) | |
| add_filter( 'wpseo_debug_markers', '__return_false' ); | |
| // For Yoast SEO Plugin Version: < 14.1 add to your Wordpress Theme's functions.php... |
This file contains hidden or 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( function_exists('acf_add_local_field_group') ): | |
| acf_add_local_field_group(array ( | |
| 'key' => 'acf_product_options', | |
| 'title' => 'Product Options', | |
| 'fields' => array ( | |
| array ( | |
| 'key' => 'acf_product_options_tabbedcontent_label', | |
| 'label' => 'Tabbed Content', |
This file contains hidden or 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 | |
| /** | |
| * @package Food_example_plugin | |
| * @version 1.0 | |
| */ | |
| /* | |
| Plugin Name: Food example plugin | |
| Plugin URI: http://wordpress.org/extend/plugins/# | |
| Description: This is an example plugin for WPMU DEV readers | |
| Author: Carlo Daniele |
This file contains hidden or 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 | |
| // Remove the Tax Line item from the cart. | |
| function wc_remove_cart_tax_totals( $tax_totals, $instance ) { | |
| if( is_cart() ) { | |
| $tax_totals = array(); | |
| } | |
| return $tax_totals; | |
| } |
This file contains hidden or 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 | |
| function is_user_logged_in() { | |
| $loggedin = false; | |
| foreach ( (array) $_COOKIE as $cookie => $value ) { | |
| if ( stristr( $cookie, 'wordpress_logged_in_' ) ) { | |
| $loggedin = true; | |
| } | |
| } | |
| return $loggedin; | |
| } |