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
| $('#_dlr_select_product').select2({ | |
| "language": { | |
| "noResults": function(){ | |
| return 'هیچ محصولی یافت نشد!'; | |
| }, | |
| inputTooShort: function() { | |
| return 'لطفا سه حرف اول عنوان محصول را وارد نمایید'; | |
| }, | |
| searching: function() { | |
| return "در حال جستجو ..."; |
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
| global $role; | |
| $wp_roles = wp_roles(); | |
| $count_users = ! wp_is_large_user_count(); | |
| $url = 'admin.php?page=dlrm-users-wallet'; | |
| $role_links = array(); | |
| $avail_roles = array(); |
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
| woo_wallet()->wallet->credit($user_id, $amount, $description); | |
| woo_wallet()->wallet->debit($user_id, $amount, $description); |
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
| in functions.php | |
| function DV_deactive_jetpack() { | |
| wp_dequeue_script( 'devicepx' ); | |
| wp_dequeue_script( 'woo-tracks' ); | |
| } | |
| add_action( 'admin_enqueue_scripts', 'DV_deactive_jetpack' ); |
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 override_external_product_url( $url, $product ) | |
| { | |
| if ( 'external' === $product->get_type() ) | |
| { | |
| $url = 'https://biawp.ir'; | |
| } | |
| return $url; | |
| } | |
| add_filter( 'woocommerce_product_add_to_cart_url', 'override_external_product_url', 10, 2 ); |
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_filter( 'postmeta_form_keys', 'filter_function_name_1552', 10, 2 ); | |
| function filter_function_name_1552( $keys, $post ){ | |
| if($post->post_type == 'car') { | |
| $keys[] = 'regular_price'; | |
| } | |
| return $keys; | |
| } |
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 artisan make:test MyTest //create a feature test | |
| php artisan make:test MyTest --unit //create a unit test | |
| php artisan test --testsuite=Feature //run just features test | |
| php artisan test --testsuite=Unit //run just unit test | |
| php artisan --stop-on-failure //stop if a test failured |
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
| Go to phpunit.xml | |
| before end tag, add This | |
| <testsuites> | |
| <testsuite name="Application Test Suite"> | |
| <testsuite name="Modules Test Suite"> | |
| <directory>./Modules/*/Tests</directory> | |
| </testsuite> | |
| </testsuite> | |
| </testsuites> |
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 my_custom_product_filters( $post_type ) { | |
| $value1 = ''; | |
| $value2 = ''; | |
| if( isset( $_GET['p_thumb'] ) ) { | |
| switch( $_GET['p_thumb'] ) { | |
| case 0: |
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_usermeta | |
| WHERE NOT EXISTS ( | |
| SELECT * FROM wp_users | |
| WHERE wp_usermeta.user_id = wp_users.ID | |
| ) |
NewerOlder