Skip to content

Instantly share code, notes, and snippets.

Avatar

Mohammed malasaad82

  • Sweden
View GitHub Profile
@malasaad82
malasaad82 / FallbackAliasStorage.php
Last active Jan 24, 2019 — forked from mohit-rocks/FallbackAliasStorage.php
Multilingual URL Alias Fallback.. Move FallbackAliasStorage.php inside src folder
View FallbackAliasStorage.php
<?php
namespace Drupal\my_module;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Path\AliasStorageInterface;
class FallbackAliasStorage implements AliasStorageInterface {
@malasaad82
malasaad82 / functions.php
Created Mar 30, 2017 — forked from Bobz-zg/functions.php
Filter WordPress posts by custom taxonomy term with AJAX
View functions.php
<?php
/**
* AJAC filter posts by taxonomy term
*/
function vb_filter_posts() {
if( !isset( $_POST['nonce'] ) || !wp_verify_nonce( $_POST['nonce'], 'bobz' ) )
die('Permission denied');
/**
@malasaad82
malasaad82 / main.js
Created Mar 30, 2017 — forked from Bobz-zg/main.js
Filter WordPress posts by custom taxonomy term with AJAX - Javscript
View main.js
(function($) {
$doc = $(document);
$doc.ready( function() {
/**
* Retrieve posts
*/
function get_posts($params) {