Skip to content

Instantly share code, notes, and snippets.

View bulentsakarya's full-sized avatar
🎯
Focusing

Bülent Sakarya bulentsakarya

🎯
Focusing
View GitHub Profile
<?php
/**
* @author Nivo Themes
* @since 1.0
* @package nivoshop
* @snippet Brand Metas
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@bulentsakarya
bulentsakarya / builder.js
Last active September 7, 2017 20:22
nivo page builder
/**
* f(x) Page Builder Base Admin JS
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*
* @link https://shellcreeper.com/wp-page-builder-plugin-from-scratch/
* @author David Chandra Purnama <[email protected]>
* @copyright Copyright (c) 2016, Genbu Media
**/
jQuery( document ).ready( function( $ ){
@bulentsakarya
bulentsakarya / wp-chosen-tax-metabox.php
Created August 29, 2017 19:34 — forked from helen/wp-chosen-tax-metabox.php
Use Chosen for a replacement WordPress taxonomy metabox
<?php
/**
* WordPress Chosen Taxonomy Metabox
* Author: Helen Hou-Sandi
*
* Use Chosen for a replacement taxonomy metabox in WordPress
* Useful for taxonomies that aren't changed much on the fly and are
* non-hierarchical in nature, as Chosen is for flat selection only.
* You can always use the taxonomy admin screen to add/edit taxonomy terms.
* Categories need slightly different treatment from the rest in order to
@bulentsakarya
bulentsakarya / repeatable-fields-metabox.php
Created August 29, 2017 19:30 — forked from helen/repeatable-fields-metabox.php
Repeating Custom Fields in a Metabox
<?
/**
* Repeatable Custom Fields in a Metabox
* Author: Helen Hou-Sandi
*
* From a bespoke system, so currently not modular - will fix soon
* Note that this particular metadata is saved as one multidimensional array (serialized)
*/
function hhs_get_sample_options() {
@bulentsakarya
bulentsakarya / tax_validation.php
Created July 28, 2017 11:22 — forked from emir/tax_validation.php
PHP Vergi Numarası Doğrulama
<?php
/**
* This method logically validates Turkish VAT number
*
* @param string $taxNumber
* @return bool
*/
public function validateTaxNumber(string $taxNumber): bool
{
<?php
/**
* Plugin Name: WooCommerce Active Shipping Widget
* Plugin URI: https://www.skyverge.com/blog/how-to-create-a-woocommerce-widget/
* Description: Adds a widget to display a list of active WooCommerce shipping methods
* Author: SkyVerge
* Author URI: https://www.skyverge.com/
* Version: 1.0.0
* Text Domain: wc-active-shipping-widget
*
@bulentsakarya
bulentsakarya / pagination.php
Last active September 26, 2017 23:22
bootstrap 3.x based wordpress pagination
function nivo_pagination($pages = '', $range = 2){
$showitems = ($range * 2)+1;
global $paged;
if(empty($paged)) $paged = 1;
if($pages == '') {
global $wp_query;
$pages = $wp_query->max_num_pages;
if(!$pages) { $pages = 1; }
}
@bulentsakarya
bulentsakarya / cmb2 frontend
Created July 8, 2017 19:34
CMB 2 frontend post submit
<?php
/**
* @link http://webdevstudios.com/2015/03/30/use-cmb2-to-create-a-new-post-submission-form/ Original tutorial
*/
/**
* Register the form and fields for our front-end submission form
*/
function wds_frontend_form_register() {
@bulentsakarya
bulentsakarya / cmb2 code field
Created July 1, 2017 18:23
cmb2 code field
add_action( 'cmb2_init', 'wprsscode_add_metabox' );
function wprsscode_add_metabox() {
$prefix = '_cmb_';
$cmb = new_cmb2_box( array(
'id' => $prefix . 'wprss_code',
'title' => __( 'Your Code', 'nivothemes' ),
'object_types' => array( 'post' ),
'context' => 'advance',
@bulentsakarya
bulentsakarya / gist:e33e0078ea0f45e5a017b99cdd663b7f
Created March 25, 2017 19:57 — forked from saltun/gist:439794ab032b7a894d91
PHP TC Kimlik Numarası Doğrulama
<meta charset="utf-8">
<?php
function tcno_dogrula($bilgiler){
$gonder = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<TCKimlikNoDogrula xmlns="http://tckimlik.nvi.gov.tr/WS">
<TCKimlikNo>'.$bilgiler["tcno"].'</TCKimlikNo>
<Ad>'.$bilgiler["isim"].'</Ad>