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 my_plugin_enqueue_scripts() { | |
wp_enqueue_script('my-plugin', plugins_url('/assets/js/init.js', __FILE__), [], '', true); | |
wp_localize_script('my-plugin', 'myAjaxVar', [ | |
'ajaxurl' => admin_url('admin-ajax.php'), | |
'url' => 'https://ckp.ie' | |
]); | |
} | |
add_action('wp_enqueue_scripts', 'my_plugin_enqueue_scripts'); |
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
<html> | |
<head> | |
<title>Find String</title> | |
</head> | |
<body> | |
<?php | |
ini_set('max_execution_time', '0'); | |
ini_set('set_time_limit', '0'); | |
find_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
<?php if(!isset($_POST['send'])) { ?> | |
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> | |
<noscript><input type="hidden" name="havejs" id="havejs"></noscript> | |
<input type="hidden" name="send" value="send"> | |
<!-- spam bait - if the bcc field contains anything, this email is rejected --> | |
<!--<input type="text" name="bcc" />--> | |
<!--<label for="bcc">Bcc</label>--> | |
<p><input type="text" name="name" required><label for="name">Name</label></p> | |
<p><input type="text" name="phone" required><label for="phone">Phone</label></p> |
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 | |
/* | |
* Pagination class for WordPress 4.7+ and PHP 7+ | |
*/ | |
class Pagination { | |
var $total_pages = -1; | |
var $limit = 20; | |
var $target = ''; | |
var $page = 1; | |
var $adjacents = 1; |
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 | |
register_activation_hook( __FILE__, 'add_last_activity_for_all_users' ); | |
function add_last_activity_for_all_users() { | |
global $wpdb; | |
$sql = $wpdb->prepare( " | |
SELECT | |
u.ID | |
FROM | |
$wpdb->users AS u |
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 | |
$age_filter = function ( $where = '' ) use ( $options ) { | |
$where .= " AND post_date > '" . date( 'Y-m-d', strtotime( '-' . $options[ 'max_post_age' ] ) ) . "'"; | |
return $where; | |
}; | |
add_filter( 'posts_where', $age_filter ); | |
$query = new WP_Query( $args ); | |
remove_filter( 'posts_where', $age_filter ); |
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
* { | |
/** | |
* Improve font rendering and readability/legibility on MacOS and Windows | |
*/ | |
text-rendering: optimizeLegibility; | |
-webkit-font-smoothing: antialiased; | |
-moz-osx-font-smoothing: grayscale; | |
-moz-font-feature-settings: "liga=1, dlig=1"; |
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 smilieMe($text) { | |
$smiliesFind = array( | |
'/:\)/', | |
'/:P/', | |
'/:D/', | |
'/:S/', | |
'/:\(/', | |
'/:8/', | |
'/:tea/', |
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 | |
/* | |
Plugin Name: Mingle Forum Guest Info | |
Plugin URI: http://wpweaver.info/plugins/ | |
Description: This is an add on to the Mingle Forum. It allows you allow geust posts without registration while requiring a name and e-mail to make posts easier to track. | |
Version: 1.0.2 | |
Author: Bruce Wampler | |
Author URI: http://wpweaver.info | |
Text Domain: mingleforumguest | |
Copyright: 2009-2011, Bruce Wampler |
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 | |
/* | |
* POSSIBLE PATTERNS="passthru|shell_exec|system|phpinfo|base64_decode|popen|exec|proc_open|pcntl_exec|python_eval|fopen|fclose|readfile" | |
*/ | |
ini_set('max_execution_time', '0'); | |
ini_set('set_time_limit', '0'); | |
find_files('.'); | |
function find_files($seed) { | |
if(!is_dir($seed)) return false; | |
$files = array(); |
NewerOlder