This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Remove meta boxes | |
* | |
* @return void | |
*/ | |
function prefix_remove_meta_boxes() { | |
/* Publish meta box. */ | |
remove_meta_box( 'submitdiv', 'post', 'normal' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add custom directory filter | |
* | |
* 'ev_custom_upload_directory' | |
*/ | |
function ev_pre_upload( $file ) { | |
add_filter( 'upload_dir', 'ev_custom_upload_directory' ); | |
return $file; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.11) | |
// Compass (v1.0.3) | |
// ---- | |
// Your Example | |
#id > .element { | |
#{selector-unify(&, div)} { | |
color: blue; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Order get_terms() by number | |
* | |
* @param string $orderby ORDERBY clause of the terms query. | |
* @param array $args An array of terms query arguments. | |
* @param string|array $taxonomies A taxonomy or array of taxonomies. | |
* @return string | |
*/ | |
function prefix_get_terms_orderby_numeric( $orderby, $args, $taxonomies ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Move Category Post Counts Inside Link | |
* | |
* filters wp_list_categories() | |
* | |
* @param string $links link html output | |
* @return string | |
*/ | |
function prefix_move_category_count( $links ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Hook into Admin_footer on taxonomy edit screens | |
* | |
* @return void | |
*/ | |
function prefix_hide_term_metabox() { | |
global $current_screen; | |
$output = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add attachment metadata | |
* | |
* By default, WordPress only adds '_wp_attachment_metadata' metadata to images, audio and video files. | |
* This hooks into 'wp_update_attachment_metadata' and sets 'file' to the value of '_wp_attached_file'. | |
*/ | |
function prefix_update_attachment_metadata( $data, $post_id ) { | |
// only set 'file' if needed | |
if ( isset( $data['file'] ) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Set custom upload directory | |
* | |
* Images => /img | |
* PDF => /pdf | |
* Misc => /misc | |
* | |
* Note: Doesn't work with 'browser uploader' | |
* Note: Use with 'wp_update_attachment_metadata' hook if we want to define our own attachment metadata | |
* Allowed file types: http://codex.wordpress.org/Uploading_Files#About_Uploading_Files_on_Dashboard |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* Safe Search and Replace on Database with Serialized Data v2.1.1 | |
* | |
* This script is to solve the problem of doing database search and replace when | |
* developers have only gone and used the non-relational concept of serializing | |
* PHP arrays into single database columns. It will search for all matching | |
* data on the database and change it, even if it's within a serialized PHP | |
* array. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change order of Yoast SEO plugin meta box | |
* | |
* Plugin: Yoast SEO | |
*/ | |
function prefix_yoast_meta_order() { | |
return 'low'; |