Skip to content

Instantly share code, notes, and snippets.

View robicse11127's full-sized avatar
🏡
Working remotely!

Md Rabiul Islam Robi robicse11127

🏡
Working remotely!
View GitHub Profile
@robicse11127
robicse11127 / auto-coupon-edd.php
Created March 17, 2022 07:39
EDD Add Auto Coupon
<?php
/**
* Plugin Name: EDD Auto Apply Discount
* Plugin URI: http://pluginurl.com
* Description: Auto apply discount code for checkout
* Version: 1.0.0
* Author: MD. Rabiuyl Islam
* Author URI: http://www.rabiulislamrobi.com/
* Text Domain: edd-auto-apply-discount
*/
@robicse11127
robicse11127 / scrolling.js
Created July 16, 2021 10:06
Scrolling effect with pure js
// Scrolling effect for the updated article contents.
const clickHandler = ( event ) => {
event.preventDefault();
const href = event.target.getAttribute( 'href' );
const target = '[id="' + href.replace( '#', '' ) + '"]';
const offsetTop = document.querySelector( target ).offsetTop;
window.scroll( {
top: offsetTop - 50,
@robicse11127
robicse11127 / youtube-subscriber.md
Last active July 14, 2021 06:07
How to get the YouTube Subscriber counter

How to get YouTube Subscriber counter:

**Step 1 : Go to https://console.developers.google.com/apis/library **

Step 2: Login to your Google Account.

Step 3: Next to logo top logo of "Google Cloud Platform" click on Create New Project.

Step 4: Once the project is created then click on Create Credentials & then after choose 'API Key'.

@robicse11127
robicse11127 / Widgets.php
Created March 28, 2020 14:13
Custom WordPress Widget
<?php
class MyPlugin_Movie_Widget extends WP_Widget {
public function __construct() {
parent::__construct(
'myplugin_movie_list_widget',
'Recent Movies',
[
'classname' => 'myplugin_movie_widget',
'description' => 'Widget for displaying movie lists.'
@robicse11127
robicse11127 / wp-dashboard-widget.php
Created March 23, 2020 00:09
Code for creating WordPress admin dashboard widget.
// Started
@robicse11127
robicse11127 / data-table.php
Last active March 8, 2020 03:27
Post Type Data Table
class DataTable {
/**
* Construct Function
*
* @since 1.0.0
*/
public function __construct() {
/**
* Load Necessary Hooks
*/
@robicse11127
robicse11127 / custom-settings.php
Created March 5, 2020 07:59
Create Custom Settings Page
/**
* Admin Menu Page
*/
function create_myplugin_menu() {
add_menu_page( 'My Plugin', 'Menu Plugin', 'manage_options', 'myplugin', 'myplugin_settings_template', '', null );
}
add_action('admin_menu', 'create_myplugin_menu');
/**
* Menu Page Tempalte
@robicse11127
robicse11127 / package.json
Created February 25, 2020 02:39
Grunt Pakcage Json
{
"name": "webalive",
"version": "1.0.0",
"description": "A WordPress theme for webalive.com",
"Author": "Webalive",
"devDependencies": {
"@babel/core": "^7.8.4",
"@babel/preset-env": "^7.8.4",
"grunt": "^1.0.4",
"grunt-babel": "^8.0.0",
@robicse11127
robicse11127 / Gruntfile.js
Last active March 15, 2020 10:45
Grunt setup for WordPress theme
'use strict';
module.exports = function( grunt ) {
var pkg = grunt.file.readJSON( 'package.json' );
grunt.initConfig({
// Setting folder templates
dirs: {
dist: 'assets/dist/',
source: 'assets/source/',
},
/**
* A function for menu breadcrumb
*
*/
function menu_breadcrumb($theme_location = 'main', $separator = '<span class="separator"> &nbsp;&gt; </span>' ) {
$items = wp_get_nav_menu_items($theme_location);
_wp_menu_item_classes_by_context( $items ); // Set up the class variables, including current-classes
$crumbs = array();