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 get_the_user_ip() { | |
| if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) { | |
| //check ip from share internet | |
| $ip = $_SERVER['HTTP_CLIENT_IP']; | |
| } elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { | |
| //to check ip is pass from proxy | |
| $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; | |
| } else { | |
| $ip = $_SERVER['REMOTE_ADDR']; |
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: Restrict Content Pro - Custom User Fields | |
| Description: Illustrates how to add custom user fields to the Restrict Content Pro registration form that can also be edited by the site admins | |
| Version: 1.0 | |
| Author: Pippin Williamson | |
| Author URI: http://pippinsplugins.com | |
| Contributors: mordauk | |
| */ |
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: Restrict Content Pro - Custom User Fields | |
| Description: Adds additional user fields to the registration process | |
| Version: 1.0 | |
| Author: Pippin Williamson | |
| Author URI: http://pippinsplugins.com | |
| Contributors: mordauk, angiemeeker | |
| */ |
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
| 1) Log in to aws console. | |
| 2) Click cloudfront | |
| 3) Click behaviors | |
| 4) Select pattern and edit |
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 pw_rcp_earnings_slash_command() { | |
| # Check to make sure this is a Slash Command Request | |
| if ( ! isset( $_REQUEST['slack_slash'] ) && 'your_custom_string' != $_REQUEST['slack_slash'] ) | |
| return false; | |
| # Check to see if a token has been passed as well | |
| if ( ! isset( $_REQUEST['token'] ) ) |
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
| $ wp post list --format=ids | xargs wp post update --comment_status=closed | |
| # Output: | |
| # Success: Updated post 2514. | |
| # Success: Updated post 2511. | |
| # Success: Updated post 2504. | |
| # Success: Updated post 2499. | |
| # Success: Updated post 2441. | |
| # etc... |
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
| {"lastUpload":"2019-10-06T18:32:39.184Z","extensionVersion":"v3.4.3"} |
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 | |
| // PHP memory limit for this site | |
| define( 'WP_MEMORY_LIMIT', '128M' ); | |
| define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit. | |
| // Database | |
| define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database. | |
| define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users) | |
| // Explicitely setting url |
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 | |
| /** | |
| * Loop through an order's items and see if there's a free trial set | |
| * | |
| * @param WC_Order $order | |
| * @return bool|WP_Error | |
| */ | |
| function custom_order_has_trial( $order ) { | |
| if ( ! $order instanceof WC_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
| <?php | |
| /* | |
| Plugin Name: WooCommerce Notices Shortcode | |
| Plugin URI: https://gist.github.com/webaware/c6a6286026eb6a89e5a3 | |
| Description: display WooCommerce notices in any page by shortcode [woocommerce_notices] | |
| Author: WebAware | |
| Author URI: https://shop.webaware.com.au/ | |
| */ | |
| if (!defined('ABSPATH')) { |