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: Bot For WP | |
Description: Messenger bot for WordPress | |
Plugin URI: http://snypd.com/ | |
Author: Sunny Luthra | |
Author URI: http://# | |
Version: 1.0 | |
License: GPL2 | |
*/ |
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 | |
$args = array( | |
'meta_query' => array( | |
'relation' => 'OR', | |
array( | |
'key' => 'skill', | |
'value' => 'php', | |
'compare' => '=' | |
), |
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 get_user_id_by_meta($key, $value) { | |
if (!$key && !$value) { | |
return false; | |
} | |
$args = array( | |
'meta_key' => $key, | |
'meta_value' => $value, | |
'fields' => 'ids', | |
'count_total' => false, |
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
@mixin class-generator($classNamespace, $fromValue, $toValue, $multiple, $property, $unit) { | |
@for $i from $fromValue to $toValue { | |
.#{$classNamespace}#{$i*$multiple} { | |
#{$property}: #{$i*$multiple}#{$unit}; | |
} | |
} | |
} | |
@include class-generator(pt, 0, 25, 5, padding-top, px); |
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
function verify_notification_token($token) { | |
$fields = array( | |
'dry_run' => true, | |
'to' => $token, | |
); | |
$headers = array( | |
'Authorization: key=' . GOOGLE_API_SERVER_KEY, | |
'Content-Type: application/json', | |
); | |
$ch = curl_init(); |
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
function generate_token() { | |
return bin2hex(openssl_random_pseudo_bytes($this->token_length)); | |
} |
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
var deleteSpam = { | |
count: 0, | |
list: null, | |
timeout: 500, | |
//Selector of cross(x) link | |
crossSelector: '.userContentWrapper [aria-label="Delete"]', | |
//Selector for buttons wrapper in overlay box which appears when we click on cross icon | |
overlayPresenseSelector: '.uiOverlayFooter', | |
//Delete button selector on overlay box | |
confirmDeleteButtonSelector: 'button.layerConfirm', |
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 alter_table(){ | |
global $wpdb; | |
$sql = "ALTER TABLE ".$wpbd -> posts." ADD `likes_count` INT( 11 ) NOT NULL DEFAULT '0'" | |
$wpdb -> query($sql); | |
} | |
function on_create_blog( $blog_id, $user_id, $domain, $path, $site_id, $meta ) { | |
switch_to_blog( $blog_id ); | |
alter_table(); | |
restore_current_blog(); |
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
Show hidden characters
{ | |
"bold_folder_labels": true, | |
"caret_extra_width": 1, | |
"caret_style": "phase", | |
"close_windows_when_empty": false, | |
"color_scheme": "Packages/User/SublimeLinter/Seti_orig (SL).tmTheme", | |
"copy_with_empty_selection": false, | |
"detect_slow_plugins": false, | |
"drag_text": false, | |
"draw_centered": false, |
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
require_once( ABSPATH . 'wp-admin/includes/file.php' ); | |
require_once( ABSPATH . 'wp-admin/includes/image.php' ); | |
$uploadedfile = $_FILES['file']; | |
$upload_overrides = array( 'test_form' => false ); | |
$movefile = wp_handle_upload( $uploadedfile, $upload_overrides ); | |
if ( $movefile ) { | |
$wp_filetype = $movefile['type']; | |
$filename = $movefile['file']; | |
$wp_upload_dir = wp_upload_dir(); |
NewerOlder