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 check validation of add to cart notice based on product categories | |
| */ | |
| function sample_add_to_cart_validation( $passed, $product_id, $quantity, $variation_id = '', $variation = '' ) { | |
| // Check if the cart is empty | |
| if( WC()->cart->is_empty() ) { | |
| // If cart is empty, prevent adding accessories | |
| if( has_term( 'accessories', 'product_cat', $product_id ) ) { | |
| wc_add_notice(__('You cannot add accessories to an empty cart.', 'your-text-domain'), 'error'); |
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 | |
| /** | |
| * Product Transfer Class File | |
| * | |
| * @package WDM - WC Product Transfer | |
| * @since 1.0 | |
| */ | |
| if( ! defined( 'ABSPATH' ) ) { | |
| exit; // Exit if accessed directly. |
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 to create a Zoom Meeting | |
| */ | |
| function sample_create_zoom_meeting_proccess() { | |
| // Taking some variables | |
| $host_user = "host_user_email" // Get email from zoom meeting | |
| $client_id = 'client_id'; | |
| $client_secret = 'client_secret'; |
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 | |
| /** | |
| * 'sample_authentication' Shortcode | |
| */ | |
| if ( ! defined( 'ABSPATH' ) ) { | |
| exit; // Exit if accessed directly. | |
| } | |
| function sample_authentication_shrt_render( $atts, $content = null ) { |
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 | |
| /** | |
| * Custom Email Class | |
| * | |
| * @package Custom WooCommerce Email | |
| * @since 1.0.0 | |
| */ | |
| if ( ! defined( 'ABSPATH' ) ) { | |
| exit; // Exit if accessed directly. |
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 | |
| // Filter to change the WooCommerce Payment Gateway Ordering | |
| add_filter( 'woocommerce_available_payment_gateways', 'sample_available_payments' ); | |
| /* | |
| * Function to check available payment method then change the ordering | |
| */ | |
| function sample_available_payments( $available_gateways ) { | |
| // Taking some variables |
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 | |
| // Taking some variables | |
| $user_id = 1; | |
| $course_id = 156; | |
| $course_complete_date = current_time( 'timestamp' ); | |
| // Function to complete course process | |
| learndash_process_mark_complete( $user_id, $course_id ); | |
| // Complete course to user meta |
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 | |
| /* | |
| * Follow Below steps: | |
| * Create a `Server-To-Server OAuth` from here: https://marketplace.zoom.us/develop/create | |
| * In that app defin this scopes: https://prnt.sc/VR5W952Xmo-- | |
| */ | |
| // Get Meeting poll data on WordPress `init` action | |
| add_action( 'init', 'sample_zoom_meeting_proccess_data' ); |
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
| Options +FollowSymLinks -MultiViews | |
| # Turn mod_rewrite on | |
| RewriteEngine On | |
| RewriteBase / | |
| # To externally redirect /dir/foo.php to /dir/foo | |
| RewriteCond %{REQUEST_METHOD} !POST | |
| RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC] | |
| RewriteRule ^ %1 [R=302,L,NE] |
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 | |
| /** | |
| * WooCommerce Coupon Custom Field Class File | |
| */ | |
| if ( ! defined( 'ABSPATH' ) ) { | |
| exit; // Exit if accessed directly. | |
| } | |
| class Sample_WC_Coupon_Custom_Fields { |
NewerOlder