MongoDB Crash Course 2022 < TODO: Add Video Link
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
| {% if craft.request.isAjax %} | |
| {% set layout = "_ajaxLayout" %} | |
| {% else %} | |
| {% set layout = "_layout" %} | |
| {% endif %} | |
| {% extends layout %} | |
| {% set limit = 10 %} | |
| {% set params = { section: 'news', limit: limit} %} |
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
| // JS for grabbing utm params and parsing into url | |
| var getRefQueryParam = function() { | |
| var temp = {}; | |
| document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function() { | |
| var decode = function(s) { | |
| return decodeURIComponent(s.split("+").join(" ")); | |
| }; | |
| temp[decode(arguments[1])] = decode(arguments[2]); | |
| }); | |
| return temp; |
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
| <?php | |
| // Published under GPL | |
| // tutorial here: https://codeable.io/community/how-to-import-json-into-wordpress/ | |
| class Developer_Import { | |
| public function __construct() { | |
| add_action( 'wp_ajax_import_developer', array( $this, 'import_developer' ) ); |
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 custom_query_shortcode($atts) { | |
| // EXAMPLE USAGE: | |
| // [loop the_query="showposts=100&post_type=page&post_parent=453"] | |
| // Defaults | |
| extract(shortcode_atts(array( | |
| "the_query" => '' | |
| ), $atts)); |