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 | |
| /** | |
| * Set permalink from functions.php | |
| */ | |
| function set_permalink(){ | |
| global $wp_rewrite; | |
| $wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%postname%/'); | |
| } | |
| add_action('init', 'set_permalink'); | |
| ?> |
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 | |
| /** | |
| * Detect Iphone | |
| */ | |
| global $is_iphone; | |
| if($is_iphone) { | |
| // User in on an iPhone. | |
| } | |
| ?> |
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 | |
| /** | |
| * Add CSS to Visual Editor. | |
| * The parameter $custom_stylesheet is the name of the stylesheet, relative to the theme root. | |
| * It also accepts an array of stylesheets. It is optional and defaults to ‘editor-style.css’. | |
| */ | |
| $custom_stylesheet = 'css/custom-editor-style.css'; | |
| add_editor_style($custom_stylesheet); |
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 | |
| // Hide admin 'Screen Options' tab | |
| function remove_screen_options_tab() | |
| { | |
| return false; | |
| } | |
| add_filter('screen_options_show_screen', 'remove_screen_options_tab'); | |
| ?> |
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 | |
| /** | |
| * Remove Default Post Type | |
| */ | |
| add_action('admin_menu','remove_default_post_type'); | |
| function remove_default_post_type() { | |
| remove_menu_page('edit.php'); |
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 | |
| /** | |
| * Customize WP Menu Icon | |
| */ | |
| function add_menu_icons_styles(){ | |
| ?> | |
| <style> |
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 Categories and/or Tags to page | |
| */ | |
| function myplugin_settings() { | |
| // Add tag metabox to page | |
| register_taxonomy_for_object_type('post_tag', 'page'); | |
| // Add category metabox to page |
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 | |
| /** | |
| * Remove theme editor | |
| * | |
| * Disable plugins editor | |
| */ | |
| function remove_editor_menu() { | |
| remove_action('admin_menu', '_add_themes_utility_last', 101); |
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
| /** | |
| * Disable jpeg compression | |
| */ | |
| add_filter('jpeg_quality', function($arg){return 100;}); |
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 plugin updates | |
| */ | |
| remove_action( 'load-update-core.php', 'wp_update_plugins' ); | |
| add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) ); |