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
| //Multiple submissions of the same form is definitely one of the most common problem seen when working with web forms. //Here’s a super useful piece of code to prevent multiple submissions of the same form. | |
| $(document).ready(function() { | |
| $('form').submit(function() { | |
| if(typeof jQuery.data(this, "disabledOnSubmit") == 'undefined') { | |
| jQuery.data(this, "disabledOnSubmit", { submited: true }); | |
| $('input[type=submit], input[type=button]', this).each(function() { | |
| $(this).attr("disabled", "disabled"); | |
| }); | |
| return true; |
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
| //Here’s a code snippet that allows your plugin to create a new folder in the /uploads directory on activation. Could be useful if your plugin needs to allow imports or uploads and you want them stored in a separate directory. | |
| function myplugin_activate() { | |
| $upload = wp_upload_dir(); | |
| $upload_dir = $upload['basedir']; | |
| $upload_dir = $upload_dir . '/mypluginfiles'; | |
| if (! is_dir($upload_dir)) { | |
| mkdir( $upload_dir, 0700 ); | |
| } |
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
| //Here’s a code snippet that allows your plugin to create a new folder in the /uploads directory on activation. Could be useful if your plugin needs to allow imports or uploads and you want them stored in a separate directory. | |
| function myplugin_activate() { | |
| $upload = wp_upload_dir(); | |
| $upload_dir = $upload['basedir']; | |
| $upload_dir = $upload_dir . '/mypluginfiles'; | |
| if (! is_dir($upload_dir)) { | |
| mkdir( $upload_dir, 0700 ); | |
| } |
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
| //Simply paste the code snippet below in your functions.php file: | |
| add_filter('the_generator', 'digwp_complete_version_removal'); | |
| function digwp_complete_version_removal() { | |
| return ''; | |
| } |
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
| //WordPress uses a variable $template to store the template being used. Therefore, for debugging (not recommended for a live site), you can put this in your theme's functions.php: | |
| add_action('wp_head', 'show_template'); | |
| function show_template() { | |
| global $template; | |
| print_r($template); | |
| } |
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_filter('widget_text', 'do_shortcode'); |
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 | |
| /* | |
| Plugin Name: Genesis Tabs | |
| Plugin URI: http://www.studiopress.com/plugins/genesis-tabs | |
| Description: Genesis Simple Tabs extends the Featured Post widget to create a simple tabbed area. | |
| Author: StudioPress | |
| Author URI: http://www.studiopress.com | |
| Version: 0.9.0 |
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_action('wp_head','sfc_base_meta'); // Removes Simple Facebook Connect Meta | |
| remove_action('wp_head','sgc_base_meta');// Removes Simple Google Connect Meta | |
| ?> |
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 | |
| function twentyten_custom_scripts() { | |
| add_action('template_redirect', 'twentyten_custom_scripts'); | |
| if( is_page('Contact')) { | |
| // how is_page works http://codex.wordpress.org/Function_Reference/is_page | |
| // is_page(); | |
| // When any single Page is being displayed. | |
| // is_page(42); | |
| // When Page 42 (ID) is being displayed. |
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 a span around the letters "WP" in Site Title | |
| * @author Jason Tucker | |
| * Based on code by Bill Erickson | |
| * | |
| * Why fork? | |
| * Bill's code resulted in having the <span></span> | |
| * be included in the id="title" which was problematic | |
| * for the site I as working on my method breaks up the |