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 | |
/** | |
* Add Facebook Button to Display Posts Shortcode plugin | |
* @author Bill Erickson | |
* @link http://wordpress.org/extend/plugins/display-posts-shortcode/ | |
* @link http://wordpress.org/support/topic/facebook-likeshare-button-at-the-end-of-excerpt | |
* | |
* @param $output string, the original markup for an individual post | |
* @param $atts array, all the attributes passed to the shortcode | |
* @param $image string, the image part of the output |
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
/** | |
* This code should be added to functions.php of your theme | |
**/ | |
add_filter('woocommerce_empty_price_html', 'custom_call_for_price'); | |
function custom_call_for_price() { | |
return 'Call for price'; | |
} |
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 | |
// This is the meat of the plugin and should go in mu-plugins/0-env-url-override.php | |
// Only load these filters if we're not in the production environment | |
if ( defined( 'ENV_NOT_PRODUCTION' ) && ENV_NOT_PRODUCTION ) { | |
// This always needs to be filtered | |
add_filter( 'site_url', 'env_filter_site_url', 0 ); | |
// We don't filter home_url in the admin so that we get production URLs for posts. | |
// This does break certain links like "Preview/View Post", however. |
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
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
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: Disable plugins when doing local dev | |
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify | |
Version: 0.1 | |
License: GPL version 2 or any later version | |
Author: Mark Jaquith | |
Author URI: http://coveredwebservices.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
#!/usr/bin/env ruby | |
# giftube – Generates an animated gif from a YouTube url. | |
# | |
# Usage: | |
# | |
# giftube [youtube url] [minute:second] [duration] | |
# | |
# ex. | |
# |
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 | |
function dap_responsive_img_caption_filter( $val, $attr, $content = null ) { | |
extract( shortcode_atts( array( | |
'id' => '', | |
'align' => '', | |
'width' => '', | |
'caption' => '' | |
), $attr | |
) ); | |
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 | |
add_action( 'init', array( &$this, 'change_post_object_label' ), 0 ); | |
add_action( 'admin_menu', array( &$this, 'change_post_menu_label' ), 0 ); | |
add_filter( 'post_updated_messages', array( &$this, 'post_updated_messages') ); | |
function change_post_menu_label() { | |
global $menu; | |
global $submenu; | |
if( isset( $menu[5], $submenu['edit.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 | |
/** | |
* Text Field | |
* | |
* A simple text field callback to use with the Settings API. Don't forget to pass in | |
* the arguments array. Here's an example call to add_settings_field() : | |
* | |
* add_settings_field( 'my_option', __( 'My Option' ), 'foo_field_text', 'theme_options', 'general', array( | |
* 'name' => 'my_theme_options[my_option]', | |
* 'value' => $options['my_option'], // assuming $options is declared |
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_dashboard_widgets() { | |
global $wp_meta_boxes; | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); | |
// unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); | |
// unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); | |
// unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_drafts']); | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); // WordPress Blog | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); // Other WordPress News |
OlderNewer