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
/** | |
* Check User Status. | |
* | |
* @param $user WP_User Object | |
*/ | |
function check_status( $user, $username, $password ) { | |
$url = 'https://api.url'; | |
/* 1. user data exist */ | |
if(email_exists( $user->user_email )) { |
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 | |
require_once ('../../../wp-load.php'); | |
require_once ABSPATH . '/wp-admin/includes/taxonomy.php'; | |
date_default_timezone_set('Europe/Istanbul'); | |
$cities = array( | |
array( | |
"title" => "Adana", | |
"districts" => array("Aladağ","Ceyhan","Çukurova","Feke","İmamoğlu","Karaisalı","Karataş","Kozan","Pozantı","Saimbeyli","Sarıçam","Seyhan","Tufanbeyli","Yumurtalık","Yüreğir") |
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 | |
/* | |
* Çalışma koşulu şu şekilde; | |
* Ödeme ekranına geldiğinde müşteri varsayılan olarak T.C. alanını görecek ama araştırdığım ve öğrendiğim kadarıyla sadece 5000 TL ve üstü siparişler için T.C. numarası zorunluymuş bu yüzden zorunlu olmayacak. | |
* Zorunlu olmamasına rağmen eğer müşteri buraya yanlış bir T.C. yazarsa doğrulamadan geçecek ve eğer yazmak istemiyorsa boş bırakması için uyarı mesajı gelecek | |
* Eğer firma adına fatura isterse Kurumsal Sipariş Checkbox'ını işaretleyerek T.C. alanı gizlenecek ve vergi dairesi ile vergi numarası alanı gözükecek ve bu alanlar zorunlu olacak | |
* Not: T.C. numarası ve Vergi Numarası doğrulamadan geçiyor. | |
* Eksikler: T.C. Numarasını boş bırakabildikleri için veri tabanına o sipariş için 11111111111 yazdırmayı başaramadım. -> | |
* Ama 147. satırdaki kod sipariş ekranında bu bilgiyi gösteriyor, bunu nasıl yaparız bilen varsa yazsın -> | |
* Aslında 'default' => 11111111111 ile veritabanına bunu yazdırabilirim ama bunu set edince sipariş ekranında bu numaranın gözükmesi hoşuma git |
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
/*Contact form 7 remove span*/ | |
add_filter('wpcf7_form_elements', function($content) { | |
$content = preg_replace('/<(span).*?class="\s*(?:.*\s)?wpcf7-form-control-wrap(?:\s[^"]+)?\s*"[^\>]*>(.*)<\/\1>/i', '\2', $content); | |
$content = str_replace('<br />', '', $content); | |
return $content; | |
}); |
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
<hr /> | |
<div class="row"> | |
<div class="col-md-4"> | |
[text* your-name class:form-control placeholder "Name (required)"] | |
</div> | |
<div class="col-md-4"> | |
[email* your-email class:form-control placeholder "Email (required)"] |
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_shop_loop_item_title', '_new_badge_shop_page', 3 ); | |
function _new_badge_shop_page() { | |
global $product; | |
$gun = 30; // Etiket son 30 günde eklenen ürünlere eklenecek | |
$eklenme_tarihi = strtotime( $product->get_date_created() ); // Ürünün eklenme tarihi | |
if ( ( time() - ( 60 * 60 * 24 * $gun ) ) < $eklenme_tarihi ) { | |
echo '<span class="yeni onsale">' . esc_html__( 'Yeni!', 'wootemasi' ) . '</span>'; | |
} | |
} |
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
/** | |
* Vesta Bilgileri | |
*/ | |
$vst_hostname = 'localhost'; | |
$vst_username = 'admin'; | |
$vst_password = '123'; | |
/** | |
* Kullanıcı Bilgileri | |
*/ |
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( 'woocommerce_products_admin_list_table_filters', function( $filters ) { | |
if( isset( $filters[ 'product_type' ] ) ) { | |
$filters[ 'product_type' ] = 'misha_product_type_callback'; | |
} | |
return $filters; | |
}); | |
function misha_product_type_callback(){ |
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 Customize Product Types | |
*/ | |
function remove_product_types( $types ){ | |
//unset( $types['simple'] ); | |
//unset( $types['grouped'] ); | |
//unset( $types['external'] ); | |
//unset( $types['variable'] ); | |
return $types; |