Skip to content

Instantly share code, notes, and snippets.

View asifsaho's full-sized avatar
💙

Asif Nawaz asifsaho

💙
View GitHub Profile
<?php
function init_url_rewrite_rule(){
add_rewrite_endpoint( 'edit',EP_PERMALINK | EP_PAGES | EP_ATTACHMENT );
if(get_option("EDIT_REWRITE_RULE")!=1){
flush_rewrite_rules();
update_option("EDIT_REWRITE_RULE",1);
}
}
function redirect_edit_url(){
@asifsaho
asifsaho / wp-query-ref.php
Last active August 29, 2015 14:10 — forked from luetkemj/wp-query-ref.php
WP_ Query Class Arguments List
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
@asifsaho
asifsaho / .htaccess
Last active August 29, 2015 14:21 — forked from oritromax/.htaccess
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
<FilesMatch "\.(bmp|cur|gif|ico|jpe?g|png|svgz?|webp)$">
SetEnvIf Origin ":" IS_CORS
Header set Access-Control-Allow-Origin "*" env=IS_CORS
</FilesMatch>
</IfModule>
</IfModule>
<IfModule mod_headers.c>
@asifsaho
asifsaho / bootstrap-pagination.php
Last active August 29, 2015 14:24 — forked from ediamin/bootstrap-pagination.php
Bootstrap style pagination support for WordPress
/*
* custom pagination with bootstrap .pagination class
* source: http://www.ordinarycoder.com/paginate_links-class-ul-li-bootstrap/
*/
function bootstrap_pagination( $echo = true ) {
global $wp_query;
$big = 999999999; // need an unlikely integer
$pages = paginate_links( array(
@asifsaho
asifsaho / WP:bootstrap-paginations.php
Created September 25, 2015 16:20
WP:bootstrap paginations
function custom_pagination() {
global $wp_query;
$big = 999999999; // need an unlikely integer
$pages = paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages,
'prev_next' => false,
'type' => 'array',
@asifsaho
asifsaho / mysql-backup_restore.md
Last active June 22, 2020 20:06 — forked from milon/mysql-backup_restore.md
Mysql: Backup and Restore

#Mysql: Backup and Restore

Mysql Backup and restore through command line.

Backup

mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql
mysqldump -u root -p --all-databases > alldb.sql

@asifsaho
asifsaho / tkstar-tk915.adoc
Created September 14, 2024 16:27 — forked from gmarfjan/tkstar-tk915.adoc
Commands for managing a tk-start tk915 GPS tracker

TKSTAR-TK915 SMS Commands

Nota

  • <space> means space character

  • <phone number> like 00330612345678 (prefer international format)

Table 1. Admin commands