Skip to content

Instantly share code, notes, and snippets.

View bulentsakarya's full-sized avatar
🎯
Focusing

Bülent Sakarya bulentsakarya

🎯
Focusing
View GitHub Profile
@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 / 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 / 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( $ ){
<?php
/**
* @author Nivo Themes
* @since 1.0
* @package nivoshop
* @snippet Brand Metas
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@bulentsakarya
bulentsakarya / custom-sidebar-class.php
Created September 26, 2017 18:18
istediğiniz sayfaya özel sidebar oluşturma.
<?php
/**
* Nivoshop Custom Sidebar
*
* Özel sidebar metabox değeri true olan sayfaların sidebar'larının oluşturulduğu kod.
*
* @author Nivo Themes
* @since 1.0
* @package nivoshop
<?php
$lpa_az_args = array(
'posts_per_page' => -1,
'post_type' => 'urunler',
'orderby' => 'title',
'order' => 'ASC'
);
$lpa_az_posts = get_posts( $lpa_az_args );
@bulentsakarya
bulentsakarya / editor-custom-field.php
Created October 17, 2017 09:36
Editörü özel alana ekleme
class dd_slider_meta {
public function __construct() {
if ( is_admin() ) {
add_action( 'load-post.php', array( $this, 'init_metabox' ) );
add_action( 'load-post-new.php', array( $this, 'init_metabox' ) );
}
}
@bulentsakarya
bulentsakarya / custom-admin.php
Created October 21, 2017 00:44
admin panel özelleştirme
<?php
/*
Plugin Name: Admin Menu
Description: Admin paneli ve mneü özelleştirme
Version: 0.1
License: GPL
Author: Bülent Sakarya
Author URI: http://www.nivothemes.com
*/
function sc_draw_calendar( $month, $year ){
//start draw table
$calendar = '<table cellpadding="0" cellspacing="0" class="calendar">';
$day_names = array(
0 => __('Pazar', 'pippin_sc'),
1 => __('Pazartesi', 'pippin_sc'),
2 => __('Salı', 'pippin_sc'),
3 => __('Çarşamba', 'pippin_sc'),
public function cariyazdir($id)
{
$cari = Cari::where('musteriler_id', '=', $id)->orderBy('id', 'DESC')->get();
$borc = Cari::where('musteriler_id', '=', $id)->sum('borc');
$alacak = Cari::where('musteriler_id', '=', $id)->sum('alacak');
$durum = $borc - $alacak;
$durum = number_format($durum,2,",",".");
$musteri = Musteriler::find($id);
$html = '<html lang="tr-TR"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>';