This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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_action('publish_page', 'add_custom_field_automatically'); | |
add_action('publish_post'. 'add_custom_field_automatically'); | |
function add_custom_field_automatically($post_ID) { | |
global $wpdb; | |
if(!wp_is_post_revision($post_ID)) { | |
add_post_meta($post_ID, 'FIELD_NAME', 'CUSTOM VALUE', true); | |
} | |
} |
This file contains 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
function wps_force_ssl( $force_ssl, $post_id = 0, $url = '' ) { | |
if ( $post_id == 25 ) { | |
return true | |
} | |
return $force_ssl; | |
} | |
add_filter('force_ssl' , 'wps_force_ssl', 10, 3); |
This file contains 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_filter('comment_form_default_fields', 'unset_url_field'); | |
function unset_url_field($fields){ | |
if(isset($fields['url'])) | |
unset($fields['url']); | |
return $fields; | |
} |
This file contains 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
function wps_admin_pages_redirect() { | |
global $pagenow; | |
$admin_pages = array( | |
'edit-tags.php?taxonomy=category', | |
'edit-tags.php?taxonomy=post_tag', | |
'link-manager.php', | |
'options-writing.php', | |
'options-reading.php', | |
'options-discussion.php', | |
'options-media.php', |
This file contains 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 | |
/** | |
* | |
* Plugin Name: Custom Client Plugin | |
* Plugin URI: http://webdesign.com/ | |
* Description: Add custom tweaks to a client's site | |
* Version: 1.0.0 | |
* Author: Benjamin Bradley | |
* Author URI: http://www.benjaminbradley.com/ | |
* |
This file contains 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
function unregister_default_wp_widgets() { | |
unregister_widget('WP_Widget_Calendar'); | |
unregister_widget('WP_Widget_Archives'); | |
unregister_widget('WP_Widget_Categories'); | |
unregister_widget('WP_Widget_Recent_Posts'); | |
unregister_widget('WP_Widget_Recent_Comments'); | |
unregister_widget('WP_Widget_RSS'); | |
unregister_widget('WP_Widget_Tag_Cloud'); | |
} | |
add_action('widgets_init', 'unregister_default_wp_widgets', 1); |
This file contains 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
function remove_default_page_screen_metaboxes() { | |
remove_meta_box( 'commentstatusdiv','page','normal' ); // Comments | |
remove_meta_box( 'trackbacksdiv','page','normal' ); // Talkback | |
} | |
add_action('admin_menu','remove_default_page_screen_metaboxes'); | |
OlderNewer