Skip to content

Instantly share code, notes, and snippets.

@jorenvh
Created December 19, 2016 10:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorenvh/737c7ffd096f50881db10f20c804e6c7 to your computer and use it in GitHub Desktop.
Save jorenvh/737c7ffd096f50881db10f20c804e6c7 to your computer and use it in GitHub Desktop.
WP filters & actions (support windows azure WP plugin)
<?php
/*
|--------------------------------------------------------------------------
| Actions
|--------------------------------------------------------------------------
|
| Wordpress add_action functions.
|
|
|
*/
/**
* Add custom post status
*/
add_action( 'init', 'my_custom_post_status' );
/**
* Load extra scripts
*/
add_action( 'wp_enqueue_scripts', 'mh_load_my_script' );
/**
* Add custom js for admin theme
*/
add_action( 'admin_enqueue_scripts', 'td_admin_scripts' );
/**
* Add custom css for admin theme
*/
add_action( 'admin_enqueue_scripts', 'td_admin_styles' );
/**
* Add images to RSS feed
*/
add_action('rss2_item', 'add_my_rss_node');
/**
* Remove tag meta box from posts
*/
add_action( 'init', 'remove_tag_meta_box' );
/**
* Remember country & language
*/
add_action('init', 'language_saver');
/*
|--------------------------------------------------------------------------
| Filters
|--------------------------------------------------------------------------
|
|
|
|
|
*/
/**
* fix deprecated
*/
add_filter('deprecated_constructor_trigger_error', '__return_false');
/**
* Add specials to the permalink sturcture.
*/
add_filter('post_link', 'specials_permalink', 10, 3);
add_filter('post_type_link', 'specials_permalink', 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment