This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function vb_filter_posts() { | |
if( !isset( $_POST['nonce'] ) || !wp_verify_nonce( $_POST['nonce'], 'bobz' ) ) | |
die('Permission denied'); | |
/** | |
* Default response | |
*/ | |
$response = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$doc = $(document); | |
$doc.ready( function() { | |
/** | |
* Retrieve posts | |
*/ | |
function get_posts($params) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* AJAC filter posts by taxonomy term | |
*/ | |
function vb_filter_posts_mt() { | |
if( !isset( $_POST['nonce'] ) || !wp_verify_nonce( $_POST['nonce'], 'bobz' ) ) | |
die('Permission denied'); | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.sc-ajax-filter-multi').on('click', 'a[data-filter], .pagination a', function(event) { | |
if(event.preventDefault) { event.preventDefault(); } | |
$this = $(this); | |
/** | |
* Set filter active | |
*/ | |
if ($this.data('filter')) { | |
$page = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function vb_filter_posts_mt() { | |
if( !isset( $_POST['nonce'] ) || !wp_verify_nonce( $_POST['nonce'], 'bobz' ) ) | |
die('Permission denied'); | |
/** | |
* Default response | |
*/ | |
$response = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Check if term exists | |
*/ | |
if (!is_array($terms)) : | |
$response = [ | |
'status' => 501, | |
'message' => 'Term doesn\'t exist', | |
'content' => 0 | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
function triggerError($err, $status) { | |
$msg = false; | |
$errors = { | |
'e100' : "Something went wrong, please try again later", | |
'e101' : "Please enter you'r username and password", | |
'e102' : "Please enter you'r email", | |
'e103' : "Please populate all fields marked with *", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.toggler = function() { | |
return this.each( function() { | |
$(this).click(function(event) { | |
// Prevent click event on a tag | |
if ($(this).is('a')) { | |
if(event.preventDefault) { event.preventDefault(); } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.toggler { | |
overflow: hidden; | |
max-height: 0; | |
transition: max-height .3s ease-in; | |
} | |
.toggler.active { | |
max-height: 2000px; | |
transition: max-height .3s ease-out; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="#toggleMe" data-toggle="toggleMe">Toggle div</a> | |
<div id="toggleMe" class="toggler"> | |
Content goes here ... | |
</div> |