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
| //Display the rating on a submitted comment. | |
| add_filter( 'comment_text', 'ci_comment_rating_display_rating' ); | |
| function ci_comment_rating_display_rating( $comment_text ) { | |
| if ( $rating = get_comment_meta( get_comment_ID(), 'rating', true ) ) { | |
| $stars = '<p class="stars">'; | |
| for ( $i = 1; $i <= 5 ; $i ++ ) { | |
| if ( $i <= $rating ) { | |
| $stars .= '<span class="dashicons dashicons-star-filled"></span>'; | |
| } else { |
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 rwk_change_query( $comments ) { | |
| $comments->query_vars['order'] = 'DESC'; | |
| $comments->meta_query->parse_query_vars( $comments->query_vars ); | |
| } | |
| add_action( 'pre_get_comments', 'rwk_change_query' ); |
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 hide_update_notice_to_all_users() { | |
| remove_action( 'admin_notices', 'update_nag', 3 ); | |
| add_action('init', create_function('$a',"remove_action( 'init', 'wp_version_check' );"),2); | |
| add_filter('pre_option_update_core','__return_null'); | |
| add_filter('pre_site_transient_update_core','__return_null'); | |
| } | |
| add_action( 'admin_head', 'hide_update_notice_to_all_users', 1 ); |
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 WC() { | |
| remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart'); | |
| remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart'); | |
| return WooCommerce::instance(); | |
| } |
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_single_product_summary', 'add_after_description_rwk', 25 ); | |
| function add_after_description_rwk() { | |
| ?> | |
| <div class="button">HIT ME</div> | |
| <?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
| document.addEventListener( 'wpcf7mailsent', function( event ) { | |
| var name = jQuery("input[name=your-name]").val(); | |
| var email = jQuery("input[name=your-email]").val(); | |
| var phone = jQuery("input[name=tel-151]").val(); | |
| var date = jQuery("input[name=date-146]").val(); | |
| var msg = jQuery("textarea[name=your-message]").val(); | |
| jQuery.post ('http:/url.tld?' + 'username=static_value' + '&password=static_value' + '&source=static_value' + '&clientName=' + name + '&clientEmail=' + email + '&clientPhone=' + phone + '&programmingDate=' + date + '&message=' + msg );}, false ); |
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 the column, we need to display it, right? | |
| function wc_order_extras_column_evd( $columns ) { | |
| $new_columns = array(); | |
| foreach ( $columns as $column_name => $column_info ) { | |
| $new_columns[ $column_name ] = $column_info; | |
| if ( 'order_total' === $column_name ) { | |
| $new_columns['order_phone'] = __( 'Phone no.', 'rwky_ro' ); | |
| } | |
| } | |
| return $new_columns; |
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
| // remove admin notices except admin | |
| add_action('admin_head', function() { | |
| if(!current_user_can('manage_options')){ | |
| remove_action( 'admin_notices', 'update_nag', 3 ); | |
| remove_action( 'admin_notices', 'maintenance_nag', 5 ); | |
| echo "<style>.notice, .update-nag , .error, .updated{ display:none!important; }</style>"; | |
| } | |
| }); | |
| @todo: find all actions and remove them and if it's not enough, CSS will do the trick! |
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
| select post_id from wprh_postmeta pm where pm.post_in not in (select ID from wprh_posts) |
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_admin_order_data_after_order_details', 'failed_orders_evd', 10, 2 ); | |
| function failed_orders_evd( $order ) { | |
| $customer_orders = get_posts( array( | |
| 'numberposts' => -1, | |
| // 'meta_key' => '_customer_user', | |
| 'meta_value' => $order->get_billing_email(), | |
| 'post_type' => 'shop_order', | |
| 'post_status' => array('wc-failed'), | |
| ) ); |