Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| <?php | |
| /* | |
| Plugin Name: Mask Outbound Links | |
| Plugin URI: http://www.christopherguitar.net/ | |
| Description: Masks outbound links behind a redirect | |
| Author: Christopher Davis | |
| Author URI: http://www.christopherguitar.net/ | |
| License: GPL2 | |
| */ |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| <?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; |
| <?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 | |
| */ |
| <?php | |
| echo get_post_field('post_content', $post_id); // retrieve content | |
| echo get_post_field('post_name', $post_id); // retrieve the slug | |
| ?> |
| <?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 <[email protected]> | |
| * Author URI: https://plus.google.com/107110219316412982437/posts | |
| * License: The MIT License (MIT) | |
| * LicenseURI: http://www.opensource.org/licenses/mit-license.php | |
| */ |
| <?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, |
| <?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' ) ); |