Skip to content

Instantly share code, notes, and snippets.

View obiPlabon's full-sized avatar
🎯
1 goal

Md Obidullah obiPlabon

🎯
1 goal
View GitHub Profile
@mayeenulislam
mayeenulislam / pending-post-bubble-in-admin-menu.php
Last active July 13, 2021 22:27
Show a pending posts count on Custom Post Type menu label like Plugin Update Notification count. Thanks to Samik Chattopadhyay for the nice snippet.
/**
* Get posts pending count as per Post Type.
* @param string $post_type
* @return integer Pending count.
*/
function project_get_pending_items( $post_type ) {
global $wpdb;
$pending_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = %s AND post_status = 'pending'", $post_type ) );
return (int) $pending_count;
}
@porimol
porimol / country_name_with_iso.php
Created June 2, 2015 18:19
232 Countries Name, Dialer Prefix and ISO Information
<?php
$countries = array();
$countries[] = array("iso_code"=>"AF","country_name"=>"Afghanistan","country_code"=>"93");
$countries[] = array("iso_code"=>"AL","country_name"=>"Albania","country_code"=>"355");
$countries[] = array("iso_code"=>"DZ","country_name"=>"Algeria","country_code"=>"213");
$countries[] = array("iso_code"=>"AS","country_name"=>"American Samoa","country_code"=>"1");
$countries[] = array("iso_code"=>"AD","country_name"=>"Andorra","country_code"=>"376");
$countries[] = array("iso_code"=>"AO","country_name"=>"Angola","country_code"=>"244");
$countries[] = array("iso_code"=>"AI","country_name"=>"Anguilla","country_code"=>"1");
$countries[] = array("iso_code"=>"AG","country_name"=>"Antigua","country_code"=>"1");
@johnbillion
johnbillion / hierarchy.php
Last active June 22, 2023 23:05
ASCII WordPress Template Hierarchy
<?php
/*
WordPress Theme Template Hierarchy Last updated for WordPress 5.4
==================================
This diagram is partially simplified for legibility. To view the complete template hierarchy in use on your site see the
Template panel in the Query Monitor plugin.
@mindfullsilence
mindfullsilence / wpcf7_select_posttype.php
Created August 18, 2014 16:25
Custom input fields for Contact Form 7 Wordpress Plugin
<?php
/**
** A base module for [select_posttype] and [select_posttype*]
**/
/* Shortcode handler */
add_action( 'wpcf7_init', 'wpcf7_add_shortcode_select_posttype' );
function wpcf7_add_shortcode_select_posttype() {
@staltz
staltz / introrx.md
Last active April 29, 2025 08:33
The introduction to Reactive Programming you've been missing
@paulund
paulund / example-wp-list-table.php
Last active January 28, 2025 16:01
An example code of using the WP_List_Table class. With Pagination.
<?php
/*
* Plugin Name: Paulund WP List Table Example
* Description: An example of how to use the WP_List_Table class to display data in your WordPress Admin area
* Plugin URI: http://www.paulund.co.uk
* Author: Paul Underwood
* Author URI: http://www.paulund.co.uk
* Version: 1.0
* License: GPL2
*/
@rxaviers
rxaviers / gist:7360908
Last active April 29, 2025 17:19
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@thenbrent
thenbrent / extend-subscription-intervals.php
Last active May 14, 2024 21:04
Add a new billing interval to WooCommerce Subscriptions. Specifically a "every 10 weeks" billing interval to selling a subscription to something and be charged every 10 weeks.
<?php
/**
* Plugin Name: Extend WooCommerce Subscription Intervals
* Description: Add a "every 10 weeks" billing interval to WooCommerce Subscriptions
* Author: Brent Shepherd
* Author URI: http://brent.io
* Version: 1.0
* License: GPL v2
*/
<?php
/**
* Plugin Name: EDD Heartbeat API test plugin
* Description: Demonstrates how to use the Heartbeat API to update the payments count on the dashboard
*/
// Load the heartbeat JS
function edd_heartbeat_enqueue( $hook_suffix ) {
// Make sure the JS part of the Heartbeat API is loaded.
wp_enqueue_script( 'heartbeat' );
@charleslouis
charleslouis / custom-search-acf-wordpress.php
Last active December 15, 2023 09:11
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request
<?php
/**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
}