Skip to content

Instantly share code, notes, and snippets.

@ahmad24
ahmad24 / delete-comment
Created December 8, 2013 09:24
wordpress : Delete-comment
<?php
file : delete-comment/readmore.php
?>
<?php
/*
Plugin Name: Instant Delete Comment
Plugin URI: http://example.com/
Description: Add a quick link to instantly delete comments
Author: Ozh
Version: 1.0
@ahmad24
ahmad24 / readmore-ajax
Created December 8, 2013 09:13
wordpress : readmore ajax
readmore
@ahmad24
ahmad24 / ajax-skeleton
Created December 8, 2013 09:03
wordpress : ajax skeleton
<SCRIPT TYPE="text/javascript">
var data = {
action: 'boj_myplugin_do_ajax_request',
some_var: 'some value',
other_var: 'other value'
};
jQuery.post( 'http://example.com/wp-admin/admin-ajax.php', data, function( resp ) {
/*
1. process response object 'resp'
2. update part of page
@ahmad24
ahmad24 / load-tweets-ajax
Created December 8, 2013 07:09
jQuery : load tweets ajax
<script type="text/javascript">
// When the DOM is ready, add behavior to the link
$(document).ready(function(){
$('#load').click(function(){
load_tweets();
// Skip default behavior (ie redirecting to the link href)
return false;
});
@ahmad24
ahmad24 / jquery-plugin
Created December 7, 2013 14:10
jQuery : scheleton plugin
(function($){
$.fn.center = function(){
var element = this;
$(element).load(function(){
changeCss();
@ahmad24
ahmad24 / format-endpoint rewrite-rule
Created December 7, 2013 12:37
wordpress : Format endpoint rewrite rule
Format endpoint
@ahmad24
ahmad24 / rewrite-link
Created December 7, 2013 12:22
wordpress : rewrite link
@ahmad24
ahmad24 / user-favorite-post
Created December 7, 2013 09:22
wordpress : User Favorite Post
User Favorite Post
@ahmad24
ahmad24 / additional-contact
Created December 7, 2013 09:15
wordpress : additional contact for user
<?php
/*
Plugin Name: User Contact Methods
Plugin URI: http://example.com
Description: Additional user contact methods.
Author: WROX
Author URI: http://goo.com
*/
/* Add a filter to the hook. */
add_filter( 'user_contactmethods', 'boj_user_contactmethods' );
@ahmad24
ahmad24 / insert user
Created December 7, 2013 08:51
wordpress : insert user
<?php
/*
Plugin Name: Insert User
Plugin URI: http://example.com
Description: Plugin that inserts a user.
Version: 0.1
Author: WROX
Author URI: http://goo.com
*/
/* Insert the new user on the 'init' hook. */