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
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro | |
# | |
WP_OWNER=$1 # <-- wordpress owner | |
WP_GROUP=$1 # <-- wordpress group | |
WP_ROOT=$2 # <-- wordpress root directory |
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
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro | |
# | |
WP_OWNER=changeme # <-- wordpress owner | |
WP_GROUP=changeme # <-- wordpress group | |
WP_ROOT=/home/changeme # <-- wordpress root directory |
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
#!/bin/bash | |
# wp-local-setup-proxy.sh | |
# Automates the configuration of a WordPress (WP) site to proxy missing media files from a production server. | |
# ----------------------------------------------------------------------------------------- | |
# To use this script from anywhere on your system, follow these steps: | |
# For macOS and Linux: | |
# | |
# Using one line: |
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 | |
/** | |
* Retrieves a Ninja Forms submission by its form ID and sequence number. | |
* | |
* @param int|string $form_id The ID of the form. | |
* @param int|string $seq The sequence number of the submission. | |
* | |
* @return NF_Database_Models_Submission Returns an NF_Database_Models_Submission from Ninja Forms | |
*/ | |
if ( function_exists( 'Ninja_Forms' ) && ! function_exists( 'nf_get_sub_by_seq' ) ) { |
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
/** | |
* Smooth Vertical Scrolling on mouse wheel in vanilla JavaScript | |
*/ | |
function init(){ | |
new SmoothScroll(document, 30, 18) | |
} | |
function SmoothScroll(target, speed, smooth) { | |
if (target === document) | |
target = (document.scrollingElement |
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 | |
/** | |
* Save custom select options | |
* | |
**/ | |
function acf_save_custom_select_options( $value, $post_id, $field ) { | |
if ( ! $field['allow_custom'] || ! $field['{theme_name}_save_custom'] ) { | |
return $value; | |
} |
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 | |
/** | |
* Add a link style to the WordPress link editor | |
* | |
*/ | |
add_action( | |
'after_wp_tiny_mce', | |
function() { | |
?> |
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
/* | |
* TinyMCE Custom Styles | |
* https://codex.wordpress.org/TinyMCE_Custom_Styles | |
*/ | |
// Callback function to insert 'styleselect' into the $buttons array | |
function my_mce_buttons( $buttons ) { | |
unset( $buttons[0] ); | |
array_unshift( $buttons, 'styleselect' ); | |
return $buttons; |