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
| UPDATE wp_postmeta SET meta_value = 'yes' WHERE meta_key like '_specifications_display_attributes' |
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
| /** | |
| * | |
| * Plugin Name: WooCommerce Enable Reviews - Bulk Edit | |
| * Description: Allow enable reviews by bulk edit into WooCommerce | |
| * Version: 1.0.0 | |
| * Author: Mário Valney | |
| * Author URI: http://mariovalney.com | |
| * Text Domain: woo-enable-reviews-bulk-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
| /** | |
| * @snippet Checkbox to display Custom Product Badge Part 1 - WooCommerce | |
| * @how-to Get CustomizeWoo.com FREE | |
| * @source https://businessbloomer.com/?p=17419 | |
| * @author Rodolfo Melogli | |
| * @compatible Woo 3.5.3 | |
| * @donate $9 https://businessbloomer.com/bloomer-armada/ | |
| */ | |
| // First, let's remove related products from their original position |
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
| jQuery(document).ready(function($){ | |
| var el = $('.realfactory-header-wrap'); | |
| var top = $(el).offset().top + $(document).scrollTop(); | |
| var el_height = $(el).height(); | |
| $(document).scroll(function(){ | |
| var scrollTop = $(document).scrollTop(); | |
| var $logo = $( '<div class="logo"></div>'); | |
| console.log(scrollTop); | |
| if ( scrollTop > el_height && !el.is('.highlighted') ){ |
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
| add_action( 'woocommerce_before_checkout_process', 'wc_before_checkout_process', 999 ); // hook, function name, priority | |
| function wc_before_checkout_process(){ // function name | |
| foreach ( WC()->cart->get_cart() as $cart_item ) { // loop wc cart | |
| $item_id = $cart_item['data']->get_id(); // item id | |
| $is_ticket = get_post_meta( $item_id, '_tutor_product', true ); // get post meta field '_tutor_product' | |
| if( $is_ticket ){ // if ticket | |
| if( isset( $_POST['primarycontactemail'] ) ){ // if field exists | |
| if ( !empty( $_POST['primarycontactemail'] ) ){ // if field not empty | |
| if ( ! is_user_logged_in() ) { // if user not logged in | |
| nocache_headers(); // clear headers |
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 | |
| /* | |
| * ================================================================================================= | |
| * Below both hooks works for custom post types. | |
| * e.g. Suppose we have custom post-type name : Books | |
| * @ref https://codex.wordpress.org/Plugin_API/Action_Reference/manage_$post_type_posts_custom_column | |
| * ================================================================================================= | |
| */ |
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
| /* | |
| This code snippet can be added to your functions.php file (without the <?php) | |
| to add a query string to the login link emailed to the user upon registration | |
| which when clicked will validate the user, log them in, and direct them to | |
| the home page. | |
| */ | |
| /** | |
| * This first function is hooked to the 'user_register' action which fires | |
| * during the new user registration process. The process here gets some of |
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
| // https://www.quickcleancode.com/how-to-use-advanced-custom-fields-to-create-user-groups/ | |
| add_action('publish_post', 'notifyauthor'); | |
| function notifyauthor() { | |
| $loop = new WP_Query(array('post_type' => 'groups', 'posts_per_page' => -1, 'order' => 'ASC')); | |
| while ($loop->have_posts()) : $loop->the_post(); | |
| if(have_rows('members')): | |
| while (have_rows('members')) : the_row(); |
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
| /** | |
| * Hide Course complete button until complete all lessons in Tutor LMS | |
| * | |
| */ | |
| add_filter('tutor_course/single/complete_form', 'tutor_lms_hide_course_complete_btn'); | |
| function tutor_lms_hide_course_complete_btn($html){ | |
| $completed_lesson = tutils()->get_completed_lesson_count_by_course(); | |
| $lesson_count = tutils()->get_lesson_count_by_course(); |
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
| function wporg_remove_all_dashboard_metaboxes() { | |
| // Remove Welcome panel | |
| remove_action( 'welcome_panel', 'wp_welcome_panel' ); | |
| // Remove the rest of the dashboard widgets | |
| remove_meta_box( 'dashboard_primary', 'dashboard', 'side' ); | |
| remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); | |
| remove_meta_box( 'health_check_status', 'dashboard', 'normal' ); | |
| remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' ); | |
| remove_meta_box( 'dashboard_activity', 'dashboard', 'normal'); | |
| } |