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
| // Initialize modules | |
| // Importing specific gulp API functions lets us write them below as series() instead of gulp.series() | |
| const { src, dest, watch, series, parallel } = require('gulp'); | |
| // Importing all the Gulp-related packages we want to use | |
| const sass = require('gulp-sass')(require('sass')); | |
| const concat = require('gulp-concat'); | |
| const uglify = require('gulp-uglify'); | |
| const replace = require('gulp-replace'); |
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
| const files = { | |
| scssPath: [ | |
| 'sass/*.scss', | |
| 'sass/*/*.scss', | |
| 'node_modules/datatables.net-bs4/css/dataTables.bootstrap4.css', | |
| 'src/fontawesome/css/all.css' | |
| ], | |
| jsPaths: [ | |
| 'js/framework.js', | |
| 'js/modal.js', |
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 move_fonts(){ | |
| return src( [ 'src/fontawesome/webfonts/*.{ttf,woff,woff2,eot,eof,svg}' ] ) | |
| .pipe(dest('webfonts') | |
| ); | |
| } |
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 create_bootstrap(){ | |
| return src( [ | |
| 'node_modules/popper.js/dist/umd/popper.min.js', | |
| 'node_modules/bootstrap/js/dist/util.js', | |
| 'node_modules/bootstrap/js/dist/modal.js', | |
| 'node_modules/bootstrap/js/dist/dropdown.js', | |
| 'node_modules/bootstrap/js/dist/collapse.js', | |
| 'node_modules/bootbox/bootbox.js', | |
| 'node_modules/datatables.net/js/jquery.dataTables.min.js', | |
| 'node_modules/datatables.net-bs4/js/dataTables.bootstrap4.js' |
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 scssTask(){ | |
| return src( files.scssPath ) | |
| .pipe(sass()) // compile SCSS to CSS | |
| .pipe( replace('../webfonts/fa-', 'webfonts/fa-') ) | |
| .pipe(concat('style.css')) | |
| .pipe(dest('./')) | |
| } | |
| function jsTask(){ | |
| return src( files.jsPaths ) |
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
| // Watch task: watch SCSS and JS files for changes | |
| function watchTask(){ | |
| watch(files.scssPath, | |
| {interval: 1000, usePolling: true}, //Makes docker work | |
| series( | |
| parallel( scssTask ) | |
| ) | |
| ); | |
| watch(files.jsPaths, |
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
| // Export the default Gulp task so it can be run | |
| exports.default = series( | |
| create_bootstrap, | |
| scssTask, | |
| IETask, | |
| jsTask, | |
| move_fonts, | |
| watchTask, | |
| ); |
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
| // Initialize modules | |
| // Importing specific gulp API functions lets us write them below as series() instead of gulp.series() | |
| const { src, dest, watch, series, parallel } = require('gulp'); | |
| // Importing all the Gulp-related packages we want to use | |
| const sass = require('gulp-sass')(require('sass')); | |
| const concat = require('gulp-concat'); | |
| const uglify = require('gulp-uglify'); | |
| const replace = require('gulp-replace'); | |
| const files = { |
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
| public function podcast_adjust_queries($query){ | |
| if ( ! is_admin() && is_post_type_archive( 'podcast' ) && $query->is_main_query() ) { | |
| // if options to exclude | |
| $inc_articles = get_option( 'options_include_audio_articles_in_podcast_archive' ); | |
| if ( $inc_articles ) { | |
| $query->set( 'post_type', array( 'podcast', 'articles' ) ); | |
| $query->set( 'posts_per_page', 1 ); | |
| $query->set( 'is_podcast_archive', 1 ); | |
| $query->set( 'meta_query', array( | |
| array( //meta_key for the articles which I am searching for |
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
| private function define_public_hooks() { | |
| //Query modification | |
| $this->loader->add_filter( 'pre_get_posts', $plugin_public, 'podcast_adjust_queries' ); | |
| $this->loader->add_filter( 'template_include', $plugin_public, 'podcast_adjust_archive' ); | |
| } |
OlderNewer