Skip to content

Instantly share code, notes, and snippets.

Sébastien Méric smeric

Block or report user

Report or block smeric

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
westonruter / wp-42573.php
Last active Jun 11, 2019
WP Trac #42573: Fix for theme template caching.
View wp-42573.php
* Plugin name: WP Trac #42573: Fix for theme template file caching.
* Description: Flush the theme file cache each time the admin screens are loaded which uses the file list.
* Plugin URI:
* Author: Weston Ruter, XWP.
* Author URI:
function wp_42573_fix_template_caching( WP_Screen $current_screen ) {
DomenicF / get_current_post_type.php
Last active Mar 6, 2019 — forked from bradvin/get_current_post_type.php
Get the current post_type context in the WordPress admin.
View get_current_post_type.php
* gets the current post type in the WordPress Admin
function get_current_post_type() {
global $post, $typenow, $current_screen;
//we have a post so we can just get the post type from that
if ( $post && $post->post_type ) {
return $post->post_type;
herewithme / sanitize-filename.php
Created Nov 29, 2013
WordPress - No french punctuation and accents for filename
View sanitize-filename.php
Plugin Name: No french punctuation and accents for filename
Description: Remove all french punctuation and accents from the filename of upload for client limitation (Safari Mac/IOS)
Plugin URI:
Version: 1.0
Author: BeAPI
Author URI:
charleslouis / custom-search-acf-wordpress.php
Last active Nov 6, 2019
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request
View custom-search-acf-wordpress.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;
joncave / plugin.php
Last active Nov 1, 2019
An intentionally vulnerable plugin developed for WordPress plugin author education.
View plugin.php
/* Plugin Name: Damn Vulnerable WordPress Plugin
* Description: Intentionally vulnerable plugin for plugin author education
* Version: 0.1
* Plugin URI:
* Author: Jon Cave
* Author URI:
* License: GPLv2+
ohaal / find_relative_path.func.php
Created Jun 15, 2012
Find the relative path between two paths
View find_relative_path.func.php
* Find the relative file system path between two file system paths
* @param string $frompath Path to start from
* @param string $topath Path we want to end up in
* @return string Path leading from $frompath to $topath
function find_relative_path ( $frompath, $topath ) {
franz-josef-kaiser / example_post_status.php
Created Jun 14, 2012
Add a custom post status for WP (custom) post types
View example_post_status.php
// No, Thanks. Direct file access forbidden.
! defined( 'ABSPATH' ) AND exit;
add_action( 'after_setup_theme', array( 'unavailable_post_status', 'init' ) );
class unavailable_post_status extends wp_custom_post_status
peteboere / jquery.alterclass.js
Created Dec 24, 2011
jQuery alterClass plugin: Remove element classes with wildcard matching. Optionally add classes.
View jquery.alterclass.js
* jQuery alterClass plugin
* Remove element classes with wildcard matching. Optionally add classes:
* $( '#foo' ).alterClass( 'foo-* bar-*', 'foobar' )
* Copyright (c) 2011 Pete Boere (
* Free under terms of the MIT license:
seedprod / vt_resize.php
Created Nov 15, 2011
Resize WordPress images on the fly vt_resize w/ multisite support
View vt_resize.php
* Resize images dynamically using wp built in functions
* Victor Teixeira
* php 5.2+
* Exemplo de uso:
* <?php
faisalman / analytics-regexp.js
Created Apr 18, 2011
Regular Expression snippets to validate Google Analytics tracking code (in PHP, JavaScript)
View analytics-regexp.js
* Regular Expression snippets to validate Google Analytics tracking code
* see
* @author Faisalman <>
* @license
* @link
* @param str string to be validated
* @return Boolean
You can’t perform that action at this time.