Skip to content

Instantly share code, notes, and snippets.

View MyronProDev's full-sized avatar

Myron MyronProDev

  • PHP Developer
  • Ukraine, Kyiv
View GitHub Profile
@rniswonger
rniswonger / wp-disable-plugin-update.php
Last active November 18, 2024 16:54
WordPress - Disable specific plugin update check
/**
* Prevent update notification for plugin
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
* Place in theme functions.php or at bottom of wp-config.php
*/
function disable_plugin_updates( $value ) {
if ( isset($value) && is_object($value) ) {
if ( isset( $value->response['plugin-folder/plugin.php'] ) ) {
unset( $value->response['plugin-folder/plugin.php'] );
}
@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;
}
@hlashbrooke
hlashbrooke / class.php
Created February 28, 2014 08:37
A complete, versatile options page class for any WordPress plugin
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
class WordPress_Plugin_Template_Settings {
private $dir;
private $file;
private $assets_dir;
private $assets_url;
private $settings_base;