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 | |
/** | |
* An example for including Advanced Custom Fields in your plugin | |
* Made for Premia (getpremia.com) | |
* WordPress premium plugins made easy! | |
*/ | |
class Your_Plugin { | |
public function __construct() { |
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
name: Create release | |
on: | |
release: | |
types: | |
- created | |
jobs: | |
build: | |
runs-on: ubuntu-latest |
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 | |
public static function process_text($text) { | |
return preg_replace_callback( | |
'/{{(.*?)\}}/', | |
function($matches) { | |
return sprintf('<span class="text-highlight">%s</span>', $matches[1]); | |
}, | |
$text | |
); | |
} |
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
// In this scenario a ZIP was returned upon form submission, because Gravity Forms | |
// does not expect this, the submit action is not reset. | |
// This snippet overrides the submit action. | |
document.addEventListener("DOMContentLoaded", function(){ | |
const form = document.querySelector('form.generate-template'); | |
const submit = form.querySelector('input.gform_button'); | |
submit.addEventListener('click', function() { | |
form.submit(); | |
}); | |
}); |
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
FROM nikolaik/python-nodejs:latest | |
RUN npm install -g nodemon |
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 | |
/** | |
* Plugin name: Allow email as WordPress Network/Multisite username | |
* Description: A wordpress mu-plugin that allows you to create users with email-addresses as usernames in multisite | |
* Version: 1.0 | |
* Author: @anttiviljami | |
* License: GPLv3 | |
*/ | |
add_filter( 'wpmu_validate_user_signup', '_signup_allow_email_as_username' ); |
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 | |
class Plugin { | |
public function __construct() { | |
add_filter( 'acf/settings/save_json', array( $this, 'acf_location' ) ); | |
add_filter( 'acf/settings/load_json', array( $this, 'acf_locations' ) ); | |
} | |
public function acf_location() { | |
return plugin_dir_path( __FILE__ ) . 'acf-json/'; |
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 | |
/* Customize the slug for the event taxonomy in Sympose */ | |
add_filter('sympose_customize_event_taxonomy', 'c7_sympose_alter_event_slug'); | |
function c7_sympose_alter_event_slug($args) { | |
$args['rewrite'] = array( | |
'slug' => 'sympose-event', | |
); | |
return $args; | |
} |
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
^/wp-content/uploads/(.*)-([0-9]+)x([0-9]+).(gif|jpe?g|png|bmp)$ | |
https://source.unsplash.com/random/$2x$3 | |
^/wp-content/uploads/(.*).(gif|jpe?g|png|bmp)$ | |
https://source.unsplash.com/random/600x600 |
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
# The script below is updated following a comment by RJT. | |
# If you use a different prefix, replace wp_users by the actual name of the table. | |
wp db query "ALTER TABLE wp_users ADD spam TINYINT NOT NULL DEFAULT 0;" | |
# When the spam column is missing, the ‘deleted’ column might be missing as well. | |
wp db query "ALTER TABLE wp_users ADD deleted TINYINT NOT NULL DEFAULT 0;" |