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
/** DISBALE WP-ADMIN FROM NON ADMIN : SOBER MEDIA 13/08/2016 **/ | |
add_action('admin_init', 'no_mo_dashboard'); | |
function no_mo_dashboard() { | |
$isAjax = (defined('DOING_AJAX') && true === DOING_AJAX) ? true : false; | |
//if (!current_user_can('manage_options') && $_SERVER['DOING_AJAX'] != '/wp-admin/admin-ajax.php') { | |
if(!$isAjax) { | |
if(!current_user_can('administrator')) { | |
wp_redirect('http://www.example.com/'); exit; |
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
add_filter( 'woocommerce_page_title', 'woo_shop_page_title'); | |
function woo_shop_page_title( $page_title ) { | |
if( 'Shop' == $page_title) { | |
return "Place your new shop page title here"; | |
} | |
} |
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
add_filter('woocommerce_get_availability', 'availability_filter_func'); | |
function availability_filter_func($availability) | |
{ | |
$availability['availability'] = str_ireplace('Out of stock', 'Sold', $availability['availability']); | |
return $availability; | |
} |
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
add_filter( 'woocommerce_product_categories_widget_args', 'woo_product_cat_widget_args' ); | |
function woo_product_cat_widget_args( $cat_args ) { | |
$cat_args['exclude'] = array('16'); | |
return $cat_args; | |
} |
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
DELETE from wp_users where wp_users.ID not in ( | |
SELECT meta_value FROM wp_postmeta WHERE meta_key = '_customer_user' | |
) AND wp_users.ID not in ( | |
select distinct(post_author) from wp_posts | |
); | |
delete from wp_usermeta where wp_usermeta.user_id not in (select ID from wp_users); |
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 | |
// INFORM GOOGLE SITES TEMP DOWN | |
$protocol = $_SERVER["SERVER_PROTOCOL"]; | |
if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol ) $protocol = 'HTTP/1.0'; | |
header( "$protocol 503 Service Unavailable", true, 503 ); | |
header( 'Content-Type: text/html; charset=utf-8' ); | |
header( 'Retry-After: 600' ); | |
$temp = mysql_error(); | |
$url = curPageURL(); |
NewerOlder