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
UPDATE wp_options SET option_value = '' WHERE option_name = 'active_plugins'; |
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 | |
$parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] ); | |
require_once ($parse_uri[0] . 'wp-load.php'); | |
require_once($parse_uri[0] . '/wp-admin/includes/taxonomy.php'); | |
// Get coordinates for a specified address | |
function getCoordinates($address){ | |
$address = str_replace("Str.", "Strada", $address); |
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 | |
$new_general_setting = new new_general_setting(); | |
class new_general_setting { | |
function new_general_setting( ) { | |
add_filter( 'admin_init' , array( &$this , 'register_fields' ) ); | |
} | |
function register_fields() { | |
register_setting( 'general', 'OPTION_NAME', 'esc_attr' ); | |
add_settings_field('OPTION_NAME', '<label for="OPTION_NAME">'.__('OPTION_LABEL_TEXT' , 'OPTION_NAME' ).'</label>' , array(&$this, 'fields_html') , 'general' ); |
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 | |
// Generate a random string with a given lenght and set special char on or off | |
function random_gen($length, $special_char) { | |
$random = ""; | |
srand((double)microtime()*1000000); | |
$char_list = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
$char_list .= "abcdefghijklmnopqrstuvwxyz"; | |
$char_list .= "1234567890"; | |
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 | |
// Create a new database connection | |
$customdb = new wpdb(USERNAME, PASSWORD, DATABASE, 'localhost'); | |
$customdb->show_errors(); | |
?> |
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 | |
// Get date from Contact Form 7 before email send | |
add_action("wpcf7_before_send_mail", "wpcf7_save_data"); | |
function wpcf7_save_data(&$wpcf7_data) { | |
// Here is the variable where the data are stored! | |
$user_nume = $wpcf7_data->posted_data['user_nume']; | |
$user_email = $wpcf7_data->posted_data['user_email']; | |
// Set the cookies | |
setcookie('os_username', $user_nume, time() + (10*365*24*60*60)); |
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 | |
// HOW TO USE: | |
// Simply type in the url in the text box to reset the WordPress site url. | |
// WARNING: | |
// This file can be a HUGE security risk and has the potential to seriously | |
// mess up your site's database. Please use with caution and DELETE THIS FILE when you | |
// are done resetting your website. | |
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('post_type_link','custom_post_type_link',10,3); | |
function custom_post_type_link($permalink, $post, $leavename) { | |
$url_components = parse_url($permalink); | |
$post_path = $url_components['path']; | |
$post_name = end(explode('/', trim($post_path, '/'))); | |
if(!empty($post_name)) { | |
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 | |
// Get coordinates for a specified address | |
function getCoordinates($address){ | |
$address = str_replace(" ", "+", $address); // replcae all the white space with "+" sign to match with google search pattern | |
$url = "http://maps.google.com/maps/api/geocode/json?sensor=false&address=$address"; | |
$response = file_get_contents($url); | |
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
@echo off | |
title SVN Client v1.0 | |
echo #################################### | |
echo ## ## | |
echo ## Welcome to the SVN Client v1.0 ## | |
echo ## ## | |
echo #################################### | |
cd C:\Program Files\SlikSvn\bin\ |