Skip to content

Instantly share code, notes, and snippets.

@ann71727
ann71727 / Prototype.class.js
Created October 14, 2019 16:16 — forked from jmcorpdev/Prototype.class.js
Js prototype with jquery plugin integration
/**
*
*/
(function ($) {
PluginName = function () {
this.init.apply(this, arguments);
};
@ann71727
ann71727 / PHPExcel_Basics.md
Created August 3, 2019 09:11 — forked from yajra/PHPExcel_Basics.md
PHPExcel Notes and code snippets

Basics

Creating a new PHPExcel Object.

    $this->PHPExcel = new PHPExcel();

Working with sheets

Creating a new sheet:

@ann71727
ann71727 / phpexcel applyfromarray.php
Last active August 3, 2019 09:36 — forked from codeachange/phpexcel applyfromarray.php
phpexcel 批量修改样式 applyFromArray 数组规则
<?php
/*** PHPExcel Object ***/
/* Get the default Style object */
(PHPExcel_Style) $style = ((PHPExcel) $excel)->getDefaultStyle()
/*** PHPExcel_Cell Object ***/
/* Get the Style object for a Cell */
@ann71727
ann71727 / get-unique-filename.php
Last active January 7, 2019 14:09
PHP 取唯一檔名 get unique filename
<?php
uniqid()
54e6d1765a02a
uniqid('img_')
img_54e6d1765a0ec
uniqid('', true)
54e6d1765a1044.98757507
@ann71727
ann71727 / example-data.php
Last active January 7, 2019 14:07
php ( 遞迴 ) 產生樹狀結構,不必重複連接資料庫
<?php
/**
* 樹狀結構 class
*
* @author VECTOR Ann <[email protected]>
* @link https://vector.cool
* @version 1.0.0
*/
$v_tree_demo = [
@ann71727
ann71727 / php multi-level category recursion
Last active January 5, 2019 21:50
PHP 無限層分類,包裹 HTML ul li 的架構 multi-level category recursion
/**
* get_childs function
* 無限層分類,包裹 HTML ul li 的架構
*
* @param array $items
* @param int $parent_id
* @return string
*
* @author VECTOR Ann <[email protected]>
* @link https://vector.cool
@ann71727
ann71727 / wp_nav_menu-text-and-classes.php
Last active November 5, 2017 20:26
wp_nav_menu() 修改或自訂義文字及類別
<?php
/**
* WordPress modify wp_nav_menu text and classes
* https://v123.tw
*/
$args = array(
'theme_location' => 'main-menu',
'container' => 'v123-nav',
'container_id' => 'v123-menu-menu',
'menu_class' => 'v123-menu-div',
@ann71727
ann71727 / wp-remove-all-notice-and-warning-with-user-role-editor.php
Created November 1, 2017 23:25
WordPress remove all notice and warning with user role editor
<?php
/**
* WordPress remove all notice and warning with user role editor
* https://v123.tw
*/
add_filter('ure_role_additional_options', 'ure_add_block_admin_notices_option', 10, 1);
function ure_add_block_admin_notices_option($items) {
$item = URE_Role_Additional_Options::create_item('block_admin_notices', esc_html__('Block admin notices', 'user-role-editor'), 'admin_init', 'ure_block_admin_notices');
$items[$item->id] = $item;
@ann71727
ann71727 / wp-remove-notice-and-warning.php
Last active November 1, 2017 23:28
WordPress Remove notice and warning
<?php
/**
* WordPress Remove notice and warning
* https://v123.tw
*/
add_action('admin_print_scripts', 'ure_remove_admin_notices');
function ure_remove_admin_notices() {
global $wp_filter;
if (is_user_admin()) {
if (isset($wp_filter['user_admin_notices'])) {
@ann71727
ann71727 / remove-wp-Divi-Project-post-type.php
Created November 1, 2017 22:09
刪除 WordPress Divi Project post type
<?php
/**
* 刪除 WordPress Divi Project post type.
* https://v123.tw
*/
add_filter( 'et_project_posttype_args', 'mytheme_et_project_posttype_args', 10, 1 );
function mytheme_et_project_posttype_args( $args ) {
return array_merge( $args, array(
'public' => false,
'exclude_from_search' => false,