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_action('init' , 'mm_update_user' , 0); | |
function mm_update_user(){ | |
$user = get_user_by( 'login', 'developer' ); // Replace 'developer' with username | |
$user_id = $user->ID; | |
$password = 'sfsdfsdfsdf123SFSD#'; |
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 | |
echo shell_exec("zip -r wp-content.zip wp-content"); |
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( 'manage_shop_order_posts_columns', 'show_purchased_by_shop_order_columns' , 100 ); | |
add_action( 'manage_shop_order_posts_custom_column', 'show_purchased_by_render_shop_order_columns', 2 ); | |
add_filter( 'manage_edit-shop_order_sortable_columns', 'show_purchased_by_shop_order_sortable_columns' ); | |
/** | |
* Define custom columns for orders. | |
* @param array $columns | |
* @return array |
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 | |
/* | |
Plugin Name: Admin Filter BY Custom Fields | |
Version: 1.0 | |
Author: Mohammad Mursaleen | |
*/ | |
add_action( 'restrict_manage_posts', 'obj_admin_posts_filter_restrict_manage_posts' ); | |
/** | |
* First create the dropdown |
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 | |
/* | |
Plugin Name: New Register Email Customizer | |
Description: Changes the copy in the email sent out to new users | |
Author: Mohammad Mursaleen | |
*/ | |
// Redefine user notification function | |
if ( !function_exists('wp_new_user_notification') ) { |
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 | |
/** | |
* @author Mohammad Mursaleen | |
* @usange to get array of all markers within certain radius | |
* @param $coordinateArray | |
* @param $center | |
* @param $radius | |
* @return array | |
*/ |
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( 'woocommerce_loop_add_to_cart_link' , 'mm_disable_add_to_cart_if_no_price' , 20 , 2 ); | |
function mm_disable_add_to_cart_if_no_price( $html , $product ){ | |
$product_price = $product->get_price(); | |
if( !empty( $product_price ) || !is_page('wishlist') ){ |
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 | |
/** | |
* @author Mohammad Mursalenen | |
* @param $date | |
* @return mixed | |
*/ | |
function mm_get_date_lang_support($date){ | |
if ( function_exists('icl_object_id') ) { |
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_action('wp_head','mm_wpml_string_transaltion_enable_by_force'); | |
/** | |
* @author Moahammad Mursaleen | |
* @usage to get WPML string translation work by force | |
*/ | |
function mm_wpml_string_transaltion_enable_by_force(){ | |
$icl_sitepress_settings = get_option('icl_sitepress_settings'); |
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 | |
/** | |
* @author Mohammad Mursaleen | |
* @param $text | |
* @param $length | |
* @return mixed | |
*/ | |
function mm_truncate( $text , $length ) { | |
$length = abs( (int)$length ); |
NewerOlder