Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
<?php | |
//Simple Ajax Login Form | |
//Source: http://natko.com/wordpress-ajax-login-without-a-plugin-the-right-way/ | |
//html | |
<form id="login" action="login" method="post"> | |
<h1>Site Login</h1> | |
<p class="status"></p> | |
<label for="username">Username</label> | |
<input id="username" type="text" name="username"> |
Getting started:
Related tutorials:
<?php | |
add_filter( 'wp_headers', array( 'eg_send_cors_headers' ), 11, 1 ); | |
function eg_send_cors_headers( $headers ) { | |
$headers['Access-Control-Allow-Origin'] = get_http_origin(); // Can't use wildcard origin for credentials requests, instead set it to the requesting origin | |
$headers['Access-Control-Allow-Credentials'] = 'true'; | |
// Access-Control headers are received during OPTIONS requests | |
if ( 'OPTIONS' == $_SERVER['REQUEST_METHOD'] ) { |
<?php | |
/** | |
* WordPress custom install script. | |
* | |
* Drop-ins are advanced plugins in the wp-content directory that replace WordPress functionality when present. | |
* | |
* Language: nl | |
* | |
* if ( file_exists( WP_CONTENT_DIR . '/install.php' ) ) { | |
* require ( WP_CONTENT_DIR . '/install.php' ); |
<?php | |
// No, Thanks. Direct file access forbidden. | |
! defined( 'ABSPATH' ) AND exit; | |
// INIT | |
add_action( 'after_setup_theme', array( 'unavailable_post_status', 'init' ) ); | |
class unavailable_post_status extends wp_custom_post_status | |
{ | |
/** |
<?php | |
function filter_get_avatar_url( $url, $user_id ) { | |
// make filter magic happen here... | |
$get_img = get_user_meta( $user_id, 'meta_key', true ); | |
if($get_img){ | |
return $get_img; | |
} |
<?php | |
function charity_post_type_register() { | |
$labels = array( | |
'name' => __( 'Charities', 'text-domain' ), | |
'singular_name' => __( 'Charity', 'text-domain' ), | |
'add_new' => _x( 'Add New Charity', 'text-domain', 'text-domain' ), | |
'add_new_item' => __( 'Add New Charity', 'text-domain' ), | |
'edit_item' => __( 'Edit Charity', 'text-domain' ), |
<?php | |
$codes = [ | |
'ab' => 'Abkhazian', | |
'aa' => 'Afar', | |
'af' => 'Afrikaans', | |
'ak' => 'Akan', | |
'sq' => 'Albanian', | |
'am' => 'Amharic', | |
'ar' => 'Arabic', |