The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
- Revised date: 15/12/2013
- Original post
/** Change ‘Add to Cart’ Text on Product Pages **/ | |
add_filter( 'add_to_cart_text', 'woo_custom_cart_button_text' ); // < 2.1 | |
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text' ); // 2.1 + | |
add_filter( 'woocommerce_product_add_to_cart_text', 'woo_custom_cart_button_text' ); // 2.1 + | |
function woo_custom_cart_button_text() { | |
return __( 'Buy Now!', 'woocommerce' ); | |
} |
/** Dashboard Support Widget **/ | |
function eline_dashboard_widget() { | |
echo "<p style='color:red; font-size:200%; font-weight:bold'>Have any questions or need help?</p> | |
<p style='color:blue; font-size:200%'>Send us an email by clicking <a style='color:blue; text-decoration:underline; font-weight:bold' title='Send an email to eLine Studio' href='mailto:orlando@elinestudio.com?Subject=Support%20Message' target='_top'>HERE</a>.</p> | |
<p style='color:black; font-size:200%; font-weight:bold'><strong>Thank you for choosing eLine Studio!</strong></p>"; | |
} | |
function add_eline_dashboard_widget() { | |
wp_add_dashboard_widget('eline_dashboard_widget', 'Website Support', 'eline_dashboard_widget'); | |
} | |
add_action('wp_dashboard_setup', 'add_eline_dashboard_widget'); |
/** Login Screen **/ | |
function eline_login_logo() { ?> | |
<style type="text/css"> | |
.login h1 a { | |
background-image: url(http://www.elinestudio.com/wp-content/uploads/2015/05/eline-logo-login.png); | |
padding-bottom: 0px; | |
} | |
</style> | |
<?php } | |
add_action( 'login_enqueue_scripts', 'eline_login_logo' ); |
/** Disable Theme and Plugin Editor **/ | |
define( 'DISALLOW_FILE_EDIT', true ); |
/** Change Number of Default Post Revisions **/ | |
define( 'WP_POST_REVISIONS', 3 ); |
p { | |
border-style: solid; | |
border-width: 0px 0px 0px 15px; | |
-moz-border-image: url(http://border-image.png) 0 0 0 15 repeat; | |
-webkit-border-image: url(http://border-image.png) 0 0 0 15 repeat; | |
-o-border-image: url(http://border-image.png) 0 0 0 15 repeat; | |
border-image: url(http://border-image.png) 0 0 0 15 repeat; | |
} |
/** Remove Admin Bar Logo **/ | |
function eline_admin_bar_remove() { | |
global $wp_admin_bar; | |
/* Remove WP Menu */ | |
$wp_admin_bar->remove_menu('wp-logo'); | |
} | |
add_action('wp_before_admin_bar_render', 'eline_admin_bar_remove', 0); |
/** Admin Bar Hello Greeting **/ | |
add_filter( 'admin_bar_menu', 'eline_howdy_to_hello', 25 ); | |
function eline_howdy_to_hello( $wp_admin_bar ) { | |
$my_account = $wp_admin_bar->get_node('my-account'); | |
$newtitle = str_replace( 'Howdy,', 'Welcome,', $my_account->title ); | |
$wp_admin_bar->add_node( array( | |
'id' => 'my-account', | |
'title' => $newtitle, | |
)); | |
} |