Skip to content

Instantly share code, notes, and snippets.

@mavinothkumar
mavinothkumar / gist:2ea3a5b82b838d8167c252b359adf0ff
Last active September 27, 2019 10:41
Create a Taxonomy for Custom Post Event
/**
* Create a Taxonomy for Custom Post Event
* Paste this code in Theme function.php
*/
add_action('init', 'create_event_taxonomy', 0);
if ( ! function_exists('create_event_taxonomy')) {
function create_event_taxonomy()
{
register_taxonomy(
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Mypos\IPC\Cart;
use Mypos\IPC\Config;
use Mypos\IPC\Customer;
use Mypos\IPC\Defines;
use Mypos\IPC\IPC_Exception;
add_filter('illegal_user_logins', 'fed_illegal_user_logins');
/**
* @return array
*/
function fed_illegal_user_logins()
{
return array('user', 'ban', 'message');
}
<?php
return array(
'NA' => array(
"AI", "AG", "AR", "AW", "BS", "BB", "BZ", "BM", "BO", "BR", "CA", "KY", "CL", "CO", "CR", "CU", "DM", "DO",
"EC", "SV", "FK", "GF", "GL", "GD", "GP", "GT", "GY", "HT", "HN", "JM", "MQ", "MX", "MS", "AN", "NI", "PA",
"PY", "PE", "PR", "KN", "LC", "PM", "VC", "SR", "TT", "TC", "US", "UY", "VE", "VG", "VI",
),
'SA' => array(
"AI", "AG", "AR", "AW", "BS", "BB", "BZ", "BM", "BO", "BR", "CA", "KY", "CL", "CO", "CR", "CU", "DM", "DO",
@mavinothkumar
mavinothkumar / gist:d46ee467cdca4b314073d41b231a19dd
Created August 2, 2019 12:09
How to change Visit Dashboard
add_filter('fed_frontend_dashboard_title_btn',function (){
return 'YOUR_CUSTOM_TEXT';
});
@mavinothkumar
mavinothkumar / gist:41ba49744f5657e108f58c278dd47092
Created July 16, 2019 16:19
WordPress Plugin Update Example
{
"name": "My Example Plugin",
"version": "2.0",
"download_url": "http://example.com/updates/example-plugin.zip",
"homepage": "http://example.com/",
"requires": "4.5",
"tested": "4.8",
"last_updated": "2017-01-01 16:17:00",
"upgrade_notice": "Here's why you should upgrade...",
array(
'africa' => array(
"DZ", "AO", "BJ", "BW", "BF", "BI", "CM", "CV", "CF", "KM", "CD", "DJ", "EG", "GQ", "ER", "ET",
"GA", "GM", "GH", "GN", "GW", "CI", "KE", "LS", "LR", "LY", "MG", "MW", "ML", "MR", "MU", "MA",
"MZ", "NA", "NE", "NG", "CG", "RE", "RW", "SH", "ST", "SN", "SC", "SL", "SO", "ZA", "SS", "SD",
"SZ", "TZ", "TG", "TN", "UG", "EH", "ZM", "ZW",
),
'america' => array(
"AI", "AR", "AW", "BS", "BB", "BZ", "BM", "BO", "BR", "VG", "CA", "KY", "CL", "CO", "CR", "CU",
@mavinothkumar
mavinothkumar / multiple_custom_menu
Last active September 3, 2021 11:45
Multiple Custom Menu
/**
* From Frontend Dashboard version 1.2
*/
add_filter( 'fed_add_custom_menu', 'fed_frontend_main_menu_fn' );
add_action( 'fed_frontend_dashboard_menu_container', 'fed_frontend_dashboard_menu_container_fn', 10, 2 );
/**
* Create custom main menu
*
* @param array $custom
@mavinothkumar
mavinothkumar / functions.php
Last active January 6, 2019 08:11
Frontend Dashboard Custom Menu
<?php
/**
* From Frontend Dashboard version 1.2
*/
add_filter( 'fed_frontend_main_menu', 'fed_frontend_main_menu_fn' );
add_action( 'fed_frontend_dashboard_menu_container', 'fed_frontend_dashboard_menu_container_fn', 10, 2 );
/**
* Create custom main menu
@mavinothkumar
mavinothkumar / php-webscraping.md
Created October 5, 2016 18:16 — forked from anchetaWern/php-webscraping.md
web scraping in php

Have you ever wanted to get a specific data from another website but there's no API available for it? That's where Web Scraping comes in, if the data is not made available by the website we can just scrape it from the website itself.

But before we dive in let us first define what web scraping is. According to Wikipedia:

{% blockquote %} Web scraping (web harvesting or web data extraction) is a computer software technique of extracting information from websites. Usually, such software programs simulate human exploration of the World Wide Web by either implementing low-level Hypertext Transfer Protocol (HTTP), or embedding a fully-fledged web browser, such as Internet Explorer or Mozilla Firefox. {% endblockquote %}