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 | |
# forget old rules | |
iptables -F | |
iptables -X | |
iptables -Z | |
# set default policy to drop | |
iptables -P INPUT DROP | |
iptables -P OUTPUT DROP |
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
find /install-path/ -type d -exec chmod 755 {} \; | |
find /install-path/ -type f -exec chmod 644 {} \; | |
chmod 400 wp-config.php |
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 | |
# | |
# Watch current directory (recursively) for file changes, and execute | |
# a command when a file or directory is created, modified or deleted. | |
# | |
# Written by: Senko Rasic <senko.rasic@dobarkod.hr> | |
# | |
# Requires Linux, bash and inotifywait (from inotify-tools package). | |
# | |
# To avoid executing the command multiple times when a sequence of |
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
# Settings for Atom editor |
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
if (!function_exists('get_post_id_by_meta_key_and_value')) { | |
function get_post_id_by_meta_key_and_value($key, $value) { | |
global $wpdb; | |
$meta = $wpdb->get_results("SELECT * FROM `".$wpdb->postmeta."` WHERE meta_key='".$wpdb->escape($key)."' AND meta_value='".$wpdb->escape($value)."'"); | |
if (is_array($meta) && !empty($meta) && isset($meta[0])) { | |
$meta = $meta[0]; | |
} | |
if (is_object($meta)) { | |
return $meta->post_id; |
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 update_post_meta( $post_id, $meta_key, $meta_value, $prev_value ); ?> | |
//add attendee to event ateendee list (relationship) | |
$event_id = $_POST['post_id']; | |
$attendee_list = get_field( 'attendees_list', $event_id ); | |
$new_attendee = get_post( $attendee_id ); | |
if( !is_array($attendee_list) ): | |
$attendee_list = array(); | |
endif; |
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
// This filter is executed during form load. When set to true, the form init scripts are loaded | |
// in the footer of the site, instead of the default location of which is in the page | |
// body immediately after the form. | |
add_filter( 'gform_init_scripts_footer', '__return_true' ); | |
// This example dynamically adds a custom class to all text fields | |
add_filter( 'gform_field_css_class', 'custom_class', 10, 3 ); | |
function custom_class( $classes, $field, $form ) { | |
if ( $field->type == 'text' ) { | |
$classes .= ' custom_textfield_class'; |
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
// Make everything static | |
class My_Plugin | |
{ | |
private static $var = 'foo'; | |
static function foo() | |
{ | |
return self::$var; // never echo or print in a shortcode! | |
} |
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 | |
class GFFormDisplay{ | |
public static $submission = array(); | |
private static $init_scripts = array(); | |
const ON_PAGE_RENDER = 1; | |
const ON_CONDITIONAL_LOGIC = 2; | |
public static function process_form($form_id){ |
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
<noscript> | |
<style type="text/css"> | |
.pagecontainer {display:none;} | |
</style> | |
<div class="noscriptmsg"> | |
You don't have javascript enabled. Good luck with that. | |
</div> | |
</noscript> |
OlderNewer