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_filter('pll_get_post_types', 'wearewp_add_acf_pll', 10, 2); | |
| function wearewp_add_acf_pll( $post_types, $is_settings ) { | |
| $post_types[] = 'acf-field-group'; | |
| return $post_types; | |
| } |
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
| """ | |
| Import Google Doc and export to CVS formatted for WP import. | |
| Python3 | |
| First use Requests to get the file as recommended: http://www.madhur.co.in/blog/2016/05/13/google-docs-spreadsheet.html | |
| Check to make sure that the file headers are what we expect and if not, exit. | |
| If headers do match, create rows in the new file, matching the needed columns with those from the import. |
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 ($) { | |
| $(document).ready(function ($) { | |
| var mz_mbo_state = { | |
| logged: mz_mindbody_schedule.loggedMBO, // from php | |
| html: undefined, | |
| target: undefined, | |
| siteID: undefined, | |
| nonce: undefined, |
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
| sudo iptables -L -n | |
| Chain INPUT (policy DROP) | |
| target prot opt source destination | |
| f2b-ssh tcp -- 0.0.0.0/0 0.0.0.0/0 multiport dports 22 | |
| f2b-sshd tcp -- 0.0.0.0/0 0.0.0.0/0 multiport dports 22 | |
| DROP all -- 0.0.0.0/0 0.0.0.0/0 ctstate INVALID | |
| ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED | |
| ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 | |
| LOG all -- 0.0.0.0/0 0.0.0.0/0 recent: UPDATE seconds: 3600 name: badguys side: source mask: 255.255.255.255 limit: avg 3/hour burst 5 LOG flags 0 level 4 prefix "iptables-recent-badguys: " | |
| DROP all -- 0.0.0.0/0 0.0.0.0/0 recent: UPDATE seconds: 3600 name: badguys side: source mask: 255.255.255.255 |
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
| set myMessage to "I'm cleaning up our mailing list. Please hit me back (or go to our site) if you want to be on the new one. | |
| Thanks and I hope you are doing wonderfully. | |
| Many blessings, Mike. | |
| http://www.madhappy.com | |
| " | |
| set mySubject to "New MadhaPPy email list" |
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 | |
| /** | |
| * Walker Class for List Category which also pulls in image from ACF Field | |
| * source: https://wordpress.stackexchange.com/a/170603/48604 | |
| * | |
| */ | |
| class List_Category_Walker extends Walker_Category { |
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
| def valid_url(url): | |
| if (url.lower() == 'none') or (url == ''): | |
| return False | |
| try: | |
| s = requests.Session() | |
| a = requests.adapters.HTTPAdapter(max_retries=5) | |
| s.mount(url, a) | |
| resp = s.head(url) | |
| return resp.ok | |
| except requests.exceptions.MissingSchema: |
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
| # Dependency: | |
| # sudo apt-get install librsvg2-bin | |
| # or brew install librsvg | |
| find . -type f -name "*.svg" -exec bash -c 'rsvg-convert -h 800 "$0" > "$0".png' {} \; |
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: Disable Event Espresso | |
| Plugin URI: http://www.mzoo.org | |
| Description: Disables event espresso plugin files from calls to all but specified pages | |
| Author: mZoo/Mike iLL | |
| Version: 1.0 | |
| Author URI: http://www.mzoo.org | |
| */ |
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_filter( 'em_events_build_sql_conditions', 'my_em_scope_conditions',1,2); | |
| function my_em_scope_conditions($conditions, $args){ | |
| if( !empty($args['scope']) && $args['scope']=='today-upcoming' ){ | |
| $start_date = date('Y-m-d',current_time('timestamp')); | |
| $end_date = date('Y-m-d',current_time('timestamp')); | |
| $start_time = date('H:i',current_time('timestamp')); | |
| $end_time = '23:59'; |