Skip to content

Instantly share code, notes, and snippets.

View fencermonir's full-sized avatar

Md. Monir Hossain fencermonir

View GitHub Profile
@fencermonir
fencermonir / disable_update_notice.php
Created March 6, 2020 10:05
Disable plugin update notice for use.
// disable update notice for plugins
<?php
function disable_plugin_updates( $value ) {
$pluginsToDisable = [
'events-calendar-pro/events-calendar-pro.php', // folder_name/main_file_name.php
'the-events-calendar/the-events-calendar.php',
];
if ( isset($value) && is_object($value) ) {
foreach ($pluginsToDisable as $plugin) {
if ( isset( $value->response[$plugin] ) ) {
<?php
/*
* Plugin Name: Neofarmers Report System
* Description: This plugin is for show reports of woocommerce.
* Author: Monir Hossain
* Version: 1.0
* License: GPL2
* Text Domain: neo-woo-report
*/
/**
@fencermonir
fencermonir / demo.php
Created February 18, 2020 11:08 — forked from thinhbg59/demo.php
Add ux builder shortcode - Flatsome Theme
<?php
/*
Plugin Name: OT Flatsome Ultimate Addons
Plugin URI: https://ninewp.com
Description: OT Flatsome Ultimate Addons
Version: 1.0.0
Author: thinhbg59
Text Domain: OT_FL_Ultimate_Addons
Domain Path: /languages
@fencermonir
fencermonir / functions.php
Created February 18, 2020 11:08 — forked from dfinnema/functions.php
Flatsome UX Builder Addon - Scroll Down
/**
*
* Flatsome UX Builder Addon
*
* adds a scroll to mouse animation to parts of the page
*
* Dependent files (in your child theme):
* /css/scroll.min.css
*
* Parent Theme Supported
function mysite_pending($order_id) {
error_log("$order_id set to PENDING", 0);
}
function mysite_failed($order_id) {
error_log("$order_id set to FAILED", 0);
}
function mysite_hold($order_id) {
error_log("$order_id set to ON HOLD", 0);
}
function mysite_processing($order_id) {
@fencermonir
fencermonir / pluing_installed.php
Created February 7, 2020 17:02
List of popular plugin is active checking code.
### WooCommerce ###
/**
* Check if WooCommerce is active
**/
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
// Put your plugin code here
}
@fencermonir
fencermonir / orderBy.php
Created February 3, 2020 04:31
Sorts a collection of arrays or objects by key.
function orderBy($items, $attr, $order)
{
$sortedItems = [];
foreach ($items as $item) {
$key = is_object($item) ? $item->{$attr} : $item[$attr];
$sortedItems[$key] = $item;
}
if ($order === 'desc') {
krsort($sortedItems);
} else {
<?php
/**
* Functions and Hooks for product meta box data
*
* @package Supro
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@fencermonir
fencermonir / woo_order_statuses_list.php
Created January 19, 2020 19:01
Get Woocommerce registered order status list.
<?php
$statuses = wc_get_order_statuses();
foreach( $statuses as $status => $status_name ) {
?>
<option value="<?php echo $status; ?>"><?php echo $status_name; ?></option>
<?php
}
@fencermonir
fencermonir / wp_ajax.js
Created January 13, 2020 09:48
WordPress ajax js format
jQuery.ajax({
type: "POST",
url: url,
data: data,
beforeSend: function () {},
success: function(response) {},
complete: function() {}
});