Skip to content

Instantly share code, notes, and snippets.

View deckerweb's full-sized avatar
🏠
Working from home

David Decker deckerweb

🏠
Working from home
View GitHub Profile
@chrisguitarguy
chrisguitarguy / mask-links.php
Created December 14, 2011 14:38
Mask external WordPress links behind a redirect.
@ziadoz
ziadoz / awesome-php.md
Last active May 10, 2024 15:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@bradvin
bradvin / get_current_post_type.php
Created March 5, 2012 18:48 — forked from mjangda/get_current_post_type.php
Get the current post_type context in the WordPress admin.
<?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;
@trepmal
trepmal / wporg-repo-plugins.php
Created June 2, 2012 04:56
WPORG Repo Plugins
<?php
/*
Plugin Name: WPORG Repo Plugins
Description: Widget to display plugins on the wordpress.org repository by author
Author: Kailey Lampert
Author URI: http://kaileylampert.com/
*/
add_action( 'widgets_init', 'register_wporg_repo_plugins' );
function register_wporg_repo_plugins() {
<?php
/*
Plugin Name: Contribution Info Shortcode
Plugin URI: http://www.billerickson.net/
Description: Display information about plugins, tutorials, code snippets, and core contributions
Version: 1.0
Author: Bill Erickson
Author URI: http://www.billerickson.net
License: GPLv2
*/
@israelcurtis
israelcurtis / gist:3798347
Created September 28, 2012 06:57
Use the get_post_field() function to get any of the wp_posts column fields #wordpress #php
<?php
echo get_post_field('post_content', $post_id); // retrieve content
echo get_post_field('post_name', $post_id); // retrieve the slug
?>
@franz-josef-kaiser
franz-josef-kaiser / client_admin_notices.php
Last active August 30, 2019 13:04
Gibt für Kunden Notizen über Änderungen zu WordPress im Adminbereich aus.
<?php
/**
* Plugin Name: Info zu WP-Änderungen
* Description: Informiert Kunden über Änderungen im WordPress Core, der Sprachdatei, etc.
* Version: 15122012.1423
* Author: Franz Josef Kaiser <wecodemore@gmail.com>
* Author URI: https://plus.google.com/107110219316412982437/posts
* License: The MIT License (MIT)
* LicenseURI: http://www.opensource.org/licenses/mit-license.php
*/
@bitfade
bitfade / gist:4555047
Last active January 21, 2022 03:06
WordPress - Remove empty p tags for custom shortcodes
<?php
add_filter("the_content", "the_content_filter");
function the_content_filter($content) {
// array of custom shortcodes requiring the fix
$block = join("|",array("col","shortcode2","shortcode3"));
// opening tag
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700);
body,
h1,
h2,
h2 a,
h2 a:visited,
h3,
h4,
@functionsfile
functionsfile / inc-remove-comments.php
Created January 18, 2013 17:19
Remove WordPress comments functionality.
<?php
/**
* Code taken from the plugin 'Remove Comments Absolutely' by Frank Bültge
* http://wpengineer.com/2230/removing-comments-absolutely-wordpress/
* https://github.com/bueltge/Remove-Comments-Absolutely/blob/master/remove-comments-absolute.php
* http://bueltge.de/
*/
if ( ! class_exists( 'Remove_Comments_Absolute' ) ) {
add_action( 'plugins_loaded', array( 'Remove_Comments_Absolute', 'get_object' ) );